From 2d5b36d194b90d4a43505c094464130506a079f6 Mon Sep 17 00:00:00 2001 From: Ashish Singhi Date: Sun, 4 Feb 2018 18:12:46 +0530 Subject: [PATCH] HBASE-19905 ReplicationSyncUp tool will not exit if a peer replication is disabled Signed-off-by: Ashish Singhi --- .../regionserver/ReplicationSourceManager.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java index cbbfca063b7..c0c233356b9 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java @@ -56,6 +56,7 @@ import org.apache.hadoop.hbase.replication.ReplicationEndpoint; import org.apache.hadoop.hbase.replication.ReplicationException; import org.apache.hadoop.hbase.replication.ReplicationListener; import org.apache.hadoop.hbase.replication.ReplicationPeer; +import org.apache.hadoop.hbase.replication.ReplicationPeer.PeerState; import org.apache.hadoop.hbase.replication.ReplicationPeerConfig; import org.apache.hadoop.hbase.replication.ReplicationPeers; import org.apache.hadoop.hbase.replication.ReplicationQueueInfo; @@ -739,6 +740,13 @@ public class ReplicationSourceManager implements ReplicationListener { replicationQueues.removeQueue(peerId); continue; } + if (server instanceof ReplicationSyncUp.DummyServer + && peer.getPeerState().equals(PeerState.DISABLED)) { + LOG.warn("Peer {} is disbaled. ReplicationSyncUp tool will skip " + + "replicating data to this peer.", + actualPeerId); + continue; + } // track sources in walsByIdRecoveredQueues Map> walsByGroup = new HashMap<>(); walsByIdRecoveredQueues.put(peerId, walsByGroup);