From 477785b935cb4f979c5f3d2a65a8133f15019dc3 Mon Sep 17 00:00:00 2001 From: Aliasgar Ginwala Date: Tue, 1 Oct 2019 14:41:43 -0700 Subject: [PATCH] ovn-nb/sbctl.c: Set default cluster connection mode to no-leader-only --- ovn/utilities/ovn-nbctl.8.xml | 12 ++++++------ ovn/utilities/ovn-nbctl.c | 5 +++-- ovn/utilities/ovn-sbctl.8.in | 14 +++++++------- ovn/utilities/ovn-sbctl.c | 4 ++-- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/ovn/utilities/ovn-nbctl.8.xml b/ovn/utilities/ovn-nbctl.8.xml index 14cc02f53c0..af5991fa447 100644 --- a/ovn/utilities/ovn-nbctl.8.xml +++ b/ovn/utilities/ovn-nbctl.8.xml @@ -1126,14 +1126,14 @@
--leader-only
--no-leader-only
- By default, or with --leader-only, when the database server - is a clustered database, ovn-nbctl will avoid servers other - than the cluster leader. This ensures that any data that - ovn-nbctl reads and reports is up-to-date. With - --no-leader-only, ovn-nbctl will use any server + By default, or with --no-leader-only, when the database + server is a clustered database, ovn-nbctl will use any server in the cluster, which means that for read-only transactions it can report and act on stale data (transactions that modify the database are always - serialized even with --no-leader-only). Refer to + serialized even with --no-leader-only). With + --leader-only, ovn-nbctl will avoid servers other + than the cluster leader. This ensures that any data that + ovn-nbctl reads and reports is up-to-date. Refer to Understanding Cluster Consistency in ovsdb(7) for more information.
diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index aa5aa32420c..dada27b8649 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -80,8 +80,8 @@ static struct ovsdb_idl *the_idl; static struct ovsdb_idl_txn *the_idl_txn; OVS_NO_RETURN static void nbctl_exit(int status); -/* --leader-only, --no-leader-only: Only accept the leader in a cluster. */ -static int leader_only = true; +/* --leader-only, --no-leader-only: Accept any node in a cluster. */ +static int leader_only = false; /* --unixctl-path: Path to use for unixctl server, for "monitor" and "snoop" commands. */ @@ -181,6 +181,7 @@ main(int argc, char *argv[]) "(use --help for help)"); } daemon_mode = true; + leader_only = true; } /* Initialize IDL. "retry" is true iff in daemon mode. */ idl = the_idl = ovsdb_idl_create(db, &nbrec_idl_class, true, daemon_mode); diff --git a/ovn/utilities/ovn-sbctl.8.in b/ovn/utilities/ovn-sbctl.8.in index 2aaa457e826..51a566ad36b 100644 --- a/ovn/utilities/ovn-sbctl.8.in +++ b/ovn/utilities/ovn-sbctl.8.in @@ -53,14 +53,14 @@ e.g. \fBssl:192.168.10.5:6640\fR, as described in \fBovsdb\fR(7). . .IP "\fB\-\-leader\-only\fR" .IQ "\fB\-\-no\-leader\-only\fR" -By default, or with \fB\-\-leader\-only\fR, when the database server -is a clustered database, \fBovn\-sbctl\fR will avoid servers other -than the cluster leader. This ensures that any data that -\fBovn\-sbctl\fR reads and reports is up-to-date. With -\fB\-\-no\-leader\-only\fR, \fBovn\-sbctl\fR will use any server in -the cluster, which means that for read-only transactions it can report +By default, or with \fB\-\-no\-leader\-only\fR, when the database server +is a clustered database, \fBovn\-sbctl\fR will use any server +in the cluster, which means that for read-only transactions it can report and act on stale data (transactions that modify the database are -always serialized even with \fB\-\-no\-leader\-only\fR). Refer to +always serialized even with \fB\-\-no\-leader\-only\fR). With +\fB\-\-leader\-only\fR, \fBovn\-sbctl\fR will avoid servers other +than the cluster leader. This ensures that any data that +\fBovn\-sbctl\fR reads and reports is up-to-date. . Refer to \fBUnderstanding Cluster Consistency\fR in \fBovsdb\fR(7) for more information. . diff --git a/ovn/utilities/ovn-sbctl.c b/ovn/utilities/ovn-sbctl.c index ee97a4710e1..90a8f1d2a57 100644 --- a/ovn/utilities/ovn-sbctl.c +++ b/ovn/utilities/ovn-sbctl.c @@ -81,8 +81,8 @@ static struct ovsdb_idl *the_idl; static struct ovsdb_idl_txn *the_idl_txn; OVS_NO_RETURN static void sbctl_exit(int status); -/* --leader-only, --no-leader-only: Only accept the leader in a cluster. */ -static int leader_only = true; +/* --leader-only, --no-leader-only: Accept any node in a cluster. */ +static int leader_only = false; static void sbctl_cmd_init(void); OVS_NO_RETURN static void usage(void);