-
Notifications
You must be signed in to change notification settings - Fork 668
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
Modified reboot scripts to sync FSIO reads/writes to disk before OS-level reboot #3171
Conversation
…d ssdutil import to match corresponding change in sonic-platform-common
/azp run Azure.sonic-utilities |
Azure Pipelines successfully started running 1 pipeline(s). |
scripts/fast-reboot
Outdated
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.
@assrinivasan I thought we discussed to save the state in STATE_DB and during warm-reboot STATE_DB fileds are saved?
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.
Hi Prince -- I added the script here too because we dont save all the tables, just the following:
WARM_RESTART_TABLE
MIRROR_SESSION_TABLE
FG_ROUTE_TABLE
WARM_RESTART_ENABLE_TABLE
VXLAN_TUNNEL_TABLE
BUFFER_MAX_PARAM_TABLE
FAST_RESTART_ENABLE_TABLE
All the other keys are deleted in the backup_database function:
sonic-utilities/scripts/fast-reboot
Line 243 in 8629b68
function backup_database() |
So if we don't sync the STORAGE_INFO fields, we would lose them. Depending on when warm-reboot is called, the previously sync-ed values might be very outdated. That is why I added the sync script here.
scripts/reboot
Outdated
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.
@assrinivasan for cold reboot why not use the SIGTERM to save in stormond deinit path itself?
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.
stormond currently does this, so I can certainly remove the sync script invocation here. I only kept it here as it is a good fail-safe to have and it doesn't hurt anything.
scripts/soft-reboot
Outdated
@@ -81,6 +81,17 @@ function stop_sonic_services() | |||
stop_pmon_service | |||
} | |||
|
|||
function sync_fsio_rw() |
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.
@assrinivasan same comment as fast-reboot case.
…evel reboot (sonic-net#3171) * Added a script to sync FS I/O reads/writes just before reboot; renamed ssdutil import to match corresponding change in sonic-platform-common * Added FSIO RW sync to all reboot scripts * Reverted changes to setup.py and ssdutil * Standardized invocation point of the FSIO sync script in all 3 scripts * Modified code such that FSIO sync is initiated from stormon daemon.
…evel reboot (sonic-net#3171) * Added a script to sync FS I/O reads/writes just before reboot; renamed ssdutil import to match corresponding change in sonic-platform-common * Added FSIO RW sync to all reboot scripts * Reverted changes to setup.py and ssdutil * Standardized invocation point of the FSIO sync script in all 3 scripts * Modified code such that FSIO sync is initiated from stormon daemon.
Added code to sync FS I/O reads/writes just before reboot
What I did
soft/cold reboot: script changes to stop PMON container so as to send a SIGTERM to the Storage Monitoring Daemon before OS-level reboot. This signal is caught by the daemon which then syncs the total and latest FSIO reads and writes from STATE_DB to a location on the disk and would be picked up by the daemon upon reboot.
fast-reboot: Added
STORAGE_INFO
key as a key fromSTATE_DB
whose underlying information is to be saved.SONiC Storage Monitoring Daemon HLD
How I did it
soft/cold-reboot: script first stops the pmon container before attempting to kill the container
fast-reboot: Added code to save
STORAGE_INFO
information from STATE_DBHow to verify it
/host/pmon/stormon
and cat the fsio-rw-stats.json file for current valuesCOLD REBOOT
SOFT REBOOT
FAST/WARM REBOOT
Previous command output (if the output of a command-line utility has changed)
N/A
New command output (if the output of a command-line utility has changed)
N/A