From ef7780d8f49cc8f5170f30ce9054994c44957107 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 29 Sep 2023 04:08:34 +0800 Subject: [PATCH] [fast-reboot] Fix regression: set FAST_REBOOT state_db flag to support fast-reboot from older images (#16733) (#16754) --- files/build_templates/docker_image_ctl.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 4bd2620b13..5336568fda 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -241,6 +241,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