-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Avoid split non-existent bundle #25031
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
base: master
Are you sure you want to change the base?
Conversation
|
@coderzc Please add the following content to your PR description and select a checkbox: |
| } | ||
| } | ||
|
|
||
| writeBrokerDataOnZooKeeper(true); |
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.
This wouldn't prevent race conditions. It seems that the method body of org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl#updateAll method should be wrapped with synchronized (bundleSplitStrategy) { to prevent race conditions.
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.
Manually updating BrokerData will lead to severe lock contention. I checked again whether the bundle exists before the split the bundle.
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 is the reason for the severe lock contention? How could it be "severe"?
e2b577f to
2da2096
Compare
2da2096 to
d582d6b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #25031 +/- ##
============================================
- Coverage 74.35% 74.29% -0.07%
+ Complexity 34102 34083 -19
============================================
Files 1920 1921 +1
Lines 150313 150382 +69
Branches 17459 17470 +11
============================================
- Hits 111771 111726 -45
- Misses 29635 29723 +88
- Partials 8907 8933 +26
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Motivation
As you can see from the log, after
0x80000000_0xc0000000was successfully split, it was split again for the second time calling the updateAll() method and failed to split old bundle since bundle been deleted.Modifications
Skip split the bundles that do not exist in NamespaceBundles
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
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: