-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[improve][broker] PIP-192 Excluded bundles with isolation policy or anti-affinity-group policy from topk load bundles #19742
[improve][broker] PIP-192 Excluded bundles with isolation policy or anti-affinity-group policy from topk load bundles #19742
Conversation
@heesung-sn Please add the following content to your PR description and select a checkbox:
|
2f091fc
to
48d9723
Compare
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.
If we enable this config loadBalancerSheddingBundlesWithPoliciesEnabled
, maybe we need to exclude brokers by isolation policies while transferring bundles.
This config targets bundles that configure isolation or anti-affinity policies. This PR filters out such bundles in the TransferShedder as well. (This PR needs to apply the IsolationPolicy support logic from this PR #19592, when merged.)
|
Got it, thanks. |
57f5bb7
to
17f6bcd
Compare
@Demogorgon314 @gaoran10 @Technoboy- |
String namespace = LoadManagerShared.getNamespaceNameFromBundleName(bundle); | ||
final String bundleRange = LoadManagerShared.getBundleRangeFromBundleName(bundle); | ||
NamespaceBundle namespaceBundle = | ||
pulsar.getNamespaceService().getNamespaceBundleFactory().getBundle(namespace, bundleRange); | ||
|
||
if (!canTransferWithIsolationPoliciesToBroker( | ||
if (!isLoadBalancerSheddingBundlesWithPoliciesEnabled |
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'm a little confused. When getting TopKBundles
if isLoadBalancerSheddingBundlesWithPoliciesEnabled
is false and the bundle has an affinity(anti) policy, the bundle will be discarded, maybe we only need to check whether the bundle matches the policy or not.
I'm not sure if this table is correct.
IsLoadBalancerSheddingBundlesWithPoliciesEnabled | HasPolicy | MatchPolicy | Auto-Unload |
---|---|---|---|
false | true | true | false |
false | true | false | false |
false | false | -- | true |
true | true | true | true |
true | true | false | false |
true | false | -- | 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.
The above table is correct. Thank you for this catch. Updated the code.
17f6bcd
to
e6adf65
Compare
…nti-affinity-group policy from topk load bundles
e6adf65
to
5a937ae
Compare
@Demogorgon314 plz merge this pr if looking good. |
Master Issue: #16691
Motivation
Raising a PR to implement #16691.
Bundles with isolation policies or anti-affinity-group policies are not ideal targets to auto-unload as destination brokers are limited.
Modifications
This PR
loadBalancerSheddingBundlesWithPoliciesEnabled
to control this behavior.Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
We will have separate PRs to update the Doc later.
Matching PR in forked repository
PR in forked repository: heesung-sn#38