[fix][broker] Allow empty replication clusters for namespace policies - #24641
[fix][broker] Allow empty replication clusters for namespace policies#24641omarkj wants to merge 1 commit into
Conversation
This change removes validation that prevented setting empty replication clusters for namespace policies. Previously, the API would reject empty cluster lists, but this is a valid configuration for disabling inter-cluster replication while maintaining topic accessibility within individual clusters. Changes: - Remove CollectionUtils.isEmpty(clusterIds) validation in NamespacesBase.java - Remove empty cluster validation in PersistentTopicsBase.java for topic-level policies - Add comprehensive test coverage for empty replication clusters in V1 and V2 namespace APIs - Verify bidirectional functionality (empty ↔ non-empty cluster configurations) - Ensure no auto-population occurs when explicitly setting empty clusters
|
The changes so far LGTM. I'm just concerned how to remove replication clusters on the command line with Current tests: btw. I now noticed that there's a way to remove the topic policy level configuration for replication clusters. It maps to the However, this isn't the same as setting the list of replication clusters to an empty list. When the topic level replication clusters is removed, it would use the namespace level setting. Being able to set it to an empty list would be necessary to override the namespace level setting so that the topic wouldn't get replicated when using a global configuration store. |
|
I would think that since there is already precedence for Your point on the subtle difference between Another way to address this change would be to add an API similar to This would work for my use case. On the other hand, I do not see why the API should not allow users to disable replication for a specific topic in a replicated namespace. |
|
It seems that PIP-422 https://github.com/apache/pulsar/blob/master/pip/pip-422.md might be conflicting with the result that we'd like to achieve. PIP-422 contains behavior that once the replication clusters is updated for a global topic policy, it will delete the topics in cluster that are no longer part of the replication clusters. Automatically deleting topics in remote clusters could be considered as risky behavior and there should be a way to control this behavior since there might be a requirement where someone would simply want to later on disconnect the replication for a specific topic and continue with the topics independently. @poorbarcode Have you thought about this use case? |
|
Seems this PR is not needed, I have answered here |
This change removes validation that prevented setting empty replication clusters for namespace policies. Previously, the API would reject empty cluster lists, but this is a valid configuration for disabling inter-cluster replication while maintaining topic accessibility within individual clusters.
Changes:
Fixes #24640
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: