From fe3c9e36fec3da0a08251ee38991891520b0c0ac Mon Sep 17 00:00:00 2001 From: bingwang Date: Thu, 20 Jul 2023 22:40:00 +0000 Subject: [PATCH 1/2] Flush RESTAPI db in fast-reboot shutdown path --- scripts/fast-reboot | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/fast-reboot b/scripts/fast-reboot index 844b1d8409..3d9ef4301e 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -726,6 +726,11 @@ for service in ${SERVICES_TO_STOP}; do sonic-db-cli FLEX_COUNTER_DB FLUSHDB > /dev/null fi + if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then + # Flush RESTAP_DB in fast-reboot to avoid stale status + sonic-db-cli RESTAPI_DB FLUSHDB > /dev/null + fi + # TODO: backup_database preserves FDB_TABLE # need to cleanup as well for fastfast boot case backup_database From 637f204bc0cb1b3dc8fdc6d49b918f9763fdec5e Mon Sep 17 00:00:00 2001 From: bingwang Date: Thu, 20 Jul 2023 22:42:45 +0000 Subject: [PATCH 2/2] Fix typo in comment --- scripts/fast-reboot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/fast-reboot b/scripts/fast-reboot index 3d9ef4301e..b89592e27f 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -727,10 +727,10 @@ for service in ${SERVICES_TO_STOP}; do fi if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then - # Flush RESTAP_DB in fast-reboot to avoid stale status + # Flush RESTAPI_DB in fast-reboot to avoid stale status sonic-db-cli RESTAPI_DB FLUSHDB > /dev/null fi - + # TODO: backup_database preserves FDB_TABLE # need to cleanup as well for fastfast boot case backup_database