[improve][broker]improve the getAntiAffinityNamespaceOwnedBrokers check exclude the current namespace cause count add. - #5
Open
Nicklee007 wants to merge 1 commit into
Conversation
1 task
|
The pr had no activity for 30 days, mark with Stale label. |
…rrent namespace cause count add.
Nicklee007
force-pushed
the
improve-anti-affinity-owned-brokers-check
branch
from
January 10, 2023 03:43
83e5536 to
118b16b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-needed