ddupg commented on a change in pull request #2077:
URL: https://github.com/apache/hbase/pull/2077#discussion_r458520038



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/HBaseReplicationEndpoint.java
##########
@@ -87,8 +108,24 @@ public void stop() {
   }
 
   @Override
-  protected void doStart() {
+  protected synchronized void doStart() {
     try {
+      try (Admin admin = getPeerConnection().getAdmin()) {
+        String version = admin.getClusterMetrics().getHBaseVersion();
+        LOG.info("Peer cluster version is {} for peer {}", version, 
ctx.getPeerId());
+        if (Integer.parseInt(version.split("\\.")[0]) >= 3) {

Review comment:
       Thanks @wchevreuil for reviewing.
   
[ReplicationSinkManager.chooseSinks](https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSinkManager.java#L151)
 will be called to re-fetch the sinks when 
HBaseInterClusterReplicationEndpoint.replicate [catches ConnectException or 
UnknownHostException](https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java#L563),
 It's same as before.
   And I've added a config "hbase.replication.fetch.servers.usezk" to 
optionally still use ZK impl.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to