A recent change made the ovsdb-server socket available as a gating object
preventing race conditions leading to cascading failure states when the
DB service experienced a failure.  As part of that change, all of the
service dependencies were shifted to using the socket file as the gate.

Unfortunately, this exposed a few problems on Fedora 44 shipped systemd.
Specifically, with systemd 259.8 the services are now starting in parallel,
but that leads to a few unexpected side effects:

1. The ovs-ctl calls 'ovs-vsctl' directly, which requires both a DB service
   and the vswitchd service to acknowledge the transaction, leading to a
   hang.

2. The ovs-delete-transient-ports service not waiting for the ovsdb service
   to fully initialize (when running vsctl with --no-wait), so erroring
   before completing the transient port deletion.

Since the service is meant to run on boot, only once (given the Type and
RemainAfterExit values) it makes more sense to keep the gate on the server
service, and switch 'ovs-ctl' to use the builtin ovs_vsctl function to
be a 'db only' transaction.

Fixes: 7e7f5d26f841 ("rhel: Add ovsdb-server.socket unit for systemd socket 
activation.")
Signed-off-by: Aaron Conole <[email protected]>
---
NOTE: The subject underwent some changes since v1

 .../usr_lib_systemd_system_ovs-delete-transient-ports.service | 2 +-
 utilities/ovs-ctl.in                                          | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service 
b/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service
index 5f993e3047..c06fb19d5d 100644
--- a/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service
+++ b/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service
@@ -1,6 +1,6 @@
 [Unit]
 Description=Open vSwitch Delete Transient Ports
-After=ovsdb-server.socket
+After=ovsdb-server.service
 Before=ovs-vswitchd.service
 
 [Service]
diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index fe1a43a21a..cfa1ac0625 100644
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -115,8 +115,8 @@ check_core_config () {
 }
 
 del_transient_ports () {
-    for port in `ovs-vsctl --no-wait --bare -- --columns=name find port 
other_config:transient=true`; do
-        ovs_vsctl --no-wait -- del-port "$port"
+    for port in `ovs_vsctl --no-wait --bare -- --columns=name find port 
other_config:transient=true`; do
+        ovs_vsctl -- del-port "$port"
     done
 }
 
-- 
2.55.0

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

Reply via email to