Skip to content

Commit

Permalink
[control plane assistant] stop control plane assistant after warm reb…
Browse files Browse the repository at this point in the history
…oot (#3337)

Delay saving configuration so that the control assistant configurations
won't be persisted.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
  • Loading branch information
yxieca authored and lguohan committed Aug 15, 2019
1 parent ee31e3b commit d6b4223
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions files/image_config/warmboot-finalizer/finalize-warmboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d6b4223

Please sign in to comment.