diff --git a/files/image_config/warmboot-finalizer/finalize-warmboot.sh b/files/image_config/warmboot-finalizer/finalize-warmboot.sh index 00e4e1b7f3f9..32c9c8444cc3 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