hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1541279 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
Date Tue, 12 Nov 2013 22:31:56 GMT
Author: tedyu
Date: Tue Nov 12 22:31:56 2013
New Revision: 1541279

URL: http://svn.apache.org/r1541279
Log:
HBASE-4654 [replication] Add a check to make sure we don't replicate to ourselves (Demai)


Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java?rev=1541279&r1=1541278&r2=1541279&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
Tue Nov 12 22:31:56 2013
@@ -212,6 +212,12 @@ public class ReplicationSource extends T
     // resetting to 1 to reuse later
     sleepMultiplier = 1;
 
+    // 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)) {
+      this.terminate("ClusterId " + clusterId + " is replicating to itself: peerClusterId
"
+          + peerClusterId);
+    }
     LOG.info("Replicating "+clusterId + " -> " + peerClusterId);
 
     // If this is recovered, the queue is already full and the first log
@@ -802,4 +808,4 @@ public class ReplicationSource extends T
       ", currently replicating from: " + this.currentPath +
       " at position: " + position;
   }
-}
\ No newline at end of file
+}



Mime
View raw message