Skip to content

Commit 408f6e8

Browse files
Gate ovn-controller starting post reboot until ovnkube controller syncs
TODO; Must investigate if this is the right approach for all deployments. We need IC enabled. This commit fixes OCPBUGS-42303. If ovn-controller starts before ovnkube-controller syncs and the changes propagated to SB DB, then ovn-controller will consume stale SB DB data. This PR gates starting ovn-controller until ovnkube controller syncs. ovnkube-controller emits a file to non-persistent storage and we predicate the start on this. Signed-off-by: Martin Kennelly <[email protected]>
1 parent d359981 commit 408f6e8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

bindata/network/ovn-kubernetes/common/008-script-lib.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ data:
5959
exit 1
6060
fi
6161

62+
echo "$(date -Iseconds) - waiting for 5 minutes for ovnkube-controller to sync once post reboot by ensuring a file exits..."
63+
local retries=0
64+
# ten minutes timeout
65+
while [[ 3000 -gt "${retries}" ]]; do
66+
(( retries += 1 ))
67+
if [[ -f /tmp/ovnkube-controller-sync-post-boot ]]; then
68+
break
69+
fi
70+
sleep .2
71+
done
72+
6273
echo "$(date -Iseconds) - starting ovn-controller"
6374
exec ovn-controller \
6475
unix:${vswitch_dbsock} \

0 commit comments

Comments
 (0)