[ovs-dev] [PATCH 01/10] ovsdb-idl: Avoid sending transactions when the DB is not synced up.

Mark Michelson mmichels at redhat.com
Fri Nov 16 20:36:11 UTC 2018


For the series, looks good by my eyes. I have to admit I may have just 
skimmed patch 8 though :)

Acked-by: Mark Michelson <mmichels at redhat.com>

On 11/15/2018 01:05 AM, Ben Pfaff wrote:
> Until now the code here would happily try to send transactions to the
> database server even if the database connection was not in the correct
> state.  In some cases this could lead to strange behavior, such as sending
> a database transaction for a database that the IDL had just learned did not
> exist on the server.
> 
> Signed-off-by: Ben Pfaff <blp at ovn.org>
> ---
>   lib/ovsdb-idl.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
> index 9f44cefd152b..a1f246d6f7b7 100644
> --- a/lib/ovsdb-idl.c
> +++ b/lib/ovsdb-idl.c
> @@ -3867,6 +3867,13 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn)
>           goto coverage_out;
>       }
>   
> +    /* If we're still connecting or re-connecting, don't bother sending a
> +     * transaction. */
> +    if (txn->db->idl->state != IDL_S_MONITORING) {
> +        txn->status = TXN_TRY_AGAIN;
> +        goto disassemble_out;
> +    }
> +
>       /* If we need a lock but don't have it, give up quickly. */
>       if (txn->db->lock_name && !txn->db->has_lock) {
>           txn->status = TXN_NOT_LOCKED;
> 



More information about the dev mailing list