hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [2/5] hbase git commit: HBASE-14407 NotServingRegion: hbase region closed forever (Shuaifeng Zhou)
Date Sat, 26 Sep 2015 01:20:17 GMT
HBASE-14407 NotServingRegion: hbase region closed forever (Shuaifeng Zhou)


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

Branch: refs/heads/branch-1.1
Commit: b33b7f44f8f03579958f8c78accd8474a65eb860
Parents: 0c16476
Author: Andrew Purtell <apurtell@apache.org>
Authored: Fri Sep 25 17:57:14 2015 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Fri Sep 25 17:57:14 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/master/AssignmentManager.java  | 28 +++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b33b7f44/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 a2ba9ea..09e2b2f 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
@@ -2299,7 +2299,33 @@ public class AssignmentManager extends ZooKeeperListener {
     LOG.debug("ALREADY_OPENED " + region.getRegionNameAsString()
       + " to " + sn);
     String encodedName = region.getEncodedName();
-    deleteNodeInStates(encodedName, "offline", sn, EventType.M_ZK_REGION_OFFLINE);
+    
+    //If use ZkForAssignment, region already Opened event should not be handled, 
+    //leave it to zk event. See HBase-14407.
+    if(useZKForAssignment){
+      String node = ZKAssign.getNodeName(watcher, encodedName);
+      Stat stat = new Stat();
+      try {
+        byte[] existingBytes = ZKUtil.getDataNoWatch(watcher, node, stat);
+        if(existingBytes!=null){
+          RegionTransition rt= RegionTransition.parseFrom(existingBytes);
+          EventType et = rt.getEventType();
+          if (et.equals(EventType.RS_ZK_REGION_OPENED)) {
+            LOG.debug("ALREADY_OPENED " + region.getRegionNameAsString()
+              + " and node in "+et+" state");
+            return;
+          }
+        }
+      } catch (KeeperException ke) {
+        LOG.warn("Unexpected ZK exception getData " + node
+          + " node for the region " + encodedName, ke);
+      } catch (DeserializationException e) {
+        LOG.warn("Get RegionTransition from zk deserialization failed! ", e);
+      }
+      
+      deleteNodeInStates(encodedName, "offline", sn, EventType.M_ZK_REGION_OFFLINE);
+    }
+    
     regionStates.regionOnline(region, sn);
   }
 


Mime
View raw message