Finalize fast-reboot in warmboot finalizer#14150
Closed
dprital wants to merge 5 commits intosonic-net:masterfrom
Closed
Finalize fast-reboot in warmboot finalizer#14150dprital wants to merge 5 commits intosonic-net:masterfrom
dprital wants to merge 5 commits intosonic-net:masterfrom
Conversation
vaibhavhd
approved these changes
Mar 9, 2023
Contributor
vaibhavhd
left a comment
There was a problem hiding this comment.
Minor comments added. Otherwise LGTM.
| function check_fast_boot () | ||
| { | ||
| if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then | ||
| SYSTEM_FAST_REBOOT=`sonic-db-cli STATE_DB hget "FAST_RESTART_ENABLE_TABLE|system" enable` |
Contributor
There was a problem hiding this comment.
Suggest to still use $SONIC_DB_CLI instead of sonic-db-cli
| function check_fast_boot() | ||
| { | ||
| if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then | ||
| SYSTEM_FAST_REBOOT=`sonic-db-cli STATE_DB hget "FAST_RESTART_ENABLE_TABLE|system" enable` |
Contributor
There was a problem hiding this comment.
Suggest to still use $SONIC_DB_CLI instead of sonic-db-cli
| *SONIC_BOOT_TYPE=fast*|*fast-reboot*) | ||
| # check that the key exists | ||
| if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then | ||
| SYSTEM_FAST_REBOOT=`sonic-db-cli STATE_DB hget "FAST_RESTART_ENABLE_TABLE|system" enable` |
Contributor
There was a problem hiding this comment.
Suggest to still use $SONIC_DB_CLI instead of sonic-db-cli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR should come along with sonic-utilities PR (sonic-net/sonic-utilities#2621) removing the timer usage from fast-reboot script and all other submodule PRs using the fast-reboot state-db entry:
sonic-net/sonic-swss-common#742
sonic-net/sonic-platform-daemons#335
sonic-net/sonic-sairedis#1196
This set of PRs solves the issue #13251
Why I did it
o solve an issue with upgrade with fast-reboot including FW upgrade which has been introduced since moving to fast-reboot over warm-reboot infrastructure.
As well, this introduces fast-reboot finalizing logic to determine fast-reboot is done.
How I did it
Added logic to finalize-warmboot script to handle fast-reboot as well, this makes sense as using fast-reboot over warm-reboot this script will be invoked. The script will clear fast-reboot entry from state-db instead of previous implementation that relied on timer. The timer could expire in some scenarios between fast-reboot finished causing fallback to cold-reboot and possible crashes.
As well this PR updates all services/scripts reading fast-reboot state-db entry to look for the updated value representing fast-reboot is active.
How to verify it
Which release branch to backport (provide reason below if selected)
Description for the changelog
Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)