frostruan commented on code in PR #4863:
URL: https://github.com/apache/hbase/pull/4863#discussion_r1014855628


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java:
##########
@@ -467,6 +467,9 @@ public void refreshSources(String peerId) throws 
IOException {
       ReplicationSourceInterface toRemove = this.sources.put(peerId, src);
       if (toRemove != null) {
         LOG.info("Terminate replication source for " + toRemove.getPeerId());
+        // Reset sizeOfLogQueue, log will re enqueue to the created new source.
+        toRemove.getSourceMetrics()

Review Comment:
   Thanks for review Duo.@Apache9
   
   Sorry, currently have no idea about the rule you mentioned, maybe the rule 
is a little complicated.
   
   I think what makes the rule complicated is that we first create the new 
ReplicationSource, then replace the old ReplicationSource with the new one, and 
then if the old ReplicationSource exists,  terminate it. And since HBASE-23231, 
we will not clear the old metrics when terminate the old ReplicationSource.
   
   If we adjust the order, first terminate the old ReplicationSource if it 
exists and then create and register the new ReplicationSource, the logic of 
metric here maybe will be simpler, and of course we can clear the metric when 
terminate the old ReplicationSource. But I'm not sure yet,  still need to 
confirm



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to