From ee9250e8cc6f8462c125270881cc3b1a946b54dc Mon Sep 17 00:00:00 2001 From: Vaibhav Hemant Dixit Date: Thu, 23 Sep 2021 23:53:22 -0700 Subject: [PATCH] Save DB dump after warm/fast reboot (#8803) As a part of warmboot, redis database is dumped: https://github.com/Azure/sonic-utilities/blob/c97fe546e5a725b9049047293a4fede48fde5223/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. --- files/build_templates/docker_image_ctl.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 541f52656b..99192b4458 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -153,7 +153,8 @@ function postStartAction() sleep 1; done 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 # If there is a config_db.json dump file, load it. if [ -r /etc/sonic/config_db$DEV.json ]; then