gaoran10 commented on code in PR #19742:
URL: https://github.com/apache/pulsar/pull/19742#discussion_r1139246295


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/scheduler/TransferShedder.java:
##########
@@ -444,17 +444,21 @@ private boolean isTransferable(LoadManagerContext context,
         if (pulsar == null || allocationPolicies == null) {
             return true;
         }
+        var isLoadBalancerSheddingBundlesWithPoliciesEnabled =
+                
context.brokerConfiguration().isLoadBalancerSheddingBundlesWithPoliciesEnabled();
         String namespace = 
LoadManagerShared.getNamespaceNameFromBundleName(bundle);
         final String bundleRange = 
LoadManagerShared.getBundleRangeFromBundleName(bundle);
         NamespaceBundle namespaceBundle =
                 
pulsar.getNamespaceService().getNamespaceBundleFactory().getBundle(namespace, 
bundleRange);
 
-        if (!canTransferWithIsolationPoliciesToBroker(
+        if (!isLoadBalancerSheddingBundlesWithPoliciesEnabled

Review Comment:
   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 | -- | false
   false | false | -- | true
   true | true | true | true
   true | true | false | false
   true | false | -- | true
   true | false | -- | true



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to