Demogorgon314 commented on code in PR #19592:
URL: https://github.com/apache/pulsar/pull/19592#discussion_r1119513659


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/scheduler/TransferShedder.java:
##########
@@ -334,16 +344,16 @@ public UnloadDecision 
findBundlesForUnloading(LoadManagerContext context,
                     int remainingTopBundles = topBundlesLoadData.size();
                     for (var e : topBundlesLoadData) {
                         String bundle = e.bundleName();
-                        if (!recentlyUnloadedBundles.containsKey(bundle) && 
isTransferable(bundle)) {
+                        if (!recentlyUnloadedBundles.containsKey(bundle)
+                                && isTransferable(context, bundle, maxBroker, 
Optional.ofNullable(minBroker))) {
                             var bundleData = e.stats();
                             double throughput = bundleData.msgThroughputIn + 
bundleData.msgThroughputOut;
                             if (remainingTopBundles > 1
                                     && (trafficMarkedToOffload < 
offloadThroughput
                                     || !atLeastOneBundleSelected)) {
                                 if (transfer) {
                                     selectedBundlesCache.put(maxBroker,
-                                            new Unload(maxBroker, bundle,
-                                                    Optional.of(minBroker)));
+                                            new Unload(maxBroker, bundle, 
Optional.ofNullable(minBroker)));

Review Comment:
   I see the `hasTransferableBrokers` method already checked and guarantees 
have min broker. I will change back.



-- 
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