[GitHub] [hbase] ddupg commented on a change in pull request #2077: HBASE-24684 Fetch ReplicationSink servers list from HMaster instead o…
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
[GitHub] [hbase] ddupg commented on a change in pull request #2077: HBASE-24684 Fetch ReplicationSink servers list from HMaster instead o…
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
[GitHub] [hbase] ddupg commented on a change in pull request #2077: HBASE-24684 Fetch ReplicationSink servers list from HMaster instead o…
ddupg commented on a change in pull request #2077: URL: https://github.com/apache/hbase/pull/2077#discussion_r455626321 ## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/HBaseReplicationEndpoint.java ## @@ -148,27 +149,30 @@ public boolean isAborted() { return false; } + /** + * Get the connection to peer cluster + * @return connection to peer cluster + * @throws IOException + */ + protected synchronized Connection getPeerConnection() throws IOException { +if (peerConnection == null) { + peerConnection = ConnectionFactory.createConnection(ctx.getConfiguration()); +} +return peerConnection; + } + /** * Get the list of all the region servers from the specified peer - * @param zkw zk connection to use * @return list of region server addresses or an empty list if the slave is unavailable */ - protected static List fetchSlavesAddresses(ZKWatcher zkw) Review comment: OK,try new impl firstly and old ZK impl secondly, is that OK? 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