-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improve][broker]improve the getAntiAffinityNamespaceOwnedBrokers check exclude the current namespace cause count add. #16563
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
8ee2884 to
668d99e
Compare
|
@codelipenghui @Jason918 @eolivelli Could you help to review this PR, Thx. |
What's the anti affinity setting in this case? |
@Jason918 ns-0 ns-1 ns-2 are all set the same anti affinity group like 'a-group', and the three ns be anti affinity load is expected. |
|
/pulsarbot run-failure-checks |
4a3e4e8 to
197faef
Compare
|
The pr had no activity for 30 days, mark with Stale label. |
c29ea60 to
83e5536
Compare
…rrent namespace cause count add.
83e5536 to
118b16b
Compare
|
/pulsarbot run-failure-checks |
Codecov Report
@@ Coverage Diff @@
## master #16563 +/- ##
=============================================
- Coverage 45.64% 30.66% -14.99%
+ Complexity 11043 6016 -5027
=============================================
Files 773 633 -140
Lines 74463 59892 -14571
Branches 8018 6241 -1777
=============================================
- Hits 33986 18363 -15623
- Misses 36687 38973 +2286
+ Partials 3790 2556 -1234
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
/pulsarbot run-failure-checks |
|
The pr had no activity for 30 days, mark with Stale label. |
Motivation
As the PIP 7: Pulsar Failure domain and Anti affinity namespaces design, the anti affinity namespaces should be distributed to evenly across all domain and all the brokers.
But in method
getAntiAffinityNamespaceOwnedBrokers,brokerToAntiAffinityNamespaceCountadd a count even the namespace equal the given bundle's namespace which will be load. The behavior will cause the namespace easy to distributed toa broker which has another namespace in anti affinity group, the behavior broke the anti affinity balance. It's better behavior is the same namespace should be distributed to those broker which has loaded the same namespace when all broker have load at least one namespace in ti affinity group.
there is some case
ns-0 ns-1 ns-2 are all set the same anti affinity group like 'a-group
broker-0ownns-0 bundle-0;broker-1ownns-1 bundle-0;broker-2ownns-2 bundle-0;then another
ns-2 bundle-1need choice a broker to load. As the old policy,broker-0 broker-1 and broker-2are all satisfy the least NamespaceCount; but ifns-2 bundle-1load tobroker-0 or broker-1will broke the anti affinity balance.ns-2 bundle-1need be load by broker-2 is better.Also, the behavior will cause give up
doLoadSheddingwhen the all broker own one namespace in anti affinity group, but the different broker owned namespace bundle count and payload is different.So
brokerToAntiAffinityNamespaceCountshould exclude the given namespace count add.Modifications
getAntiAffinityNamespaceOwnedBrokersmethod, exclude the given namespace count add.shouldAntiAffinityNamespaceUnloadcheck;Documentation
doc-not-neededMatching PR in forked repository
PR in forked repository: Nicklee007#5