Adapt to the new WARM_RESTART_TABLE table schema: change from restart… (#2083)

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

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

* Update variable and function name to match restore_count name change

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

* Update swss submodule for warm restart schema change

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
This commit is contained in:
Jipan Yang 2018-10-02 06:08:26 -07:00 committed by lguohan
parent 593bcb1c1b
commit dedd5624a0
3 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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
@ -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}."

@ -1 +1 @@
Subproject commit 13df5a98d4a6375a778b6216cff886a0c474aa9a
Subproject commit f13aaed9f21f457419e96a5d28a52d319fbee9ed