Message ID | 20201218053144.2637583-7-blp@ovn.org |
---|---|
State | Accepted |
Headers | show |
Series | Refactor OVSDB IDL into two layers | expand |
On 12/18/20 6:31 AM, Ben Pfaff wrote: > Signed-off-by: Ben Pfaff <blp@ovn.org> > --- > lib/ovsdb-idl.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c > index 02a49b32454b..c6b6075d51e3 100644 > --- a/lib/ovsdb-idl.c > +++ b/lib/ovsdb-idl.c > @@ -617,6 +617,14 @@ ovsdb_idl_destroy(struct ovsdb_idl *idl) > } > } > > +/* By default, or if 'leader_only' is true, when 'idl' connects to a clustered > + * database, the IDl will avoid servers other than the cluster leader. This > + * ensures that any data that it reads and reports is up-to-date. If > + * 'leader_only' is false, the IDL will accept 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 false > + * 'leader_only'). Refer to Understanding Cluster Consistency in ovsdb(7) for > + * more information. */ > void > ovsdb_idl_set_leader_only(struct ovsdb_idl *idl, bool leader_only) > { > LGTM, Acked-by: Ilya Maximets <i.maximets@ovn.org>
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index 02a49b32454b..c6b6075d51e3 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -617,6 +617,14 @@ ovsdb_idl_destroy(struct ovsdb_idl *idl) } } +/* By default, or if 'leader_only' is true, when 'idl' connects to a clustered + * database, the IDl will avoid servers other than the cluster leader. This + * ensures that any data that it reads and reports is up-to-date. If + * 'leader_only' is false, the IDL will accept 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 false + * 'leader_only'). Refer to Understanding Cluster Consistency in ovsdb(7) for + * more information. */ void ovsdb_idl_set_leader_only(struct ovsdb_idl *idl, bool leader_only) {
Signed-off-by: Ben Pfaff <blp@ovn.org> --- lib/ovsdb-idl.c | 8 ++++++++ 1 file changed, 8 insertions(+)