From 7b2da02b9871d6a51535e48f1cfa9bb345ebce51 Mon Sep 17 00:00:00 2001 From: hejiangbo Date: Tue, 8 Sep 2020 01:23:22 -0700 Subject: [PATCH 1/2] fix error: interface counters is mismatch after warm-reboot --- .../warmboot-finalizer/finalize-warmboot.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/files/image_config/warmboot-finalizer/finalize-warmboot.sh b/files/image_config/warmboot-finalizer/finalize-warmboot.sh index 01ad921137b6..8dc77d2a4bb0 100755 --- a/files/image_config/warmboot-finalizer/finalize-warmboot.sh +++ b/files/image_config/warmboot-finalizer/finalize-warmboot.sh @@ -76,6 +76,20 @@ function stop_control_plane_assistant() fi } +function restore_counters_folder() +{ + debug "Restoring counters folder after warmboot..." + + modules=("portstat-0" "dropstat" "pfcstat-0" "queuestat-0" "intfstat-0") + for module in ${modules[@]} + do + statfile="/host/$module" + if [[ -d $statfile ]]; then + mv $statfile /tmp/ + fi + done +} + wait_for_database_service @@ -86,6 +100,8 @@ if [[ x"${WARM_BOOT}" != x"true" ]]; then exit 0 fi +restore_counters_folder + list=${COMP_LIST} # Wait up to 5 minutes From 5766bf347c72874cb89ecd05aa725a2203ec6a05 Mon Sep 17 00:00:00 2001 From: hejiangbo Date: Mon, 14 Sep 2020 03:23:34 -0700 Subject: [PATCH 2/2] change warm-reboot tmp counters folder from '/host' to '/host/counters' --- files/image_config/warmboot-finalizer/finalize-warmboot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/image_config/warmboot-finalizer/finalize-warmboot.sh b/files/image_config/warmboot-finalizer/finalize-warmboot.sh index 8dc77d2a4bb0..a2fa23dde46b 100755 --- a/files/image_config/warmboot-finalizer/finalize-warmboot.sh +++ b/files/image_config/warmboot-finalizer/finalize-warmboot.sh @@ -83,7 +83,7 @@ function restore_counters_folder() modules=("portstat-0" "dropstat" "pfcstat-0" "queuestat-0" "intfstat-0") for module in ${modules[@]} do - statfile="/host/$module" + statfile="/host/counters/$module" if [[ -d $statfile ]]; then mv $statfile /tmp/ fi