Skip to content

Commit

Permalink
raft: Send all missing logs in one single append_request.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
hzhou8 authored and blp committed Mar 6, 2020
1 parent b5e8810 commit 99c2dc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ovsdb/raft.c
Original file line number Diff line number Diff line change
Expand Up @@ -3344,7 +3344,7 @@ raft_handle_append_reply(struct raft *raft,
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) {
Expand Down

0 comments on commit 99c2dc8

Please sign in to comment.