From 102e514758593e44d5aaa7eeb467ab1fc7fc7b37 Mon Sep 17 00:00:00 2001 From: Jipan Yang Date: Tue, 25 Sep 2018 15:54:32 -0700 Subject: [PATCH 1/3] Adapt to the new WARM_RESTART_TABLE table schema: change from restart_count to restore_count Signed-off-by: Jipan Yang --- dockers/docker-orchagent/swssconfig.sh | 2 +- files/scripts/swss.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dockers/docker-orchagent/swssconfig.sh b/dockers/docker-orchagent/swssconfig.sh index 7188703d23ea..de92225d5ee3 100755 --- a/dockers/docker-orchagent/swssconfig.sh +++ b/dockers/docker-orchagent/swssconfig.sh @@ -47,7 +47,7 @@ SYSTEM_WARM_START=`redis-cli -n 4 hget "WARM_RESTART|system" enable` SWSS_WARM_START=`redis-cli -n 4 hget "WARM_RESTART|swss" enable` if [[ "$SYSTEM_WARM_START" == "true" ]] || [[ "$SWSS_WARM_START" == "true" ]]; then # We have to make sure db data has not been flushed. - RESTART_COUNT=`redis-cli -n 6 hget "WARM_RESTART_TABLE|orchagent" restart_count` + RESTART_COUNT=`redis-cli -n 6 hget "WARM_RESTART_TABLE|orchagent" restore_count` if [[ -n "$RESTART_COUNT" ]] && [[ "$RESTART_COUNT" != "0" ]]; then exit 0 fi diff --git a/files/scripts/swss.sh b/files/scripts/swss.sh index 22f1f0d668dd..733bfadd1026 100755 --- a/files/scripts/swss.sh +++ b/files/scripts/swss.sh @@ -41,7 +41,7 @@ function check_warm_boot() function validate_restart_count() { if [[ x"$WARM_BOOT" == x"true" ]]; then - RESTART_COUNT=`/usr/bin/redis-cli -n 6 hget "WARM_RESTART_TABLE|orchagent" restart_count` + RESTART_COUNT=`/usr/bin/redis-cli -n 6 hget "WARM_RESTART_TABLE|orchagent" restore_count` # We have to make sure db data has not been flushed. if [[ -z "$RESTART_COUNT" ]]; then WARM_BOOT="false" From 74f932bfd70a7f759735a164c98146222efa803b Mon Sep 17 00:00:00 2001 From: Jipan Yang Date: Wed, 26 Sep 2018 10:47:19 -0700 Subject: [PATCH 2/3] Update variable and function name to match restore_count name change Signed-off-by: Jipan Yang --- dockers/docker-orchagent/swssconfig.sh | 4 ++-- files/scripts/swss.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dockers/docker-orchagent/swssconfig.sh b/dockers/docker-orchagent/swssconfig.sh index de92225d5ee3..c6915f0597a1 100755 --- a/dockers/docker-orchagent/swssconfig.sh +++ b/dockers/docker-orchagent/swssconfig.sh @@ -47,8 +47,8 @@ SYSTEM_WARM_START=`redis-cli -n 4 hget "WARM_RESTART|system" enable` SWSS_WARM_START=`redis-cli -n 4 hget "WARM_RESTART|swss" enable` if [[ "$SYSTEM_WARM_START" == "true" ]] || [[ "$SWSS_WARM_START" == "true" ]]; then # We have to make sure db data has not been flushed. - RESTART_COUNT=`redis-cli -n 6 hget "WARM_RESTART_TABLE|orchagent" restore_count` - if [[ -n "$RESTART_COUNT" ]] && [[ "$RESTART_COUNT" != "0" ]]; then + RESTORE_COUNT=`redis-cli -n 6 hget "WARM_RESTART_TABLE|orchagent" restore_count` + if [[ -n "$RESTORE_COUNT" ]] && [[ "$RESTORE_COUNT" != "0" ]]; then exit 0 fi fi diff --git a/files/scripts/swss.sh b/files/scripts/swss.sh index 733bfadd1026..f7fe1a5510cd 100755 --- a/files/scripts/swss.sh +++ b/files/scripts/swss.sh @@ -38,12 +38,12 @@ function check_warm_boot() fi } -function validate_restart_count() +function validate_restore_count() { if [[ x"$WARM_BOOT" == x"true" ]]; then - RESTART_COUNT=`/usr/bin/redis-cli -n 6 hget "WARM_RESTART_TABLE|orchagent" restore_count` + RESTORE_COUNT=`/usr/bin/redis-cli -n 6 hget "WARM_RESTART_TABLE|orchagent" restore_count` # We have to make sure db data has not been flushed. - if [[ -z "$RESTART_COUNT" ]]; then + if [[ -z "$RESTORE_COUNT" ]]; then WARM_BOOT="false" fi fi @@ -69,7 +69,7 @@ start() { wait_for_database_service check_warm_boot - validate_restart_count + validate_restore_count debug "Warm boot flag: ${SERVICE} ${WARM_BOOT}." From 80d05faa65a1ac2136db54a284f305a04e8f0ba1 Mon Sep 17 00:00:00 2001 From: Jipan Yang Date: Fri, 28 Sep 2018 14:22:43 -0700 Subject: [PATCH 3/3] Update swss submodule for warm restart schema change Signed-off-by: Jipan Yang --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 13df5a98d4a6..f13aaed9f21f 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 13df5a98d4a6375a778b6216cff886a0c474aa9a +Subproject commit f13aaed9f21f457419e96a5d28a52d319fbee9ed