hangc0276 commented on a change in pull request #12471:
URL: https://github.com/apache/pulsar/pull/12471#discussion_r735197533



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ThresholdShedder.java
##########
@@ -78,7 +78,7 @@
             final LocalBrokerData localData = brokerData.getLocalData();
             final double currentUsage = 
brokerAvgResourceUsage.getOrDefault(broker, 0.0);
 
-            if (currentUsage < avgUsage + threshold) {
+            if (currentUsage > avgUsage - threshold && currentUsage < avgUsage 
+ threshold) {

Review comment:
       The following operation only works for overload broker node, which 
unLoad bundles from the broker. If the broker with low load, and applied the 
above check, it will also be filtered by 
   ```Java
   if (minimumThroughputToOffload < minThroughputThreshold) {
                   if (log.isDebugEnabled()) {
                       log.info("[{}] broker is planning to shed throughput {} 
MByte/s less than "
                                       + "minimumThroughputThreshold {} 
MByte/s, skipping bundle unload.",
                               broker, minimumThroughputToOffload / MB, 
minThroughputThreshold / MB);
                   }
                   return;
               }
   ```
   If we want to improve the load of low load broker, we can't operate the 
broker directly, it can only depend on other broker unload bundle and the 
leader select the low load broker and onload the bundles on it.
   
   We should consider the loadbalance mechanism to address the issue.




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