Save DB dump after warm/fast reboot (#8803)

As a part of warmboot, redis database is dumped:
c97fe546e5/scripts/fast-reboot (L269)
However, this dump file is deleted, after it is loaded back into db post reboot.
The DB dump can be useful for debugging purpose, hence taking a backup of it can be useful.
Instead of deleting the dump, rename and keep the dump.
This commit is contained in:
Vaibhav Hemant Dixit 2021-09-23 23:53:22 -07:00 committed by GitHub
parent 62a1f5eb19
commit ee9250e8cc
No account linked to committer's email address

View File

@ -153,7 +153,8 @@ function postStartAction()
sleep 1; sleep 1;
done done
if [[ ("$BOOT_TYPE" == "warm" || "$BOOT_TYPE" == "fastfast") && -f $WARM_DIR/dump.rdb ]]; then if [[ ("$BOOT_TYPE" == "warm" || "$BOOT_TYPE" == "fastfast") && -f $WARM_DIR/dump.rdb ]]; then
rm -f $WARM_DIR/dump.rdb # retain the dump file from last boot for debugging purposes
mv $WARM_DIR/dump.rdb $WARM_DIR/dump.rdb.old
else else
# If there is a config_db.json dump file, load it. # If there is a config_db.json dump file, load it.
if [ -r /etc/sonic/config_db$DEV.json ]; then if [ -r /etc/sonic/config_db$DEV.json ]; then