hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r1202487 - in /hbase/trunk/src/main/java/org/apache/hadoop/hbase: master/handler/SplitRegionHandler.java zookeeper/ZKAssign.java
Date Wed, 16 Nov 2011 00:42:52 GMT
Author: jdcryans
Date: Wed Nov 16 00:42:52 2011
New Revision: 1202487

URL: http://svn.apache.org/viewvc?rev=1202487&view=rev
Log:
   HBASE-4792  SplitRegionHandler doesn't care if it deletes the znode or not,
               leaves the parent region stuck offline

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/SplitRegionHandler.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/SplitRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/SplitRegionHandler.java?rev=1202487&r1=1202486&r2=1202487&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/SplitRegionHandler.java
(original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/SplitRegionHandler.java
Wed Nov 16 00:42:52 2011
@@ -87,9 +87,15 @@ public class SplitRegionHandler extends 
       this.daughters.get(0), this.daughters.get(1));
     // Remove region from ZK
     try {
-      ZKAssign.deleteNode(this.server.getZooKeeper(),
-        this.parent.getEncodedName(),
-        EventHandler.EventType.RS_ZK_REGION_SPLIT);
+
+      boolean successful = false;
+      while (!successful) {
+        // It's possible that the RS tickles in between the reading of the
+        // znode and the deleting, so it's safe to retry.
+        successful = ZKAssign.deleteNode(this.server.getZooKeeper(),
+          this.parent.getEncodedName(),
+          EventHandler.EventType.RS_ZK_REGION_SPLIT);
+      }
     } catch (KeeperException e) {
       server.abort("Error deleting SPLIT node in ZK for transition ZK node (" +
         parent.getEncodedName() + ")", e);

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java?rev=1202487&r1=1202486&r2=1202487&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java Wed Nov 16 00:42:52
2011
@@ -499,13 +499,13 @@ public class ZKAssign {
     }
     if (expectedVersion != -1
         && stat.getVersion() != expectedVersion) {
-      LOG.warn("The node we are trying to delete is not the expected one. " +
-        "Got a version mismatch");
+      LOG.warn("The node " + regionName + " we are trying to delete is not" +
+        " the expected one. Got a version mismatch");
       return false;
     }
     if(!ZKUtil.deleteNode(zkw, node, stat.getVersion())) {
       LOG.warn(zkw.prefix("Attempting to delete " +
-          "unassigned node in " + expectedState +
+          "unassigned node " + regionName + " in " + expectedState +
           " state but after verifying state, we got a version mismatch"));
       return false;
     }



Mime
View raw message