Skip to content

Commit

Permalink
ovn-northd: Don't log transaction failures on standby instances.
Browse files Browse the repository at this point in the history
We still need to try to ovsdb_idl_loop_commit_and_wait() on instances
that are in standby mode.  That's because they need to try to take the
lock.  But if they're in standby they won't actually build a transaction
json and will return early because they don't own the SB lock.

That's reported as an error by ovsdb_idl_loop_commit_and_wait() but we
shouldn't act on it.

Explicitly force a full recompute when transitioning from "standby" or
"paused" to "active".

Fixes: 953832e ("ovn-northd: Don't trigger recompute for transactions that are in progress.")
Fixes: 4597317 ("northd: Introduce incremental processing for northd")
Reported-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Numan Siddique <numans@ovn.org>
Signed-off-by: Han Zhou <hzhou@ovn.org>
  • Loading branch information
dceara authored and hzhou8 committed Feb 23, 2022
1 parent 7b56f69 commit 71f87a6
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions northd/ovn-northd.c
Expand Up @@ -835,6 +835,27 @@ main(int argc, char *argv[])
ovnnb_txn, ovnsb_txn,
&ovnsb_idl_loop);
}

/* 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)) {
VLOG_INFO("OVNNB commit failed, "
"force recompute next time.");
recompute = true;
}

if (!ovsdb_idl_loop_commit_and_wait(&ovnsb_idl_loop)) {
VLOG_INFO("OVNSB commit failed, "
"force recompute next time.");
recompute = true;
}
} else {
/* Make sure we send any pending requests, e.g., lock. */
ovsdb_idl_loop_commit_and_wait(&ovnnb_idl_loop);
ovsdb_idl_loop_commit_and_wait(&ovnsb_idl_loop);

/* Force a full recompute next time we become active. */
recompute = true;
}
} else {
/* ovn-northd is paused
Expand All @@ -856,17 +877,8 @@ main(int argc, char *argv[])
ovsdb_idl_run(ovnsb_idl_loop.idl);
ovsdb_idl_wait(ovnnb_idl_loop.idl);
ovsdb_idl_wait(ovnsb_idl_loop.idl);
}

/* 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)) {
VLOG_INFO("OVNNB commit failed, force recompute next time.");
recompute = true;
}

if (!ovsdb_idl_loop_commit_and_wait(&ovnsb_idl_loop)) {
VLOG_INFO("OVNSB commit failed, force recompute next time.");
/* Force a full recompute next time we become active. */
recompute = true;
}

Expand Down

0 comments on commit 71f87a6

Please sign in to comment.