diff --git a/scripts/fast-reboot b/scripts/fast-reboot index e2604dfd8b..012fb3e82c 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -106,6 +106,20 @@ function clear_warm_boot() fi } +function init_warm_reboot_states() +{ + # If the current running instanace was booted up with warm reboot. Then + # the current DB contents will likely mark warm reboot is done. + # Clear these states so that the next boot up image won't get confused. + if [[ "$REBOOT_TYPE" = "warm-reboot" || "$REBOOT_TYPE" = "fastfast-reboot" ]]; then + redis-cli -n 6 eval " + for _, key in ipairs(redis.call('keys', 'WARM_RESTART_TABLE|*')) do + redis.call('hdel', key, 'state') + end + " 0 >/dev/null + fi +} + function initialize_pre_shutdown() { debug "Initialize pre-shutdown ..." @@ -285,6 +299,8 @@ if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then /usr/bin/fast-reboot-dump.py -t /host/fast-reboot fi +init_warm_reboot_states + setup_control_plane_assistant if [[ "$REBOOT_TYPE" = "warm-reboot" || "$REBOOT_TYPE" = "fastfast-reboot" ]]; then