summaryrefslogtreecommitdiff
path: root/ovsdb/raft-private.h
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2020-05-22 22:36:27 +0200
committerIlya Maximets <i.maximets@ovn.org>2020-05-28 11:46:39 +0200
commit8c2c503bdb0da1ce6044a53d462f905fd4f8acf5 (patch)
tree78e23a91661308554441980cec3521f91e96cad2 /ovsdb/raft-private.h
parent16e3a80cf646f6c53d22ef98599d5aecb8310414 (diff)
downloadopenvswitch-8c2c503bdb0da1ce6044a53d462f905fd4f8acf5.tar.gz
raft: Avoid sending equal snapshots.
Snapshots are huge. In some cases we could receive several outdated append replies from the remote server. This could happen in high scale cases if the remote server is overloaded and not able to process all the raft requests in time. As an action to each outdated append reply we're sending full database snapshot. While remote server is already overloaded those snapshots will stuck in jsonrpc backlog for a long time making it grow up to few GB. Since remote server wasn't able to timely process incoming messages it will likely not able to process snapshots leading to the same situation with low chances to recover. Remote server will likely stuck in 'candidate' state, other servers will grow their memory consumption due to growing jsonrpc backlogs: jsonrpc|INFO|excessive sending backlog, jsonrpc: ssl:192.16.0.3:6644, num of msgs: 3795, backlog: 8838994624. This patch is trying to avoid that situation by avoiding sending of equal snapshot install requests. This helps maintain reasonable memory consumption and allows the cluster to recover on a larger scale. Acked-by: Han Zhou <hzhou@ovn.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'ovsdb/raft-private.h')
-rw-r--r--ovsdb/raft-private.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/ovsdb/raft-private.h b/ovsdb/raft-private.h
index ac8656d42..1f366b4ab 100644
--- a/ovsdb/raft-private.h
+++ b/ovsdb/raft-private.h
@@ -27,6 +27,7 @@
struct ds;
struct ovsdb_parser;
+struct raft_install_snapshot_request;
/* Formatting server IDs and cluster IDs for use in human-readable logs. Do
* not use these in cases where the whole server or cluster ID is needed; use
@@ -83,6 +84,9 @@ 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;
+
/* For use in adding and removing servers: */
struct uuid requester_sid; /* Nonzero if requested via RPC. */
struct unixctl_conn *requester_conn; /* Only if requested via unixctl. */