diff --git a/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java b/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java index 290741e..4ea14a2 100644 --- a/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java +++ b/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java @@ -674,6 +674,10 @@ public class ReplicationZookeeper { peerIdsToProcess = ZKUtil.listChildrenNoWatch(this.zookeeper, deadRSZnodePath); if (peerIdsToProcess == null) return queues; // node already processed for (String peerId : peerIdsToProcess) { + if (!peerExists(peerId)) { + // Protection against moving orphaned queues + continue; + } String newPeerId = peerId + "-" + znode; String newPeerZnode = ZKUtil.joinZNode(this.rsServerNameZnode, newPeerId); // check the logs queue for the old peer cluster @@ -735,6 +739,10 @@ public class ReplicationZookeeper { // The lock isn't a peer cluster, remove it clusters.remove(RS_LOCK_ZNODE); for (String cluster : clusters) { + if (!peerExists(cluster)) { + // Protection against moving orphaned queues + continue; + } // We add the name of the recovered RS to the new znode, we can even // do that for queues that were recovered 10 times giving a znode like // number-startcode-number-otherstartcode-number-anotherstartcode-etc