[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.
What about update updateNamespaceBundlesForPolicies success but updateNamespaceBundles fail?
There was a problem hiding this comment.
Modify the execution order of the two methods to ensure that updateNamespaceBundlesForPolicies is executed after updateNamespaceBundles is completed.
@mattisonchao PTAL,thanks!
| + "NamespaceBundle: %s due to %s", | ||
| nsname.toString(), bundle.getBundleRange(), e.getMessage()); | ||
| LOG.warn(msg); | ||
| updateFuture.completeExceptionally( |
There was a problem hiding this comment.
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.
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.
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.
It seems updateFuture should complete after updateNamespaceBundlesForPolicies completes.
6562742 to
438750e
Compare
eolivelli
left a comment
There was a problem hiding this comment.
Can we add some test to cover this change and also to demonstrate the problem?
OK |
Fixed! PTAL,thanks! @eolivelli |
|
CI passed: lordcheng10#17 |
|
@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! |
|
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