Skip to content

Commit

Permalink
[fast-reboot] Fix regression: set FAST_REBOOT state_db flag to suppor…
Browse files Browse the repository at this point in the history
…t fast-reboot from older images (sonic-net#16733)

Why I did it
Fix: sonic-net#16699

Fast reboot is failing from old OS versions (eg., 201911 image) to latest (eg., master branch) after PR sonic-net#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)
  • Loading branch information
vaibhavhd authored and mssonicbld committed Sep 28, 2023
1 parent 28f011a commit 73598e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,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
Expand Down

0 comments on commit 73598e2

Please sign in to comment.