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



##########
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:
       > Another thought them is if we really need the new chore? I wonder how 
effective it would really be to avoid trying stale sinks.
   
   Thank @wchevreuil  for thinking about this. 
   I had a thought, there is some differences between 
[regionServers](https://github.com/apache/hbase/blob/0b85729da406df5ca33fd5c11d8cfe5b2bb16a41/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/HBaseReplicationEndpoint.java#L53)
 stored in HBaseReplicationEndpoint and 
[sinks](https://github.com/apache/hbase/blob/0b85729da406df5ca33fd5c11d8cfe5b2bb16a41/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSinkManager.java#L80)
 stored in ReplicationSinkManager. The latter is a random part of the former. 
The new chore can remove abandoned servers and discover new servers. If there 
is no such chore, new servers can't be sinks unless exceptions happen due to 
RSs crash.




----------------------------------------------------------------
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