Skip to content
Merged
16 changes: 14 additions & 2 deletions scripts/db_migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, namespace, socket=None):
none-zero values.
build: sequentially increase within a minor version domain.
"""
self.CURRENT_VERSION = 'version_4_0_0'
self.CURRENT_VERSION = 'version_4_0_1'

self.TABLE_NAME = 'VERSIONS'
self.TABLE_KEY = 'DATABASE'
Expand Down Expand Up @@ -850,9 +850,21 @@ def version_3_0_6(self):
def version_4_0_0(self):
"""
Version 4_0_0.
This is the latest version for master branch
"""
log.log_info('Handling version_4_0_0')
# Update state-db fast-reboot entry to enable if set to enable fast-reboot finalizer when using upgrade with fast-reboot
fastreboot_state = self.stateDB.get(self.stateDB.STATE_DB, 'FAST_REBOOT|system', '1')
if fastreboot_state == 'true':
self.stateDB.set(self.stateDB.STATE_DB, 'FAST_REBOOT|system', 'enable')
self.set_version('version_4_0_1')
return None

def version_4_0_1(self):
"""
Version 4_0_1.
This is the latest version for master branch
"""
log.log_info('Handling version_4_0_1')
return None

def get_version(self):
Expand Down
4 changes: 2 additions & 2 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function clear_boot()

#clear_fast_boot
if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then
sonic-db-cli STATE_DB DEL "FAST_REBOOT|system" &>/dev/null || /bin/true
sonic-db-cli STATE_DB SET "FAST_REBOOT|system" "disable" &>/dev/null || /bin/true
fi
}

Expand Down Expand Up @@ -532,7 +532,7 @@ case "$REBOOT_TYPE" in
check_warm_restart_in_progress
BOOT_TYPE_ARG=$REBOOT_TYPE
trap clear_boot EXIT HUP INT QUIT TERM KILL ABRT ALRM
sonic-db-cli STATE_DB SET "FAST_REBOOT|system" "1" "EX" "210" &>/dev/null
sonic-db-cli STATE_DB SET "FAST_REBOOT|system" "enable" &>/dev/null
config warm_restart enable system
;;
"warm-reboot")
Expand Down
3 changes: 2 additions & 1 deletion sonic-utilities-data/templates/service_mgmt.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ function check_warm_boot()

function check_fast_boot()
{
if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then
SYSTEM_FAST_REBOOT=`sonic-db-cli STATE_DB GET "FAST_REBOOT|system"`
if [[ ${SYSTEM_FAST_REBOOT} == "enable" ]]; then
FAST_BOOT="true"
else
FAST_BOOT="false"
Expand Down