Skip to content

Commit

Permalink
[fast reboot] set a fast-reboot DB flag (sonic-net#887)
Browse files Browse the repository at this point in the history
- This flag is currently no functional impact with just this change.
- This flag is intended to coordinate fast-reboot shutdown path.
- This flag enables moving fast-reboot per service knowledge to service scripts.
  which unblocks moving warm-reboot per service knowledge to service scripts.
- This flag is consistent with the bootup flag we setting on the boot up path.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
  • Loading branch information
yxieca authored Apr 27, 2020
1 parent fc719ad commit c40f17a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function parseOptions()
done
}

function clear_fast_boot()
function common_clear()
{
debug "${REBOOT_TYPE} failure ($?) cleanup ..."

Expand All @@ -101,9 +101,16 @@ function clear_fast_boot()
teardown_control_plane_assistant
}

function clear_fast_boot()
{
common_clear

redis-cli -n 6 DEL "FAST_REBOOT|system" &>/dev/null || /bin/true
}

function clear_warm_boot()
{
clear_fast_boot
common_clear

result=`timeout 10s config warm_restart disable; if [[ $? == 124 ]]; then echo timeout; else echo "code ($?)"; fi` || /bin/true
debug "Cancel warm-reboot: ${result}"
Expand Down Expand Up @@ -308,6 +315,7 @@ case "$REBOOT_TYPE" in
"fast-reboot")
BOOT_TYPE_ARG=$REBOOT_TYPE
trap clear_fast_boot EXIT HUP INT QUIT TERM KILL ABRT ALRM
redis-cli -n 6 SET "FAST_REBOOT|system" "1" "EX" "180" &>/dev/null
;;
"warm-reboot")
if [[ "$sonic_asic_type" == "mellanox" ]]; then
Expand Down

0 comments on commit c40f17a

Please sign in to comment.