From: Han Zhou Date: Sat, 29 Feb 2020 02:07:09 +0000 (-0800) Subject: raft: Send all missing logs in one single append_request. X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=99c2dc8d04b3b697edfa02b06e127edad6ad5b28;p=mirror_ovs.git raft: Send all missing logs in one single append_request. 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 Signed-off-by: Ben Pfaff --- diff --git a/ovsdb/raft.c b/ovsdb/raft.c index 0eb8644f3..c5c1d49a8 100644 --- a/ovsdb/raft.c +++ b/ovsdb/raft.c @@ -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) {