suiyuzeng opened a new issue #13119:
URL: https://github.com/apache/pulsar/issues/13119
**Describe the bug**
Upgrading a cluster which has 3 nodes, the last node will not be assigned a
bundle for a long time even if the load of other 2 nodes is very high.
```
private void updateAvgResourceUsage(String broker, LocalBrokerData
localBrokerData, final double historyPercentage,
final ServiceConfiguration conf) {
double historyUsage =
brokerAvgResourceUsage.getOrDefault(broker, 0.0);
historyUsage = historyUsage * historyPercentage
+ (1 - historyPercentage) *
localBrokerData.getMaxResourceUsageWithWeight(
conf.getLoadBalancerCPUResourceWeight(),
conf.getLoadBalancerMemoryResourceWeight(),
conf.getLoadBalancerDirectMemoryResourceWeight(),
conf.getLoadBalancerBandwithInResourceWeight(),
conf.getLoadBalancerBandwithOutResourceWeight());
brokerAvgResourceUsage.put(broker, historyUsage);
}
```
In
org.apache.pulsar.broker.loadbalance.impl.ThresholdShedder#updateAvgResourceUsage,
if a broker change to be a leader, brokerAvgResourceUsage has no recoder about
any broker. As the historyUsage was set to be 0, it wil take a long time to be
actual usage.
--
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]