Repository: hbase Updated Branches: refs/heads/branch-2 3b603d2c0 -> 2d5b36d19
HBASE-19905 ReplicationSyncUp tool will not exit if a peer replication is disabled Signed-off-by: Ashish Singhi <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2d5b36d1 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2d5b36d1 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2d5b36d1 Branch: refs/heads/branch-2 Commit: 2d5b36d194b90d4a43505c094464130506a079f6 Parents: 3b603d2 Author: Ashish Singhi <[email protected]> Authored: Sun Feb 4 18:12:46 2018 +0530 Committer: Ashish Singhi <[email protected]> Committed: Sun Feb 4 18:12:46 2018 +0530 ---------------------------------------------------------------------- .../replication/regionserver/ReplicationSourceManager.java | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/2d5b36d1/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java ---------------------------------------------------------------------- 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 cbbfca0..c0c2333 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<String, SortedSet<String>> walsByGroup = new HashMap<>(); walsByIdRecoveredQueues.put(peerId, walsByGroup);
