slfan1989 commented on code in PR #1621:
URL: https://github.com/apache/ratis/pull/1621#discussion_r4207355009
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java:
##########
@@ -483,7 +485,9 @@ CompletableFuture<Void> stop() {
replyFlusher.stop();
}
logAppenderMetrics.unregister();
- raftServerMetrics.unregister();
+ synchronized (followerMetricsLock) {
+ raftServerMetrics.clearFollowerHeartbeatMetrics();
Review Comment:
Thanks @amaliujia for the review and suggestions!
I’ve updated the patch to follow Option A:
- Keep the server metrics registry registered after step-down and remove the
follower heartbeat gauges.
- Retain peer commit-index gauges because their backing cache continues to
receive updates while the server is a follower.
- Synchronize heartbeat metric cleanup with registration and updates to
prevent callbacks from the old leader state from repopulating the cleared data.
--
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]