When a follower needs to "catch up", leader can send N entries in
a single append_request instead of only one entry by each message.
The function raft_send_append_request() already supports this, so
this patch just calculate the correct "n" and use it.
Signed-off-by: Han Zhou <hzhou@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
raft_send_install_snapshot_request(raft, s, NULL);
} else if (s->next_index < raft->log_end) {
/* Case 2. */
- raft_send_append_request(raft, s, 1, NULL);
+ raft_send_append_request(raft, s, raft->log_end - s->next_index, NULL);
} else {
/* Case 3. */
if (s->phase == RAFT_PHASE_CATCHUP) {