Skip to content

Commit

Permalink
support compatibility for fast-reboot from previous versions (prior 2…
Browse files Browse the repository at this point in the history
…02205)
  • Loading branch information
arfeigin committed Mar 15, 2023
1 parent 0ea478d commit 9f72383
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ function postStartAction()
fi

if [[ "$BOOT_TYPE" == "fast" ]]; then
$SONIC_DB_CLI STATE_DB HSET "FAST_RESTART_ENABLE_TABLE|system" "enable" "true"
# set the key to expire in 3 minutes
$SONIC_DB_CLI STATE_DB SET "FAST_REBOOT|system" "1" "EX" "180"
fi

$SONIC_DB_CLI CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
Expand Down
9 changes: 5 additions & 4 deletions files/image_config/warmboot-finalizer/finalize-warmboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ check_warm_boot

if [[ x"${WARM_BOOT}" != x"true" ]]; then
debug "warmboot is not enabled ..."
if [[ x"${FAST_BOOT}" != x"true" ]]; then
if [[ x"${FAST_REBOOT}" != x"true" ]]; then
debug "fastboot is not enabled ..."
exit 0
fi
fi

if [[ x"${WARM_BOOT}" == x"true" ]]; then
if [[ (x"${WARM_BOOT}" == x"true") && (x"${FAST_REBOOT}" != x"true") ]]; then
restore_counters_folder
fi

Expand All @@ -165,7 +165,7 @@ for i in `seq 60`; do
sleep 5
done

if [[ x"${WARM_BOOT}" == x"true" ]]; then
if [[ (x"${WARM_BOOT}" == x"true") && (x"${FAST_REBOOT}" != x"true") ]]; then
stop_control_plane_assistant
fi

Expand All @@ -180,6 +180,7 @@ fi
if [ x"${FAST_REBOOT}" == x"true" ]; then
finalize_fast_reboot
fi

if [ x"${WARM_BOOT}" == x"true" ]; then
finalize_warm_boot
fi
fi

0 comments on commit 9f72383

Please sign in to comment.