Skip to content

Commit

Permalink
ovn-nb/sbctl.c: Set default cluster connection mode to no-leader-only
Browse files Browse the repository at this point in the history
  • Loading branch information
noah8713 committed Oct 1, 2019
1 parent a83e69c commit 477785b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
12 changes: 6 additions & 6 deletions ovn/utilities/ovn-nbctl.8.xml
Expand Up @@ -1126,14 +1126,14 @@
<dt><code>--leader-only</code></dt>
<dt><code>--no-leader-only</code></dt>
<dd>
By default, or with <code>--leader-only</code>, when the database server
is a clustered database, <code>ovn-nbctl</code> will avoid servers other
than the cluster leader. This ensures that any data that
<code>ovn-nbctl</code> reads and reports is up-to-date. With
<code>--no-leader-only</code>, <code>ovn-nbctl</code> will use any server
By default, or with <code>--no-leader-only</code>, when the database
server is a clustered database, <code>ovn-nbctl</code> 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 <code>--no-leader-only</code>). Refer to
serialized even with <code>--no-leader-only</code>). With
<code>--leader-only</code>, <code>ovn-nbctl</code> will avoid servers other
than the cluster leader. This ensures that any data that
<code>ovn-nbctl</code> reads and reports is up-to-date. Refer to
<code>Understanding Cluster Consistency</code> in <code>ovsdb</code>(7)
for more information.
</dd>
Expand Down
5 changes: 3 additions & 2 deletions ovn/utilities/ovn-nbctl.c
Expand Up @@ -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. */
Expand Down Expand Up @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions ovn/utilities/ovn-sbctl.8.in
Expand Up @@ -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.
.
Expand Down
4 changes: 2 additions & 2 deletions ovn/utilities/ovn-sbctl.c
Expand Up @@ -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);
Expand Down

0 comments on commit 477785b

Please sign in to comment.