From 83fbd2e9dc5d85bee43b7597d4c3b403d4d1c484 Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Tue, 20 Oct 2020 18:22:25 +0200 Subject: raft: Avoid having more than one snapshot in-flight. Previous commit 8c2c503bdb0d ("raft: Avoid sending equal snapshots.") took a "safe" approach to not send only exactly same snapshot installation requests. However, it doesn't make much sense to send more than one snapshot at a time. If obsolete snapshot installed, leader will re-send the most recent one. With this change leader will have only 1 snapshot in-flight per connection. This will reduce backlogs on raft connections in case new snapshot created while 'install_snapshot_request' is in progress or if election timer changed in that period. Also, not tracking the exact 'install_snapshot_request' we've sent allows to simplify the code. Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1888829 Fixes: 8c2c503bdb0d ("raft: Avoid sending equal snapshots.") Acked-by: Dumitru Ceara Signed-off-by: Ilya Maximets --- ovsdb/raft-private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ovsdb/raft-private.h') diff --git a/ovsdb/raft-private.h b/ovsdb/raft-private.h index 1f366b4ab..76b097b89 100644 --- a/ovsdb/raft-private.h +++ b/ovsdb/raft-private.h @@ -84,8 +84,8 @@ struct raft_server { bool replied; /* Reply to append_request was received from this node during current election_timeout interval. */ - /* Copy of the last install_snapshot_request sent to this server. */ - struct raft_install_snapshot_request *last_install_snapshot_request; + /* install_snapshot_request has been sent, but there is no response yet. */ + bool install_snapshot_request_in_progress; /* For use in adding and removing servers: */ struct uuid requester_sid; /* Nonzero if requested via RPC. */ -- cgit v1.2.1