HBASE-17658 Fix bookkeeping error with max regions for a table
Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
parent
a2d2196e89
commit
938aef772d
|
@ -667,7 +667,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
|
|||
|
||||
//check whether this caused maxRegionsPerTable in the new Server to be updated
|
||||
if (numRegionsPerServerPerTable[newServer][tableIndex] > numMaxRegionsPerTable[tableIndex]) {
|
||||
numRegionsPerServerPerTable[newServer][tableIndex] = numMaxRegionsPerTable[tableIndex];
|
||||
numMaxRegionsPerTable[tableIndex] = numRegionsPerServerPerTable[newServer][tableIndex];
|
||||
} else if (oldServer >= 0 && (numRegionsPerServerPerTable[oldServer][tableIndex] + 1)
|
||||
== numMaxRegionsPerTable[tableIndex]) {
|
||||
//recompute maxRegionsPerTable since the previous value was coming from the old server
|
||||
|
|
|
@ -366,6 +366,8 @@ public class TestBaseLoadBalancer extends BalancerTestBase {
|
|||
|
||||
// now move region1 from servers[0] to servers[2]
|
||||
cluster.doAction(new MoveRegionAction(0, 0, 2));
|
||||
// check that the numMaxRegionsPerTable for "table" has increased to 2
|
||||
assertEquals(2, cluster.numMaxRegionsPerTable[0]);
|
||||
// now repeat check whether moving region1 from servers[1] to servers[2]
|
||||
// would lower availability
|
||||
assertTrue(cluster.wouldLowerAvailability(hri1, servers[2]));
|
||||
|
|
Loading…
Reference in New Issue