szetszwo commented on code in PR #807:
URL: https://github.com/apache/ratis/pull/807#discussion_r1071986684
##########
ratis-server-api/src/main/java/org/apache/ratis/server/leader/LeaderState.java:
##########
@@ -66,4 +67,13 @@ AppendEntriesRequestProto
newAppendEntriesRequestProto(FollowerInfo follower,
/** Received an {@link AppendEntriesReplyProto} */
void onAppendEntriesReply(LogAppender appender, AppendEntriesReplyProto
reply);
+ /** Received a TransferLeadershipRequest */
+ void onTransferLeadership(RaftPeerId transferee);
+
+ /** Abort the last TransferLeadership */
+ void abortTransferLeadership();
+
+ /** Check if TransferLeadership is in progress */
+ boolean isTransferLeadershipInProgress();
+
Review Comment:
This are internal APIs -- all methods are used only inside the
`org.apache.ratis.server.impl` package. So, they should not be added here.
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java:
##########
@@ -1167,6 +1180,75 @@ public void onAppendEntriesReply(LogAppender appender,
RaftProtos.AppendEntriesR
readIndexHeartbeats.onAppendEntriesReply(appender, reply,
this::hasMajority);
}
+ @Override
+ public void onTransferLeadership(RaftPeerId transferee) {
Review Comment:
We add the new logic to `TransferLeadership`. The new logic is to sends a
TimeoutNow request to the target server.
--
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]