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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/scheduler/TransferShedder.java:
##########
@@ -671,6 +685,18 @@ private boolean isUnderLoaded(LoadManagerContext context, 
String broker, double
                 
context.brokerConfiguration().getLoadBalancerBrokerLoadTargetStd() / 2));
     }
 
+    private boolean isOverLoaded(LoadManagerContext context, String broker, 
double avgLoad) {
+        var brokerLoadDataOptional = context.brokerLoadDataStore().get(broker);
+        if (brokerLoadDataOptional.isEmpty()) {
+            return false;
+        }
+        var overloadThreshold = context.brokerConfiguration()
+                .getLoadBalancerBrokerOverloadedThresholdPercentage() / 100.0;
+        var brokerLoadData = brokerLoadDataOptional.get();
+        var load = brokerLoadData.getWeightedMaxEMA();
+        return load > overloadThreshold && load > avgLoad * 2;

Review Comment:
   Could you explain why the load needs to be greater than twice `avgLoad`?



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