From 167cf38d01466753aaf72e51827453802db44036 Mon Sep 17 00:00:00 2001 From: Alejandro Gullon Date: Tue, 8 Sep 2026 23:29:44 +0200 Subject: [PATCH] USHIFT-7501: Stop openvswitch after OVN cleanup in microshift-cleanup-data After `microshift-cleanup-data --all` (or `--ovn`) stops ovsdb-server and kills the OVN processes, ovs-vswitchd is left running without its database, so stale OVS datapath/flow state persists. On the next MicroShift start ovnkube-node fatals during init while clearing stale OVS flow targets: failed to init default node network controller: error clearing stale ovs flow targets: "exit status 1" ovnkube-node then crash-loops, never writes the node chassis / gateway config, and every pod is stuck FailedCreatePodSandBox / NetworkPluginNotReady until the healthcheck times out. This was observed intermittently under heavy full-optional load (e.g. the el98-lrel@optional release scenario). Stop openvswitch.service after the OVN process cleanup so the stale state is cleared. The next MicroShift start brings openvswitch back up via microshift.service's Wants and microshift-ovs-init.service's Requires, giving OVN a clean slate to reinitialize. Unlike the best-effort kills above, a real stop failure here has a correctness impact, so it is surfaced rather than discarded. The underlying fragility (ovnkube-node treating the ovs-vsctl failure as fatal) is upstream ovn-kubernetes; this change removes the precondition on the MicroShift side. Co-Authored-By: Claude Opus 4.8 (1M context) pre-commit.check-secrets: ENABLED --- scripts/microshift-cleanup-data.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/microshift-cleanup-data.sh b/scripts/microshift-cleanup-data.sh index 2144d0e87c..e7356ddbb0 100755 --- a/scripts/microshift-cleanup-data.sh +++ b/scripts/microshift-cleanup-data.sh @@ -107,6 +107,10 @@ function clean_processes() { for pname in conmon pause ovn-controller ovn-northd ; do pkill -9 --exact ${pname} || true done + # Stop OVS so the stale flow state left by the stopped ovsdb-server is cleared, + # otherwise OVN cannot reinitialize on the next MicroShift start. + systemctl stop openvswitch.service \ + || echo "WARN: failed to stop openvswitch.service; stale OVS flow state may persist" >&2 fi }