hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1433700 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Date Tue, 15 Jan 2013 22:17:00 GMT
Author: larsh
Date: Tue Jan 15 22:17:00 2013
New Revision: 1433700

URL: http://svn.apache.org/viewvc?rev=1433700&view=rev
Log:
HBASE-7551 nodeChildrenChange event may happen after the transition to RS_ZK_REGION_SPLITTING
in SplitTransaction causing the SPLIT event to be missed in the master side. (Ram, Ted, and
Lars H)

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1433700&r1=1433699&r2=1433700&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Tue Jan 15 22:17:00 2013
@@ -1205,9 +1205,20 @@ public class AssignmentManager extends Z
   public void nodeChildrenChanged(String path) {
     if(path.equals(watcher.assignmentZNode)) {
       try {
-        // Just make sure we see the changes for the new znodes
-        ZKUtil.listChildrenAndWatchThem(watcher,
+        List<String> children = ZKUtil.listChildrenAndWatchForNewChildren(watcher,
             watcher.assignmentZNode);
+        if (children != null) {
+          Stat stat = new Stat();
+          for (String child : children) {
+            stat.setVersion(0);
+            RegionTransitionData data = ZKAssign.getDataAndWatch(watcher,
+                ZKUtil.joinZNode(watcher.assignmentZNode, child), stat);
+            // See HBASE-7551, handle splitting here as well, in case we miss the node change
event
+            if (stat.getVersion() > 0 && data.getEventType() == EventType.RS_ZK_REGION_SPLITTING)
{
+              handleRegion(data, stat.getVersion());
+            }
+          }
+        }
       } catch(KeeperException e) {
         master.abort("Unexpected ZK exception reading unassigned children", e);
       }



Mime
View raw message