JoeCqupt commented on code in PR #1331:
URL: https://github.com/apache/ratis/pull/1331#discussion_r2654691437
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -1645,7 +1647,27 @@ leaderId, getMemberId(), currentTerm, followerCommit,
inconsistencyReplyNextInde
return reply;
});
}
- private CompletableFuture<Void> appendLog(List<LogEntryProto> entries) {
+
+ /**
+ * The listener checks whether it can become a follower.
+ *
+ * @return
+ */
+ private CompletableFuture<Void> checkAndUpdateListenerState() {
Review Comment:
I have actually considered moving the logic to changeToFollower(..). but it
has one drawback:
in `appendEntriesAsync(...)` method
`changeToFollowerAndPersistMetadata(..)` run before
`state.updateConfiguration(..)`
when **`NewConf`** RaftConfiguration log Entry come in. the listener do not
change to follower immediately. the listener will change to follower at next
time heartbeat or log entry append.
--
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]