HBASE-21338 Warn if balancer is an ill-fit for cluster size
Signed-off-by: Michael Stack <stack@apache.org>
This commit is contained in:
parent
1b1dabd1f5
commit
d4ce9e534e
|
@ -372,9 +372,6 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
|
||||||
for (int i = 0; i < this.curFunctionCosts.length; i++) {
|
for (int i = 0; i < this.curFunctionCosts.length; i++) {
|
||||||
curFunctionCosts[i] = tempFunctionCosts[i];
|
curFunctionCosts[i] = tempFunctionCosts[i];
|
||||||
}
|
}
|
||||||
LOG.info("start StochasticLoadBalancer.balancer, initCost=" + currentCost + ", functionCost="
|
|
||||||
+ functionCost());
|
|
||||||
|
|
||||||
double initCost = currentCost;
|
double initCost = currentCost;
|
||||||
double newCost = currentCost;
|
double newCost = currentCost;
|
||||||
|
|
||||||
|
@ -383,9 +380,20 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
|
||||||
computedMaxSteps = Math.max(this.maxSteps,
|
computedMaxSteps = Math.max(this.maxSteps,
|
||||||
((long)cluster.numRegions * (long)this.stepsPerRegion * (long)cluster.numServers));
|
((long)cluster.numRegions * (long)this.stepsPerRegion * (long)cluster.numServers));
|
||||||
} else {
|
} else {
|
||||||
computedMaxSteps = Math.min(this.maxSteps,
|
long calculatedMaxSteps = (long)cluster.numRegions * (long)this.stepsPerRegion *
|
||||||
((long)cluster.numRegions * (long)this.stepsPerRegion * (long)cluster.numServers));
|
(long)cluster.numServers;
|
||||||
|
computedMaxSteps = Math.min(this.maxSteps, calculatedMaxSteps);
|
||||||
|
if (calculatedMaxSteps > maxSteps) {
|
||||||
|
LOG.warn("calculatedMaxSteps:{} for loadbalancer's stochastic walk is larger than "
|
||||||
|
+ "maxSteps:{}. Hence load balancing may not work well. Setting parameter "
|
||||||
|
+ "\"hbase.master.balancer.stochastic.runMaxSteps\" to true can overcome this issue."
|
||||||
|
+ "(This config change does not require service restart)", calculatedMaxSteps,
|
||||||
|
maxRunningTime);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
LOG.info("start StochasticLoadBalancer.balancer, initCost=" + currentCost + ", functionCost="
|
||||||
|
+ functionCost() + " computedMaxSteps: " + computedMaxSteps);
|
||||||
|
|
||||||
// Perform a stochastic walk to see if we can get a good fit.
|
// Perform a stochastic walk to see if we can get a good fit.
|
||||||
long step;
|
long step;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue