When the engine wouldn't run for whatever reason we could end up
in a situation when SB commit would return UNCHANGED. That on its
own is completely fine, however when we are in the middle of waiting
for sync this would result in SB idl cur_cfg bump. The cur_cfg value
is used for the synchronization itself, so the ovn-nbctl call would
return early. To prevent that make sure we commit into the SB only
if engine had the chance to run. Forcing the SB Global nb_cfg update
in single transaction as the rest of the changes.

Reported-at: https://issues.redhat.com/browse/FDP-1712
Signed-off-by: Ales Musil <[email protected]>
---
 northd/ovn-northd.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 29152cdd7..9b61ba668 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -1104,6 +1104,14 @@ main(int argc, char *argv[])
                     clear_idl_track = false;
                 }
 
+                /* Make sure we don't bump the next_cfg when we shouldn't.
+                 * This should prevent ovn-nbctl sync calls to return before
+                 * the SB updates are actually done. */
+                if (!activity && ovnsb_txn &&
+                    ovnsb_idl_loop.cur_cfg != ovnsb_idl_loop.next_cfg) {
+                    ovsdb_idl_txn_abort(ovnsb_txn);
+                }
+
                 /* If there are any errors, we force a full recompute in order
                  * to ensure we handle all changes. */
                 if (!ovsdb_idl_loop_commit_and_wait(&ovnnb_idl_loop)) {
-- 
2.51.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to