mirror of
https://github.com/openvswitch/ovs
synced 2025-10-17 14:28:02 +00:00
python: Monitor Database table to manage lifecycle of IDL client.
The Python IDL implementation supports ovsdb cluster connections. This patch is a follow up to commit31e434fc98
, it adds the option of connecting to the leader (the default) in the Raft-based cluster. It mimics the exisiting C IDL support for clusters introduced in commit1b1d2e6daa
. The _Server database schema is first requested, then a monitor of the Database table in the _Server Database. Method __check_server_db verifies the eligibility of the server. If the attempt to obtain a monitor of the _Server database fails and a cluster id was not provided this implementation proceeds to request the data monitor. If a cluster id was provided via the set_cluster_id method then the connection is aborted and a connection to a different node is instead attempted, until a valid cluster node is found. Thus, when supplied, cluster id is interpreted as the intention to only allow connections to a clustered database. If not supplied, connections to standalone nodes, or nodes that do not have the _Server database are allowed. change_seqno is not incremented in the case of Database table updates. Acked-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ted Elhourani <ted.elhourani@nutanix.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -344,6 +344,9 @@ class Reconnect(object):
|
||||
else:
|
||||
self.info_level("%s: error listening for connections"
|
||||
% self.name)
|
||||
elif self.state == Reconnect.Reconnect:
|
||||
self.info_level("%s: connection closed by client"
|
||||
% self.name)
|
||||
elif self.backoff < self.max_backoff:
|
||||
if self.passive:
|
||||
type_ = "listen"
|
||||
|
Reference in New Issue
Block a user