Skip to content

Commit

Permalink
Fix the issue as reported in (sonic-net#5315)
Browse files Browse the repository at this point in the history
sonic-net#5255

Root Cause: Waiting on Restore count != 0 can lead to race condition
between orchagent process and swssconfig.sh.

Ideally check of  Restore count != 0 is not needed as the State DB
cannot be flushed as if it was flushed then Warm Restart or swss-restart
should not be true also.
  • Loading branch information
abdosi authored and santhosh-kt committed Feb 25, 2021
1 parent 58dcbf1 commit a853da9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions dockers/docker-orchagent/swssconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ HWSKU=${HWSKU:-`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['hwsku']"`}
SYSTEM_WARM_START=`sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable`
SWSS_WARM_START=`sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|swss" enable`
if [[ "$SYSTEM_WARM_START" == "true" ]] || [[ "$SWSS_WARM_START" == "true" ]]; then
# We have to make sure db data has not been flushed.
RESTORE_COUNT=`sonic-db-cli STATE_DB hget "WARM_RESTART_TABLE|orchagent" restore_count`
if [[ -n "$RESTORE_COUNT" ]] && [[ "$RESTORE_COUNT" != "0" ]]; then
exit 0
fi
exit 0
fi

SWSSCONFIG_ARGS="00-copp.config.json ipinip.json ports.json switch.json "
Expand Down

0 comments on commit a853da9

Please sign in to comment.