From e068fd0076c50b4b1df6b6dd50c25af6e0c048b9 Mon Sep 17 00:00:00 2001 From: Shichao Nie Date: Thu, 15 Aug 2024 11:48:59 +0800 Subject: [PATCH] fix(auto_balancer): fix load balancer threshold Signed-off-by: Shichao Nie --- .../goals/AbstractResourceUsageDistributionGoal.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/kafka/autobalancer/goals/AbstractResourceUsageDistributionGoal.java b/core/src/main/java/kafka/autobalancer/goals/AbstractResourceUsageDistributionGoal.java index 8eba5d96fb..8394be6583 100644 --- a/core/src/main/java/kafka/autobalancer/goals/AbstractResourceUsageDistributionGoal.java +++ b/core/src/main/java/kafka/autobalancer/goals/AbstractResourceUsageDistributionGoal.java @@ -57,7 +57,7 @@ protected boolean requireMoreLoad(BrokerUpdater.Broker broker) { @Override public boolean isBrokerAcceptable(BrokerUpdater.Broker broker) { double load = broker.loadValue(resource()); - if (usageAvg < this.usageDetectThreshold) { + if (load < this.usageDetectThreshold && usageAvg < this.usageDetectThreshold) { return true; } return load >= usageDistLowerBound && load <= usageDistUpperBound;