On 11/9/20 12:09 PM, Dumitru Ceara wrote: > IDL clients had no way of checking whether monitor_cond_change requests > were pending (either local or in flight). This commit introduces a new > API to check for the state of the conditional monitoring clauses. > > Signed-off-by: Dumitru Ceara <dce...@redhat.com> > --- > lib/ovsdb-idl.c | 40 ++++++++++++++++++++++++++++++++-------- > lib/ovsdb-idl.h | 1 + > 2 files changed, 33 insertions(+), 8 deletions(-) >
<snip> > diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h > index a1a5776..3f19d40 100644 > --- a/lib/ovsdb-idl.h > +++ b/lib/ovsdb-idl.h > @@ -421,6 +421,7 @@ unsigned int ovsdb_idl_set_condition(struct ovsdb_idl *, > const struct ovsdb_idl_condition *); > > unsigned int ovsdb_idl_get_condition_seqno(const struct ovsdb_idl *); > +bool ovsdb_idl_monitor_condition_pending(struct ovsdb_idl *); I don't think that we need a new api for this. Condition sequence number, I believe, exists for exactly this case. There is an issue, however, that db bindings doesn't return result of ovsdb_idl_set_condition() throwing it away without giving a chance for an idl user to actually use it. That could be fixed by something like this: diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in index 698fe25f3..d319adb03 100755 --- a/ovsdb/ovsdb-idlc.in +++ b/ovsdb/ovsdb-idlc.in @@ -1416,10 +1416,10 @@ struct %(s)s * print("\nstruct ovsdb_idl_column %s_columns[%s_N_COLUMNS];" % ( structName, structName.upper())) print(""" -void +unsigned int %(s)s_set_condition(struct ovsdb_idl *idl, struct ovsdb_idl_condition *condition) { - ovsdb_idl_set_condition(idl, &%(p)stable_%(tl)s, condition); + return ovsdb_idl_set_condition(idl, &%(p)stable_%(tl)s, condition); }""" % {'p': prefix, 's': structName, 'tl': tableName.lower()}) --- I think, I had this patch somewhere already, but it seems that I never actually send it. With this change ovn-controller will need to store the returned value and wait until current condition seqno != expected to be sure that condition was successfully set. What do you think? Best regards, Ilya Maximets. _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev