Skip to content

Commit

Permalink
Adapt to the new WARM_RESTART_TABLE table schema: change from restart… (
Browse files Browse the repository at this point in the history
sonic-net#2083)

* Adapt to the new WARM_RESTART_TABLE table schema: change from restart_count to restore_count

Signed-off-by: Jipan Yang <[email protected]>

* Update variable and function name to match restore_count name change

Signed-off-by: Jipan Yang <[email protected]>

* Update swss submodule for warm restart schema change

Signed-off-by: Jipan Yang <[email protected]>
  • Loading branch information
jipanyang authored and lguohan committed Oct 2, 2018
1 parent 593bcb1 commit dedd562
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dockers/docker-orchagent/swssconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" restart_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
Expand Down
8 changes: 4 additions & 4 deletions files/scripts/swss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" restart_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
Expand All @@ -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}."

Expand Down
2 changes: 1 addition & 1 deletion src/sonic-swss

0 comments on commit dedd562

Please sign in to comment.