Users have two choices when configuring the metadata store when using the feature Geo-Replication: shared or not. All clusters share data that are stored in the global config metadata store if users choose to use a shared metadata store. By the way, the share config metadata store is often built across multiple zones/regions to ensure fault tolerance.
Since the data that is stored in the shared metadata store contains the following pulsar resources: tenants, namespaces, partitioned topics, the Admin API can not be used to delete these pulsar resources for a single cluster. Pulsar has a feature that is used to delete namespace-level resources for a specific cluster when using a shared metadata store, it works as follows:
replicated clusters
contains two clusters c1
and c2
.c1
will be deleted automatically when users remove c1
from the namespace-level policy.The feature above is very useful in the following scenarios:
When using a shared metadata store and enabling Geo-Replication, there is no mechanism for the following scenarios:
Add two new APIs
pulsar-admin topicPolicies --set-replication-cluster -c <clusters> --g <topic>
replicated clusters
, and does not support global policies so far.pulsar-admin topicPolicies delete <topic>
Old Apis
The new APIs will be used for the following scenarios:
A. Delete a partitioned topic under all clusters, if enabled Geo-Replication with a shared config metadata store.
replicated clusters
, in other words, set replicated clusters
with a single list.replicated clusters
will delete the sub-topics automatically, such as the namespace-level implementation.pulsar-admin topicPolicies delete <topic>
for other clusters that are not contained in replicated clusters
.replicated clusters
.B. Delete a partitioned topic under a specified cluster.
replicated clusters
policy, which does not contain the cluster that you want to remove.replicated cluster
from taking effect.Question: Why not add a mechanism that brokers clear global topic-level policies so that the related topic is deleted regularly, which avoids calling pulsar-admin topicPolicies delete <topic>
?
Answer: When users quickly delete and create topics, it will result in the previous policies not being deleted by the scheduled cleaning mechanism, thereby causing confusion.
new Pulsar Admin API
pulsar-admin topicPolicies --set-replication-cluster <clusters> --global <topic>
pulsar-admin topicPolicies delete <topic>
pulsar-admin topics --set-replication-cluster <clusters> <topic>
never supports to delete the local cluster anymore.Nothing.
Nothing.
Nothing.
Nothing.
Nothing.
Nothing.
Nothing.
Nothing.
Nothing.
Nothing.
Passed solutions: