RATIS-2392. Leader should trigger heartbeat immediately after ReadIndex#1340
RATIS-2392. Leader should trigger heartbeat immediately after ReadIndex#1340szetszwo merged 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. |
OneSizeFitsQuorum
left a comment
There was a problem hiding this comment.
Good idea!
+1 for current method. Triggering the heartbeat is a low-risk, high-reward fix: it’s simple to implement and provides the necessary performance without regressing the codebase.
|
Thanks @szetszwo for the explanation and @OneSizeFitsQuorum for the review. I think we can go ahead with the current approach first, I'll benchmark @szetszwo approach and will raise a ticket if there are improvements and there is no regression. FYI, @szetszwo patch might look like read-index-leader-commit.patch (Edit: looks like the CI pass https://github.com/ivandika3/ratis/actions/runs/21810574780) |
szetszwo
left a comment
There was a problem hiding this comment.
+1 the change looks good.
|
Thanks @ivandika3 for working on this! Thanks @OneSizeFitsQuorum for reviewing this! |
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)