-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fast-reboot] Set flex counters delay indicator to prevent flex counters enablement after fast-reboot #1768
[Fast-reboot] Set flex counters delay indicator to prevent flex counters enablement after fast-reboot #1768
Conversation
…unters Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the change to fast-reboot script itself.
Move the logic to fast-reboot script
@yxieca can you please check now? |
@shlomibitton is it needed for 202106? |
@liat-grozovik Yes we should, thanks. |
scripts/fast-reboot
Outdated
@@ -670,6 +671,18 @@ then | |||
systemctl stop "$service_name" | |||
fi | |||
|
|||
if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then | |||
CONFIG_DB_FILE=/etc/sonic/config_db.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CONFIG_DB_FILE
constant can be moved to the top of this file. So that it can be reused at other places. There is an existing usage here:
https://github.com/Azure/sonic-utilities/blob/master/scripts/fast-reboot#L516
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, can you check please?
scripts/fast-reboot
Outdated
if [[ COUNTERPOLL_DELAY_RC -ne 0 ]]; then | ||
error "Failed to delay counterpoll. Exit code: $COUNTERPOLL_DELAY_RC" | ||
unload_kernel | ||
exit "${EXIT_COUNTERPOLL_DELAY_FAILURE}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think exiting here is incorrect. At this point all the critical services are killed/stopped, and we have committed to reboot (no matter what):
https://github.com/Azure/sonic-utilities/blob/6fd06755ab3762888cb26512c5aebccbcf3cbcf9/scripts/fast-reboot#L557
Moreover, exiting here would leave DUT in unusable state, as the trap handlers are also removed and no restoration will be performed:
https://github.com/Azure/sonic-utilities/blob/6fd06755ab3762888cb26512c5aebccbcf3cbcf9/scripts/fast-reboot#L561
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this whole logic should move above the set +e
, so that if this indeed fails, we have a way to recover DUT from there, and not have any impact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, can you check please?
…re occur. Declare config_db.json file location
…ers enablement after fast-reboot (#1768) #### What I did Set flex counters delay indicator to prevent flex counters enablement after fast-reboot. #### How I did it Modify config DB json file with 'true' status for delay of flex counters indicator. #### How to verify it Run fast-reboot and observe counters are created only when enable_counters script is called, even if the tables are present in config DB.
Signed-off-by: Shlomi Bitton shlomibi@nvidia.com
What I did
Set flex counters delay indicator to prevent flex counters enablement after fast-reboot.
How I did it
Modify config DB json file with 'true' status for delay of flex counters indicator.
How to verify it
Run fast-reboot and observe counters are created only when enable_counters script is called, even if the tables are present in config DB.
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)