HBASE-19905 ReplicationSyncUp tool will not exit if a peer replication is 
disabled

Signed-off-by: Ashish Singhi <ashishsin...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8a4b2b54
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8a4b2b54
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8a4b2b54

Branch: refs/heads/branch-1.3
Commit: 8a4b2b54cdadfbe2ee730733f10bd3ec57b05340
Parents: 5c799c1
Author: Ashish Singhi <ashishsin...@apache.org>
Authored: Sun Feb 4 18:24:32 2018 +0530
Committer: Andrew Purtell <apurt...@apache.org>
Committed: Wed Dec 12 18:08:18 2018 -0800

----------------------------------------------------------------------
 .../replication/regionserver/ReplicationSourceManager.java    | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/8a4b2b54/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 c99d15c..8d19e22 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
@@ -58,6 +58,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;
@@ -735,6 +736,12 @@ public class ReplicationSourceManager implements 
ReplicationListener {
             replicationQueues.removeQueue(peerId);
             continue;
           }
+          if (server instanceof ReplicationSyncUp.DummyServer
+              && peer.getPeerState().equals(PeerState.DISABLED)) {
+            LOG.warn("Peer " + actualPeerId + " is disbaled. ReplicationSyncUp 
tool will skip "
+                + "replicating data to this peer.");
+            continue;
+          }
           // track sources in walsByIdRecoveredQueues
           Map<String, SortedSet<String>> walsByGroup = new HashMap<String, 
SortedSet<String>>();
           walsByIdRecoveredQueues.put(peerId, walsByGroup);

Reply via email to