RATIS-2392. Leader should trigger heartbeat immediately after ReadIndex#1340
RATIS-2392. Leader should trigger heartbeat immediately after ReadIndex#1340ivandika3 wants to merge 2 commits intoapache:masterfrom
Conversation
There was a problem hiding this comment.
@ivandika3 , this is a great finding!
Instead of trigger a heartbeat, how about adding a CommitInfoProto list to ReadIndexReplyProto? Then, the follower can update the commit indices with the reply.
|
@szetszwo Thanks for the review.
As specified by the Raft paper, Raft follower updates its commitIndex only when handling Let me know if I'm misunderstood. |
That's is a good point! It seems no harm to update commitIndex for readIndex since
Actually, we only have to add leader's commitIndex but not a CommitInfoProto list. @ivandika3 , I could see that adding leader's commitIndex to ReadIndexReplyProto needs more changes and makes the code complicated. I am fine if we keep the current approach using triggerHeartbeat(). I respect your decision. |
What changes were proposed in this pull request?
Please refer to https://issues.apache.org/jira/browse/RATIS-2392
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-2392
How was this patch tested?
Manually through TestOzoneShellHAWithFollowerRead (see the RATIS-2392 comment) and existing CI (https://github.com/ivandika3/ratis/actions/runs/21665802316)