Adds FSIO R/W sync script for stormond implementation#18927
Closed
ashwnsri wants to merge 7 commits intosonic-net:masterfrom
Closed
Adds FSIO R/W sync script for stormond implementation#18927ashwnsri wants to merge 7 commits intosonic-net:masterfrom
ashwnsri wants to merge 7 commits intosonic-net:masterfrom
Conversation
added 7 commits
May 9, 2024 04:57
A service 'fsio-sync' that calls a shell script 'fsio-sync.sh' that parses the latest fsio reads/writes from /proc/diskstats and saves it to disk using 'fsio-rw-sync' script, as well as updates the StateDB upon successful parse and sync. Changes that copy these files to the appropriate locations in the image. Changes that instruct the build_template to copy 'fsio-rw-sync' into the appr. location in the pmon container
… boot Changed fsio-sync.sh so that sleep interval can by dynamically changed per loop
…e sync script to appr location
…gs in sync script.
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.
Why I did it
This is part of a larger feature implementation: Storage Monitoring Daemon. It adds a script to sync the FSIO reads and writes from the STATE_DB to the disk, which is called by the various reboot scripts during planned reboot.
Work item tracking
How I did it
Added the sync script to image_config folder
Made changes in sonic_debian_extension.j2 that copies the above file to the appropriate location in the image.
Made changes that instruct the build_template to copy 'fsio-rw-sync' into the appropriate location in the pmon container, so that the script can be called by the daemon from within pmon.
How to verify it
Flash image with these changes onto a DUT
Write sample values of the appropriate fields to STATE_DB
Erase the contents of the fsio-rw-stats.json file and replace with empty JSON
Reboot the device with this sister sonic-utilities change: Modified reboot scripts to sync FSIO reads/writes to disk before OS-level reboot sonic-utilities#3171
On reboot, verify that the values from Step 2 are in the JSON file.
if the sonic-utilities PR is not yet merged, you can verify the presence of the sync script in /usr/local/bin and call it manually, after which you can verify that the empty JSON file has been populated with the contents of the STATE_DB values we previously posted to the database.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Added logic to sync stormond STATE_DB values to disk in planned reboot scenarios
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)