From 2b8eca5ebb355ea862e56df2264b140535a5fad0 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Thu, 15 Aug 2019 00:45:54 -0700 Subject: [PATCH] [control plane assistant] stop control plane assistant after warm reboot (#3337) Delay saving configuration so that the control assistant configurations won't be persisted. Signed-off-by: Ying Xie --- .../warmboot-finalizer/finalize-warmboot.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/files/image_config/warmboot-finalizer/finalize-warmboot.sh b/files/image_config/warmboot-finalizer/finalize-warmboot.sh index 00e4e1b7f3..32c9c8444c 100755 --- a/files/image_config/warmboot-finalizer/finalize-warmboot.sh +++ b/files/image_config/warmboot-finalizer/finalize-warmboot.sh @@ -68,6 +68,14 @@ function finalize_warm_boot() sudo config warm_restart disable } +function stop_control_plane_assistant() +{ + if [[ -x ${ASSISTANT_SCRIPT} ]]; then + debug "Tearing down control plane assistant ..." + ${ASSISTANT_SCRIPT} -m reset + fi +} + wait_for_database_service @@ -78,11 +86,6 @@ if [[ x"${WARM_BOOT}" != x"true" ]]; then exit 0 fi -# No need to wait for the reconciliation process. Database has been loaded -# and migrated. This is good enough to save a copy. -debug "Save in-memory database after warm reboot ..." -config save -y - list=${COMP_LIST} # Wait up to 5 minutes @@ -94,6 +97,12 @@ for i in `seq 60`; do sleep 5 done +stop_control_plane_assistant + +# Save DB after stopped control plane assistant to avoid extra entries +debug "Save in-memory database after warm reboot ..." +config save -y + if [[ -n "${list}" ]]; then debug "Some components didn't finish reconcile: ${list} ..." fi