Lingeshwaran Radhakrishnan created HBASE-21312:
--------------------------------------------------

             Summary: ReplicationSource should log the incorrect peerClusterId 
at Error level instead of Info
                 Key: HBASE-21312
                 URL: https://issues.apache.org/jira/browse/HBASE-21312
             Project: HBase
          Issue Type: Improvement
          Components: Replication
    Affects Versions: 1.4.7, 2.0.2
            Reporter: Lingeshwaran Radhakrishnan


Normally, Replication needs peer cluster ID to be different from the source. 
However, if target carries the same cluster ID as source, then during the 
ReplicationSource initialization process, following is reported in the 
RegionServer logs before terminating the ReplicationSource thread.
{code:java}
2018-10-08 10:19:09,155 INFO 
org.apache.hadoop.hbase.replication.regionserver.ReplicationSource: Closing 
source 1 because: ClusterId 67318852-e2b7-47a7-a303-f1722cb61a06 is replicating 
to itself: peerClusterId 67318852-e2b7-47a7-a303-f1722cb61a06 which is not 
allowed by 
ReplicationEndpoint:org.apache.hadoop.hbase.replication.regionserver.HBaseInterClusterReplicationEndpoint{code}
Here is the related code snippet which does this in the ReplicationSource class
{code:java}
// 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()) {
 this.terminate("ClusterId " + clusterId + " is replicating to itself: 
peerClusterId "
 + peerClusterId + " which is not allowed by ReplicationEndpoint:"
 + replicationEndpoint.getClass().getName(), null, false);
 this.manager.removeSource(this);
 return;
 }{code}
It would be good to have this logged at ERROR level instead of INFO for the 
following reasons

1. Under normal situation/case, the Peer Cluster ID would be different
2. It would help to easily troubleshoot issues that arises due to matching 
replication Peer cluster ID



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to