HBASE-17039 SimpleLoadBalancer schedules large amount of invalid region moves

Signed-off-by: Yu Li <liyu@apache.org>
This commit is contained in:
Charlie Qiangeng Xu 2016-11-09 16:35:17 +08:00 committed by Yu Li
parent 03bc884ea0
commit 3b63f701e6
1 changed files with 1 additions and 5 deletions

View File

@ -269,14 +269,10 @@ public class SimpleLoadBalancer extends BaseLoadBalancer {
serversByLoad.entrySet()) { serversByLoad.entrySet()) {
if (maxToTake == 0) break; // no more to take if (maxToTake == 0) break; // no more to take
int load = server.getKey().getLoad(); int load = server.getKey().getLoad();
if (load >= min && load > 0) { if (load >= min) {
continue; // look for other servers which haven't reached min continue; // look for other servers which haven't reached min
} }
int regionsToPut = min - load; int regionsToPut = min - load;
if (regionsToPut == 0)
{
regionsToPut = 1;
}
maxToTake -= regionsToPut; maxToTake -= regionsToPut;
underloadedServers.put(server.getKey().getServerName(), regionsToPut); underloadedServers.put(server.getKey().getServerName(), regionsToPut);
} }