]> git.proxmox.com Git - ovs.git/commit
raft: Avoid sending equal snapshots.
authorIlya Maximets <i.maximets@ovn.org>
Fri, 22 May 2020 20:36:27 +0000 (22:36 +0200)
committerIlya Maximets <i.maximets@ovn.org>
Thu, 28 May 2020 09:46:39 +0000 (11:46 +0200)
commit8c2c503bdb0da1ce6044a53d462f905fd4f8acf5
tree78e23a91661308554441980cec3521f91e96cad2
parent16e3a80cf646f6c53d22ef98599d5aecb8310414
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>
ovsdb/raft-private.c
ovsdb/raft-private.h
ovsdb/raft.c