From ee2ec81a6d408e416e066b77ae0a00714dc56c5a Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Fri, 20 Sep 2024 09:00:07 +0200 Subject: [PATCH] Stop the OVN database during the cleanup script Stop the DB server gracefully; this will also end the pod running script. By executing the stop command in the backgroung, we guarantee to exit this script and not fail with "FailedPreStopHook", while the database is stopped and the pod exits. Closes-Issue: OSPRH-8118 --- templates/ovndbcluster/bin/cleanup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/ovndbcluster/bin/cleanup.sh b/templates/ovndbcluster/bin/cleanup.sh index 1004f5e5..92c39ec7 100755 --- a/templates/ovndbcluster/bin/cleanup.sh +++ b/templates/ovndbcluster/bin/cleanup.sh @@ -44,3 +44,9 @@ if [[ "$(hostname)" != "{{ .SERVICE_NAME }}-0" ]]; then # now that we left, the database file is no longer valid cleanup_db_file fi + +# Stop the DB server gracefully; this will also end the pod running script. +# By executing the stop command in the background, we guarantee to exit +# this script and not fail with "FailedPreStopHook", while the database is +# stopped. +/usr/share/ovn/scripts/ovn-ctl stop_${DB_TYPE}_ovsdb &