hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1202935 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/master/handler/SplitRegionHandler.java
Date Wed, 16 Nov 2011 23:40:29 GMT
Author: tedyu
Date: Wed Nov 16 23:40:29 2011
New Revision: 1202935

URL: http://svn.apache.org/viewvc?rev=1202935&view=rev
Log:
HBASE-4796  Race between SplitRegionHandlers for the same region kills the master

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/SplitRegionHandler.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1202935&r1=1202934&r2=1202935&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Wed Nov 16 23:40:29 2011
@@ -434,6 +434,7 @@ Release 0.92.0 - Unreleased
                leaves the parent region stuck offline
    HBASE-4793  HBase shell still using deprecated methods removed in HBASE-4436
    HBASE-4801  alter_status shell prints sensible message at completion
+   HBASE-4796  Race between SplitRegionHandlers for the same region kills the master
 
   TESTS
    HBASE-4450  test for number of blocks read: to serve as baseline for expected

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=1202935&r1=1202934&r2=1202935&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 23:40:29 2011
@@ -29,7 +29,9 @@ import org.apache.hadoop.hbase.ServerNam
 import org.apache.hadoop.hbase.executor.EventHandler;
 import org.apache.hadoop.hbase.master.AssignmentManager;
 import org.apache.hadoop.hbase.zookeeper.ZKAssign;
+import org.apache.hadoop.hbase.zookeeper.ZKUtil;
 import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.KeeperException.NoNodeException;
 
 /**
  * Handles SPLIT region event on Master.
@@ -75,7 +77,8 @@ public class SplitRegionHandler extends 
 
   @Override
   public void process() {
-    LOG.debug("Handling SPLIT event for " + this.parent.getEncodedName() +
+    String encodedRegionName = this.parent.getEncodedName();
+    LOG.debug("Handling SPLIT event for " + encodedRegionName +
       "; deleting node");
     // The below is for testing ONLY!  We can't do fault injection easily, so
     // resort to this kinda uglyness -- St.Ack 02/25/2011.
@@ -93,16 +96,23 @@ public class SplitRegionHandler extends 
         // 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(),
+          encodedRegionName,
           EventHandler.EventType.RS_ZK_REGION_SPLIT);
       }
     } catch (KeeperException e) {
-      server.abort("Error deleting SPLIT node in ZK for transition ZK node (" +
-        parent.getEncodedName() + ")", e);
+      if (e instanceof NoNodeException) {
+        String znodePath = ZKUtil.joinZNode(
+            this.server.getZooKeeper().splitLogZNode, encodedRegionName);
+        LOG.debug("The znode " + znodePath
+            + " does not exist.  May be deleted already.");
+      } else {
+        server.abort("Error deleting SPLIT node in ZK for transition ZK node (" +
+            parent.getEncodedName() + ")", e);
+      }
     }
     LOG.info("Handled SPLIT report); parent=" +
       this.parent.getRegionNameAsString() +
       " daughter a=" + this.daughters.get(0).getRegionNameAsString() +
       "daughter b=" + this.daughters.get(1).getRegionNameAsString());
   }
-}
\ No newline at end of file
+}



Mime
View raw message