Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ovn-controller.c: Fix assertion failure during address set update.
When an address set is deleted and a new one is created immediately with the same name, the OVSDB deletion and creation notifications can come to ovn-controller within the same message, and the order of the deletion and addition in the IDL is undefined. In this case, if the deletion happens to be processed after the addition, it will result in problems. If the content of the new address set is the same as the old one, the addition will be handled as no change to an existing address set and ignored, but later when handling the deletion, the related flows will be deleted, while we actually expect no change to the flows. If the content of the new address set is different from the old one, the addition will be handled as an update to the old address set, and the delta will be tracked in the I-P engine node data's "updated" member. Later when handling the deletion, the address set will be deleted from the engine node data. So at this point the tracked change in "updated" doesn't have a related address set object in the data, so later when the lflow node handles the addr_sets changes, the assertion fails as shown in below example backtrace: 0 0x00007ffbe5fcabc5 in raise () from /lib64/libc.so.6 1 0x00007ffbe5fb38a4 in abort () from /lib64/libc.so.6 2 0x00000000004f579e in ovs_abort_valist (err_no=<optimized out>, format=<optimized out>, args=<optimized out>) at ../lib/util.c:444 3 0x00000000004fd001 in vlog_abort_valist (module_=<optimized out>, message=0x5e6fd0 "%s: assertion %s failed in %s()", args=args@entry=0x7ffed304caa8) at ../lib/vlog.c:1249 4 0x00000000004fd097 in vlog_abort (module=<optimized out>, message=<optimized out>) at ../lib/vlog.c:1263 5 0x00000000004f54e1 in ovs_assert_failure (where=<optimized out>, function=<optimized out>, condition=<optimized out>) at ../lib/util.c:86 6 0x000000000041941d in as_update_can_be_handled (l_ctx_in=0x7ffed304cda0, l_ctx_in=0x7ffed304cda0, as_diff=0x25520f0, as_name=0x2550a00 "as1") at ../controller/lflow.c:766 7 lflow_handle_addr_set_update (as_name=0x2550a00 "as1", as_diff=0x25520f0, l_ctx_in=0x7ffed304cda0, l_ctx_out=0x7ffed304cd50, changed=0x7ffed304cd4f) at ../controller/lflow.c:869 8 0x0000000000438376 in lflow_output_addr_sets_handler (node=0x7ffed3054420, data=<optimized out>) at ../controller/ovn-controller.c:2648 9 0x000000000045708e in engine_compute (recompute_allowed=<optimized out>, node=<optimized out>) at ../lib/inc-proc-eng.c:417 10 engine_run_node (recompute_allowed=true, node=0x7ffed3054420) at ../lib/inc-proc-eng.c:479 11 engine_run (recompute_allowed=true) at ../lib/inc-proc-eng.c:504 12 0x000000000040939b in main (argc=<optimized out>, argv=<optimized out>) at ../controller/ovn-controller.c:3757 This patch fixes it by handling deletions before additions/updates, similar to how we handle other changes such as lflow and port-groups. Fixes: c0fe8dc ("ovn-controller: Tracking SB address set updates.") Signed-off-by: Han Zhou <hzhou@ovn.org> Acked-by: Ales Musil <amusil@redhat.com>
- Loading branch information