Warm reboot: Don't load json conifg like copp, ininip, ports and switch again upon… (#1939)

* Don't load json conifg like copp, ininip, ports and switch again upon swss warm start

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* double check DB data exists in case only swss warm restart is configured at system reboot

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* Double check existence of db data before skipping json load, and format update

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
This commit is contained in:
Jipan Yang 2018-09-07 12:25:38 -07:00 committed by lguohan
parent 588da73a7d
commit 3f049d33bf

View File

@ -41,6 +41,18 @@ fast_reboot
HWSKU=`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['hwsku']"`
# Don't load json config if system warm start or
# swss docker warm start is enabled, the data already exists in appDB.
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
exit 0
fi
fi
SWSSCONFIG_ARGS="00-copp.config.json ipinip.json ports.json switch.json "
for file in $SWSSCONFIG_ARGS; do