hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia7...@apache.org
Subject hbase git commit: Fix bookkeeping error with max regions for a table
Date Mon, 31 Jul 2017 16:13:53 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 d666ffc7a -> 2ebd80499


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/2ebd8049
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2ebd8049
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2ebd8049

Branch: refs/heads/branch-1.3
Commit: 2ebd80499473bbac3eac083806211ec03e084db7
Parents: d666ffc
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:10: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/2ebd8049/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 0ec1e39..de98f71 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
@@ -661,7 +661,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/2ebd8049/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 be63d91..3b2138e 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
@@ -326,6 +326,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