[fast-reboot] Fix regression: set FAST_REBOOT state_db flag to support fast-reboot from older images (#16733)

Why I did it
Fix: #16699

Fast reboot is failing from old OS versions (eg., 201911 image) to latest (eg., master branch) after PR #15685

The system wide flag for FAST_REBOOT is still required when the base OS version does not support the new fast-reboot reconciliation logic (no db dump)
This commit is contained in:
Vaibhav Hemant Dixit 2023-09-28 09:37:21 -07:00 committed by GitHub
parent a12b42f94c
commit 07f8507911
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,6 +252,12 @@ function postStartAction()
$SONIC_CFGGEN -j /etc/sonic/config_db$DEV.json --write-to-db
fi
fi
if [[ "$BOOT_TYPE" == "fast" ]]; then
# this is the case when base OS version does not support fast-reboot with reconciliation logic (dump.rdb is absent)
# In this case, we need to set the flag to indicate fast-reboot is in progress. Set the key to expire in 3 minutes
$SONIC_DB_CLI STATE_DB SET "FAST_REBOOT|system" "1" "EX" "180"
fi
fi
if [ -e /tmp/pending_config_migration ] || [ -e /tmp/pending_config_initialization ]; then