[
https://issues.apache.org/jira/browse/RATIS-1562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18142013#comment-18142013
]
Elia Renzoni commented on RATIS-1562:
-------------------------------------
Thanks [~szetszwo], I verified both cases with a test that counts the RPCs a
leader sends to a follower during a 5 s snapshot install (default 75 ms
heartbeat interval).
* {{{}installSnapshotEnabled=true{}}}: fine, as you said. The LogAppender
thread is blocked while sending the snapshot, so no RPCs are sent during the
install.
* {{{}installSnapshotEnabled=false{}}}: as you said, no AppendEntries with log
entries are sent. However, each loop iteration sends a notification (the
follower replies {{{}IN_PROGRESS{}}}) plus an empty AppendEntries (the follower
replies {{{}INCONSISTENCY{}}}). The loop never waits for the heartbeat
interval: {{hasAppendEntries()}} stays true and the {{IN_PROGRESS}} replies
keep {{isSlowFollower()}} returning false, so {{getWaitTimeMs()}} returns
{{wait-time.min}} (1 ms). The result is about 600–900 RPCs.
I propose throttling both to one per heartbeat interval while the follower
replies {{{}IN_PROGRESS{}}}, similar to etcd’s probe/snapshot states. That’s
roughly a 9–14x reduction in my local test. Leadership, health and lease checks
are unaffected.
What do you think about this direction?
> Do not send AppendEntries while InstallSnapshot is in progress
> --------------------------------------------------------------
>
> Key: RATIS-1562
> URL: https://issues.apache.org/jira/browse/RATIS-1562
> Project: Ratis
> Issue Type: Improvement
> Components: server
> Reporter: Kaijie Chen
> Assignee: Elia Renzoni
> Priority: Major
>
> It is wasting of rpcs to send AppendEntries while InstallSnapshot is in
> progress. Because the reply from the follower will always be INCONSISTENCY.
> See following design doc from etcd as a reference. Maybe we should also
> introduce the follower progress state to Ratis.
> https://github.com/etcd-io/etcd/blob/main/raft/design.md
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)