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:58:46 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 daa4940ef -> 6391c53e9


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

Branch: refs/heads/branch-1.3
Commit: 6391c53e9f47355ced07758ff08879cdcbf49d15
Parents: daa4940
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue Feb 7 12:58:39 2017 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue Feb 7 12:58:39 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/6391c53e/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 5c040dd..59e938d 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
@@ -1102,10 +1102,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