-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Fix wrong behaviour when using namespace.allowed_clusters, such as namespace deletion and namespace policies updating #24860
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
[fix][broker] Fix wrong behaviour when using namespace.allowed_clusters, such as namespace deletion and namespace policies updating #24860
Conversation
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
Outdated
Show resolved
Hide resolved
|
please check this test failure: |
Sure |
ba51818 to
f9ebc24
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #24860 +/- ##
============================================
- Coverage 74.29% 74.20% -0.10%
+ Complexity 33825 33471 -354
============================================
Files 1913 1913
Lines 149281 149375 +94
Branches 17325 17347 +22
============================================
- Hits 110902 110837 -65
- Misses 29540 29682 +142
- Partials 8839 8856 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@poorbarcode Should this fix target also branch-3.0? |
@poorbarcode The support policy is about Apache Pulsar PMC's commitment to perform releases. If there's a severe bug that impacts branch-3.0, it makes sense to target the branch-3.0 as long as necessary. |
…rs, such as namespace deletion and namespace policies updating (apache#24860) (cherry picked from commit 39bb675) (cherry picked from commit a8af8f9)
…rs, such as namespace deletion and namespace policies updating (apache#24860) (cherry picked from commit 39bb675) (cherry picked from commit a8af8f9)

Motivation
Before PIP-321 Introduce allowed-cluster at the namespace level, Pulsar does not support enabling topic level Geo Replication without enabling namespace level Geo Replication, because the policies
namespace.replication_clustershas two meanings:PIP-321 Introduce allowed-cluster at the namespace level defined a new policy
namespace.allowed_clusters, which splits the two definitions.allowed_clustersis not emptyallowed_clusterscan be used to define which cluster is allowed to access the namespace, if it is set.replication_clustersdefines both statuses.3 Issues
PIP-321 did not complete all the adaptations of codes, such as follows
allowedbynamespace.allowed_clusters, the namespace is also unloaded. More importantly, in this case, all brokers will trigger an unloading, which will cause this namespace to remain unavailable for a long time. Every time any policy of the namespace is updated, unload will be triggered again for a round, which will cause the problem to become so serious as to be uncontrollable. The testtestUpdateNamespacePoliciesis used to reproduce the issue.allowed_clusteris defined as2clusters are allowed to access. The testtestDeleteNamespaceIfTwoClustersAllowedis used to reproduce the issue.namespace.allowed_cluster. The testtestUpdateNamespaceIsolationPolicyis used to reproduce the issue.Modifications
replication_clustersandallowed_clustersanywhere, use a common method to deal with them, including the following checksDocumentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: x