From 0c6d0c51c219ba148707893b95a94ecafd9c1bc2 Mon Sep 17 00:00:00 2001 From: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com> Date: Thu, 20 Jul 2023 16:12:29 -0700 Subject: [PATCH] [202205] Flush RESTAPI db in fast-reboot shutdown path (#2921) * 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..b89592e27f 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 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