OneSizeFitsQuorum commented on code in PR #906:
URL: https://github.com/apache/ratis/pull/906#discussion_r1335351124
##########
ratis-server-api/src/main/java/org/apache/ratis/statemachine/StateMachine.java:
##########
@@ -228,6 +228,11 @@ default void notifyFollowerSlowness(RoleInfoProto
leaderInfo) {}
* Notify {@link StateMachine} that this server is no longer the leader.
*/
default void notifyNotLeader(Collection<TransactionContext>
pendingEntries) throws IOException {}
+
+ /**
+ * Notify the {@link StateMachine} that this server becomes ready after
changed to leader.
+ */
+ default void notifyLeaderReady() {}
Review Comment:
> What it actually means: this server is reader after changed to leader.
Is `reader` a typo for `ready`?
This function means that the current server has become a leader and has
fully recovered the state machine (at least one log entry from the current term
has been applied).
If we use the name `notifyBecomeLeader`, it seems to suggest that the
current peer has been elected as a leader but doesn't explicitly convey the
semantics of the state machine recovery. `notifyServingAsLeader` and
`notifyLeaderReady` both imply some level of state machine recovery in my view,
and either of them could work for me.
What's your opinion? @szetszwo @tisonkun @SzyWilliam
--
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]