When ovn-controller is restarted, it may need multiple iterations of
main loop before completely download all related data from SB DB,
especially when ovn-monitor-all=false, so after restart, before it sees
the related localnet ports from SB DB, it treats the related patch
ports on the chassis as not needed, and deleted them. Later when it
downloads thoses port-bindings it recreates them.  For a graceful
upgrade, we don't want this to happen, because it would break the
traffic.

Similar problems were prevented for the vif_plug module by using a countdown
mechanism after startup, to postpone the deletion of interfaces, and if it was
a deletion only because of missing data from SB, the deletion wouldn't be
necessary and it will not be triggered after the delay if the missing SB data
has been populated during the delay.

This series abstracts the delay mechanism to util functions and improves the
accuracy by counting down only for input updates rather than for main loop
wakups. In addition, it adds a timeout in addition to the counter to protect
from corner cases when too many input updates caused by local conf DB changes
after startup. The abstracted mechanism is used for both patch module and
vif_plug module.

The first patch of the series fixes an I-P bug. Without the fix, some test
cases would fail when patch deletion is postponed.

v1 -> v2:
- Add patch 1, the I-P fix.
- Split the original patch to 3 patches (adding p2 and p4, changing the
  implementation to a common mechanism as suggested by Dumitru).

Han Zhou (4):
  binding.c: Missing local_datapath update in runtime_data port_binding
    handler.
  ovn-controller: Add a generic way to check if the daemon started
    recently.
  patch.c: Avoid patch interface deletion & recreation during restart.
  vif-plug.c: Use daemon_started_recently() to replace the prime
    counter.

 controller/binding.c        | 31 ++++++++++------
 controller/ovn-controller.c | 23 +++++++++---
 controller/patch.c          |  9 ++++-
 controller/vif-plug.c       | 20 ++++-------
 lib/inc-proc-eng.c          | 11 ++++++
 lib/inc-proc-eng.h          |  4 +++
 lib/ovn-util.c              | 50 ++++++++++++++++++++++++++
 lib/ovn-util.h              |  4 +++
 tests/ovn-controller.at     | 71 +++++++++++++++++++++++++++++++++++++
 9 files changed, 193 insertions(+), 30 deletions(-)

-- 
2.30.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to