diff mbox series

[ovs-dev,1/3] inc-proc-northd: Don't reset I-P engine force recompute.

Message ID 20211119155607.22719.28111.stgit@dceara.remote.csb
State Accepted
Headers show
Series Reduce number of recomputes in northd. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test fail github build: failed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

Dumitru Ceara Nov. 19, 2021, 3:56 p.m. UTC
In some cases, e.g., when ovn-northd reconnects to NB or SB, a full
recompute must be triggered.  In such cases inc_proc_northd_run() is
called with 'recompute=true' and it should in turn call
engine_set_force_recompute(true).

However, when 'recompute=false', inc_proc_northd_run() should not
reset the I-P engine forced recompute request.  The only time when
force-recompute should be set to 'false' is after a successful engine
run.

Fixes: 4597317f16d1 ("northd: Introduce incremental processing for northd")
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
---
 northd/inc-proc-northd.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/northd/inc-proc-northd.c b/northd/inc-proc-northd.c
index c7f49d599..006d1f129 100644
--- a/northd/inc-proc-northd.c
+++ b/northd/inc-proc-northd.c
@@ -249,9 +249,16 @@  void inc_proc_northd_init(struct ovsdb_idl_loop *nb,
 void inc_proc_northd_run(struct ovsdb_idl_txn *ovnnb_txn,
                          struct ovsdb_idl_txn *ovnsb_txn,
                          bool recompute) {
-    engine_set_force_recompute(recompute);
     engine_init_run();
 
+    /* Force a full recompute if instructed to, for example, after a NB/SB
+     * reconnect event.  However, make sure we don't overwrite an existing
+     * force-recompute request if 'recompute' is false.
+     */
+    if (recompute) {
+        engine_set_force_recompute(recompute);
+    }
+
     struct engine_context eng_ctx = {
         .ovnnb_idl_txn = ovnnb_txn,
         .ovnsb_idl_txn = ovnsb_txn,