From 12652200cead677da122b5981075831c2775932a Mon Sep 17 00:00:00 2001 From: Rushabh Date: Tue, 13 Aug 2019 14:53:27 -0700 Subject: [PATCH 1/2] [HBASE-22601] Misconfigured addition of peers leads to cluster shutdown. --- .../replication/regionserver/ReplicationSource.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java index d5b398c0dff4..223cbf69cc96 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java @@ -309,6 +309,15 @@ public void run() { } } + if (peerClusterId == null) { + // In some cases, it is possible that peerClusterId is null because it couldn't read + // peer cluster id from zookeeper. One case this might happen is because 2 clusters don't + // have kerberos trust setup. + this.terminate("Peer ClusterId returned is null", null, false); + this.manager.closeQueue(this); + return; + } + // In rare case, zookeeper setting may be messed up. That leads to the incorrect // peerClusterId value, which is the same as the source clusterId if (clusterId.equals(peerClusterId) && !replicationEndpoint.canReplicateToSameCluster()) { From c4bafbe9678b845620c37bdbb161c857b3dfb1bc Mon Sep 17 00:00:00 2001 From: Rushabh Date: Sat, 17 Aug 2019 22:04:39 -0700 Subject: [PATCH 2/2] [HBASE-22601] Addresing review comments. --- .../hbase/replication/regionserver/ReplicationSource.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java index 223cbf69cc96..d1184b99e61c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java @@ -309,12 +309,7 @@ public void run() { } } - if (peerClusterId == null) { - // In some cases, it is possible that peerClusterId is null because it couldn't read - // peer cluster id from zookeeper. One case this might happen is because 2 clusters don't - // have kerberos trust setup. - this.terminate("Peer ClusterId returned is null", null, false); - this.manager.closeQueue(this); + if (!this.isSourceActive()) { return; }