Skip to content

[improve][pip]PIP-422 Support global topic-level policy: replicated clusters and new API to delete topic-level policies #24368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented May 30, 2025

Motivation & Modifications

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode added this to the 4.1.0 milestone May 30, 2025
@poorbarcode poorbarcode self-assigned this May 30, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label May 30, 2025
pip/pip-422.md Outdated
### Public API

**new Pulsar Admin API**
- `pulsar-admin topicPolicies --clusters <clusters> --global <topic>`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have bin/pulsar-admin topics set-replication-cluster, it seems we can only add an option instead of a new command.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And for the set-replication-cluster without --global = true. We should only allow to remove the non-local cluster?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have bin/pulsar-admin topics set-replication-cluster, it seems we can only add an option instead of a new command.

Only the command topicPolicies supports the param --global so far, add the new command into topicPolicies is better the topics.

Renamed the sub command name --clusters -> set-replication-cluster


And for the set-replication-cluster without --global = true. We should only allow to remove the non-local cluster?

Users can set a global policy from the remote side, then it will be replicated to the local cluster. After we added this limitation, users only can set a global policy on the local cluster

pip/pip-422.md Outdated
Comment on lines 25 to 28
Passed solutions:
1. Disable namespace-level Geo-Replication then delete the partitioned topic: this will trigger a deletion for other topics, which is not expected.
2. Disable topic-level Geo-Replication under each cluster, and delete the partitioned topic by Admin API: it will delete the shared partitioned topic metadata, which was also deleted from another cluster.
3. Disable topic-level Geo-Replication under each cluster, and delete the sub-topics manually by Admin API: this is the best solution without the current PIP, the defect is that the schema data and topic-level policies are still there.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better to move to # Alternatives?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved them into #Alternatives

pip/pip-422.md Outdated
Comment on lines 41 to 42
- Disable global topic level `replicated clusters`, in other words, set `replicated clusters` with a single list.
- The clusters are not contained in the `replicated clusters` will delete the sub-topics automatically, such as the namespace-level implementation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is any active producers or consumers connected the cluster which been removed from the replicated cluster list, the topic will be create again if topic auto-creation is enabled?

Or it will rely on the global topic policy which defined the replication_cluster. All the producers and consumers will be rejected if the connected cluster is not listed in replicated_clusters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or it will rely on the global topic policy which defined the replication_cluster. All the producers and consumers will be rejected if the connected cluster is not listed in replicated_clusters?

This one. I have added to the proposal. https://github.com/apache/pulsar/pull/24368/files#diff-fca5852dd938f5905286f6ed91af543d8037c02e12726389f9f2ade9ae427c14R46

@poorbarcode poorbarcode requested a review from codelipenghui June 3, 2025 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs PIP type/PIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants