Skip to content

Commit

Permalink
ovn-northd: Avoid verification of NB_Global.options if nothing changed.
Browse files Browse the repository at this point in the history
northd constructs transaction for the Northbound database options even
if they don't need to be changed.  This also includes verification of
a current state.  IDL will eventually drop the transaction if it will
not contain any other operations, but if there are some other
operations, this useless update to the same value will be included
along with the verification.  This causes transaction failures because
NB_Global.options can be updated by CMS at the same time.

For example, ovn-kubernetes sets 'options:e2e_timestamp' for it's own
purposes, and if this value will be updated while there is an in-flight
transaction from the northd, transaction will fail the verification and
northd will have to re-try it.

To avoid these issues, updating and verifying options only if needed.

Fixes: b07f1bc ("Add VXLAN support for non-VTEP datapath bindings")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Mark D. Gray <mark.d.gray@redhat.com>
Signed-off-by: Mark Michelson <mmichels@redhat.com>
  • Loading branch information
igsilya authored and putnopvut committed Sep 13, 2021
1 parent b6bf5e9 commit 27064c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions northd/ovn-northd.c
Original file line number Diff line number Diff line change
Expand Up @@ -13324,8 +13324,10 @@ ovnnb_db_run(struct northd_context *ctx,

smap_replace(&options, "northd_internal_version", ovn_internal_version);

nbrec_nb_global_verify_options(nb);
nbrec_nb_global_set_options(nb, &options);
if (!smap_equal(&nb->options, &options)) {
nbrec_nb_global_verify_options(nb);
nbrec_nb_global_set_options(nb, &options);
}

smap_destroy(&options);

Expand Down

0 comments on commit 27064c5

Please sign in to comment.