-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Update new bundle-range to policies after bundle split #17797
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] Update new bundle-range to policies after bundle split #17797
Conversation
| for (NamespaceBundle sBundle : splittedBundles.getRight()) { | ||
| checkNotNull(ownershipCache.tryAcquiringOwnership(sBundle)); | ||
| } | ||
| updateNamespaceBundlesForPolicies(nsname, splittedBundles.getLeft()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about update updateNamespaceBundlesForPolicies success but updateNamespaceBundles fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modify the execution order of the two methods to ensure that updateNamespaceBundlesForPolicies is executed after updateNamespaceBundles is completed.
@mattisonchao PTAL,thanks!
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
Outdated
Show resolved
Hide resolved
| + "NamespaceBundle: %s due to %s", | ||
| nsname.toString(), bundle.getBundleRange(), e.getMessage()); | ||
| LOG.warn(msg); | ||
| updateFuture.completeExceptionally( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what will happen if updateFuture completeExceptionally here and complete success in L896(after updateNamespaceBundles success). There is no executing order guarantee for these two ops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what will happen if updateFuture completeExceptionally here and complete success in L896(after updateNamespaceBundles success).
Local policies were updated successfully, but policies update failed.
There is no executing order guarantee for these two ops.
I can add an order guarantee: updateNamespaceBundlesForPolicies is only executed after updateNamespaceBundles is executed successfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add an order guarantee: updateNamespaceBundlesForPolicies is only executed after updateNamespaceBundles is executed successfully!
@Jason918 PTAL,thanks!
| @@ -884,15 +884,28 @@ void splitAndOwnBundleOnceAndRetry(NamespaceBundle bundle, | |||
| .thenRun(() -> { | |||
| bundleFactory.invalidateBundleCache(bundle.getNamespaceObject()); | |||
| updateFuture.complete(splittedBundles.getRight()); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems updateFuture should complete after updateNamespaceBundlesForPolicies completes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed,PTAL,thanks! @Jason918
Jason918
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
6562742 to
438750e
Compare
eolivelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some test to cover this change and also to demonstrate the problem?
OK |
Fixed! PTAL,thanks! @eolivelli |
eolivelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
|
CI passed: lordcheng10#17 |
mattisonchao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@codelipenghui @Technoboy- PTAL,thanks! |
|
/pulsarbot run-failure-checks |
|
@aloyszhang PTAL,thanks! |
|
/pulsarbot run-failure-checks |
2 similar comments
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
3 similar comments
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
18136c1 to
27c16c0
Compare
|
@codelipenghui @Technoboy- PTAL,thanks! |
|
@AnonHxy PTAL,thanks! |
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
Show resolved
Hide resolved
|
LGTM now |
|
/pulsarbot run-failure-checks |
…pache#17797) Co-authored-by: leolinchen <leolinchen@tencent.com>
Motivation
After the bundle is split, update the new bundle information to admin/policies.
Documentation
doc-required(Your PR needs to update docs and you will update later)
doc-not-needed(Please explain why)
doc(Your PR contains doc changes)
doc-complete(Docs have been already added)
Matching PR in forked repository
PR in forked repository: lordcheng10#17