hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-17275 Assign timeout may cause region to be unassigned forever (Allan yang)
Date Tue, 07 Feb 2017 20:59:07 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 27303fdfb -> 2aaf7851a


HBASE-17275 Assign timeout may cause region to be unassigned forever (Allan yang)


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

Branch: refs/heads/branch-1.2
Commit: 2aaf7851a4de28e40b1a0d641d8fc98e54f5342d
Parents: 27303fd
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue Feb 7 12:59:01 2017 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue Feb 7 12:59:01 2017 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/master/AssignmentManager.java     | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/2aaf7851/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
index d1ac1bb..414b751 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
@@ -1101,10 +1101,19 @@ public class AssignmentManager extends ZooKeeperListener {
               + regionStates.getRegionState(encodedName));
 
             if (regionState != null) {
-              // Close it without updating the internal region states,
-              // so as not to create double assignments in unlucky scenarios
-              // mentioned in OpenRegionHandler#process
-              unassign(regionState.getRegion(), null, -1, null, false, sn);
+              if(regionState.isOpened() && regionState.getServerName().equals(sn))
{
+                //if this region was opened before on this rs, we don't have to unassign
it. It won't cause
+                //double assign. One possible scenario of what happened is HBASE-17275
+                failedOpenTracker.remove(encodedName); // reset the count, if any
+                new OpenedRegionHandler(
+                    server, this, regionState.getRegion(), coordination, ord).process();
+                updateOpenedRegionHandlerTracker(regionState.getRegion());
+              } else {
+                // Close it without updating the internal region states,
+                // so as not to create double assignments in unlucky scenarios
+                // mentioned in OpenRegionHandler#process
+                unassign(regionState.getRegion(), null, -1, null, false, sn);
+              }
             }
             return;
           }


Mime
View raw message