From 02fa99f9f0f6934d8229fad5bd75d7becd7c4bc3 Mon Sep 17 00:00:00 2001 From: Jean-Daniel Cryans Date: Mon, 29 Oct 2012 23:44:56 +0000 Subject: [PATCH] HBASE-6700 [replication] empty znodes created during queue failovers aren't deleted (Terry Zhang via JD) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1403581 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/hadoop/hbase/replication/ReplicationZookeeper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java index 30f45711bad..2db7df96342 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java @@ -844,14 +844,14 @@ public class ReplicationZookeeper implements Closeable{ // number-startcode-number-otherstartcode-number-anotherstartcode-etc String newCluster = cluster+"-"+znode; String newClusterZnode = ZKUtil.joinZNode(rsServerNameZnode, newCluster); - ZKUtil.createNodeIfNotExistsAndWatch(this.zookeeper, newClusterZnode, - HConstants.EMPTY_BYTE_ARRAY); String clusterPath = ZKUtil.joinZNode(nodePath, cluster); List hlogs = ZKUtil.listChildrenNoWatch(this.zookeeper, clusterPath); // That region server didn't have anything to replicate for this cluster if (hlogs == null || hlogs.size() == 0) { continue; } + ZKUtil.createNodeIfNotExistsAndWatch(this.zookeeper, newClusterZnode, + HConstants.EMPTY_BYTE_ARRAY); SortedSet logQueue = new TreeSet(); queues.put(newCluster, logQueue); for (String hlog : hlogs) {