[improve][broker] PIP-433: Ensure topic creation before starting GEO
PIP: #24485
Motivation
In a GEO replication scenario, if the remote cluster does not have the replicated topic and the auto-creation type differs between the local and remote clusters, message replication may fail. To ensure seamless replication, the topic metadata must be properly synchronized across clusters.
This is part of PIP-433.
https://github.com/apache/pulsar/pull/24136 is the same as this PR.
Modifications
-
When both the local and remote partitioned topic metadata indicate
partitions=0, this means the topic is non-partitioned. In this case, the local cluster sends a non-partitioned topic creation request to the remote cluster. -
If the local partitioned topic metadata has
partitions>0, this means the topic is partitioned:- If the remote partitioned topic metadata has
partitions=0, the local cluster sends a partitioned topic creation request to the remote cluster. - If partitions differ between the local and remote cluster, please stop GEO.
- If the remote partitioned topic metadata has
Documentation
- [ ]
doc - [ ]
doc-required - [x]
doc-not-needed - [ ]
doc-complete
Rebase master