Modified reboot scripts to sync FSIO reads/writes to disk before OS-level reboot#3171
Modified reboot scripts to sync FSIO reads/writes to disk before OS-level reboot#3171prgeor merged 5 commits intosonic-net:masterfrom ashwnsri:ssdmon-utils
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). |
There was a problem hiding this comment.
@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.
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
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.
There was a problem hiding this comment.
@assrinivasan for cold reboot why not use the SIGTERM to save in stormond deinit path itself?
There was a problem hiding this comment.
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
| stop_pmon_service | ||
| } | ||
|
|
||
| function sync_fsio_rw() |
There was a problem hiding this comment.
@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.
…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_INFOkey as a key fromSTATE_DBwhose 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_INFOinformation from STATE_DBHow to verify it
/host/pmon/stormonand 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