[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 <ying.xie@microsoft.com>
This commit is contained in:
Ying Xie 2019-08-15 00:45:54 -07:00 committed by Ying Xie
parent 7e6f29d7ab
commit 2b8eca5ebb

View File

@ -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