[ovs-git] [openvswitch/ovs] 0401cf: ovsdb idl: Try committing the pending txn in ovsdb...

numansiddique noreply at github.com
Tue Jun 16 21:18:49 UTC 2020

  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 0401cf5f9e0669dc894e89105983098ef69763c3
  Author: Numan Siddique <numans at ovn.org>
  Date:   2020-06-16 (Tue, 16 Jun 2020)

  Changed paths:
    M lib/ovsdb-idl.c

  Log Message:
  ovsdb idl: Try committing the pending txn in ovsdb_idl_loop_run.

The function ovsdb_idl_loop_run(), after calling ovsdb_idl_run(),
returns a transaction object (of type 'struct ovsdb_idl_txn').
The returned transaction object can be NULL if there is a pending
transaction (loop->committing_txn) in the idl loop object.

Normally the clients of idl library, first call ovsdb_idl_loop_run(),
then do their own processing and create any idl transactions during
this processing and then finally call ovsdb_idl_loop_commit_and_wait().

If ovsdb_idl_loop_run() returns NULL transaction object, then much
of the processing done by the client gets wasted as in the case
of ovn-controller.

The client (in this case ovn-controller), can skip the processing
and instead call ovsdb_idl_loop_commit_and_wait() if the transaction
oject is NULL. But ovn-controller uses IDL tracking and it may
loose the tracked changes in that run.

This patch tries to improve this scenario, by checking if the
pending transaction can be committed in the ovsdb_idl_loop_run()
itself and if the pending transaction is cleared (because of the
response messages from ovsdb-server due to a transaction message
in the previous run), ovsdb_idl_loop_run() can return a valid
transaction object.

CC: Han Zhou <hzhou at ovn.org>
Signed-off-by: Numan Siddique <numans at ovn.org>
Signed-off-by: Ben Pfaff <blp at ovn.org>

More information about the git mailing list