Skip to content

Finalize fast-reboot in warmboot finalizer#14150

Closed
dprital wants to merge 5 commits intosonic-net:masterfrom
dprital:fast_boot_finalizer
Closed

Finalize fast-reboot in warmboot finalizer#14150
dprital wants to merge 5 commits intosonic-net:masterfrom
dprital:fast_boot_finalizer

Conversation

@dprital
Copy link
Collaborator

@dprital dprital commented Mar 8, 2023

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)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

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)

@dprital dprital requested a review from lguohan as a code owner March 8, 2023 04:36
@dprital dprital changed the title Fast boot finalizer Finalize fast-reboot in warmboot finalizer Mar 8, 2023
@dprital dprital requested a review from vaibhavhd March 8, 2023 14:38
Copy link
Contributor

@vaibhavhd vaibhavhd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest to still use $SONIC_DB_CLI instead of sonic-db-cli

@dprital dprital marked this pull request as draft March 12, 2023 14:39
@dprital dprital closed this Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants