hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia7...@apache.org
Subject hbase git commit: HBASE-17658 Fix bookkeeping error with max regions for a table
Date Mon, 31 Jul 2017 16:25:30 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 bd86094f3 -> 43e26e535


HBASE-17658 Fix bookkeeping error with max regions for a table

Signed-off-by: Chia-Ping Tsai <chia7712@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/43e26e53
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/43e26e53
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/43e26e53

Branch: refs/heads/branch-1.2
Commit: 43e26e53532a5a93703e63fb08e9f999ad11242a
Parents: bd86094
Author: Tim Brown <tim@siftscience.com>
Authored: Thu Jan 19 14:21:24 2017 -0800
Committer: Chia-Ping Tsai <chia7712@gmail.com>
Committed: Tue Aug 1 00:25:07 2017 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java  | 2 +-
 .../apache/hadoop/hbase/master/balancer/TestBaseLoadBalancer.java  | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/43e26e53/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
index 15c8352..1eda305 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
@@ -646,7 +646,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

http://git-wip-us.apache.org/repos/asf/hbase/blob/43e26e53/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestBaseLoadBalancer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestBaseLoadBalancer.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestBaseLoadBalancer.java
index 3bdae33..d11b353 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestBaseLoadBalancer.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestBaseLoadBalancer.java
@@ -319,6 +319,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]));


Mime
View raw message