Skip to content

Commit

Permalink
ovn-ic: wakeup on ovsdb transaction failures
Browse files Browse the repository at this point in the history
If an ovsdb transaction fails (e.g. adding the same tunnel_key as another
ovn-ic to the same datapath, for a different port (race condition)),
there was no guarentee that ovn-ic would wake up, and that state would stay
until ovn-ic wake up, for instance due to some ovn-ic-sb changes.

Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
Acked-by: Mark Michelson <mmichels@redhat.com>
Acked-by: Ales Musil <amusil@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
simonartxavier authored and numansiddique committed Nov 3, 2023
1 parent cf1b992 commit 7bfe388
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions ic/ovn-ic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2221,10 +2221,19 @@ main(int argc, char *argv[])
ovn_db_run(&ctx);
}

ovsdb_idl_loop_commit_and_wait(&ovnnb_idl_loop);
ovsdb_idl_loop_commit_and_wait(&ovnsb_idl_loop);
ovsdb_idl_loop_commit_and_wait(&ovninb_idl_loop);
ovsdb_idl_loop_commit_and_wait(&ovnisb_idl_loop);
int rc1 = ovsdb_idl_loop_commit_and_wait(&ovnnb_idl_loop);
int rc2 = ovsdb_idl_loop_commit_and_wait(&ovnsb_idl_loop);
int rc3 = ovsdb_idl_loop_commit_and_wait(&ovninb_idl_loop);
int rc4 = ovsdb_idl_loop_commit_and_wait(&ovnisb_idl_loop);
if (!rc1 || !rc2 || !rc3 || !rc4) {
VLOG_DBG(" a transaction failed in: %s %s %s %s",
!rc1 ? "nb" : "", !rc2 ? "sb" : "",
!rc3 ? "ic_nb" : "", rc4 ? "ic_sb" : "");
/* A transaction failed. Wake up immediately to give
* opportunity to send the proper transaction
*/
poll_immediate_wake();
}
} else {
/* ovn-ic is paused
* - we still want to handle any db updates and update the
Expand Down

0 comments on commit 7bfe388

Please sign in to comment.