diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2021-06-29 12:56:18 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2021-07-15 21:04:49 +0200 |
commit | 00dda78ed43b55e65948e935e6715d2d82615d30 (patch) | |
tree | a58c6a5c978b6b24854b37a058e28944e5352836 /lib/svec.h | |
parent | 73259ea70374ea94330e03eb18824a03b2a8db23 (diff) | |
download | openvswitch-00dda78ed43b55e65948e935e6715d2d82615d30.tar.gz |
ovsdb-cs: Avoid unnecessary re-connections when updating remotes.
If a new database server added to the cluster, or if one of the
database servers changed its IP address or port, then you need to
update the list of remotes for the client. For example, if a new
OVN_Southbound database server is added, you need to update the
ovn-remote for the ovn-controller.
However, in the current implementation, the ovsdb-cs module always
closes the current connection and creates a new one. This can lead
to a storm of re-connections if all ovn-controllers will be updated
simultaneously. They can also start re-dowloading the database
content, creating even more load on the database servers.
Correct this by saving an existing connection if it is still in the
list of remotes after the update.
'reconnect' module will report connection state updates, but that
is OK since no real re-connection happened and we only updated the
state of a new 'reconnect' instance.
If required, re-connection can be forced after the update of remotes
with ovsdb_cs_force_reconnect().
Acked-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Han Zhou <hzhou@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib/svec.h')
-rw-r--r-- | lib/svec.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/svec.h b/lib/svec.h index b4e1343a9..cd95871cc 100644 --- a/lib/svec.h +++ b/lib/svec.h @@ -50,6 +50,7 @@ void svec_shuffle(struct svec *); void svec_diff(const struct svec *a, const struct svec *b, struct svec *a_only, struct svec *both, struct svec *b_only); bool svec_contains(const struct svec *, const char *); +bool svec_contains_unsorted(const struct svec *, const char *); size_t svec_find(const struct svec *, const char *); bool svec_is_sorted(const struct svec *); bool svec_is_unique(const struct svec *); |