[dualtor][active-active]Killing radv instead of stopping on active-active dualtor if config knob is on (#13408) (#13458)

This commit is contained in:
mssonicbld 2023-01-21 12:55:10 +08:00 committed by GitHub
parent ffa70dfc4e
commit a67ed33ec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,26 @@ function check_fast_boot ()
fi
}
function check_redundant_type()
{
DEVICE_SUBTYPE=`$SONIC_DB_CLI CONFIG_DB hget "DEVICE_METADATA|localhost" subtype`
if [[ x"$DEVICE_SUBTYPE" == x"DualToR" ]]; then
MUX_CONFIG=`show muxcable config`
if [[ $MUX_CONFIG =~ .*active-active.* ]]; then
ACTIVE_ACTIVE="true"
else
ACTIVE_ACTIVE="false"
fi
else
ACTIVE_ACTIVE="false"
fi
CONFIG_KNOB=`$SONIC_DB_CLI CONFIG_DB hget "MUX_LINKMGR|SERVICE_MGMT" kill_radv`
if [[ x"$CONFIG_KNOB" != x"True" ]]; then
ACTIVE_ACTIVE='false'
fi
debug "DEVICE_SUBTYPE: ${DEVICE_SUBTYPE}, CONFIG_KNOB: ${CONFIG_KNOB}"
}
start() {
debug "Starting ${SERVICE}$DEV service..."
@ -43,13 +63,19 @@ stop() {
check_warm_boot
check_fast_boot
check_redundant_type
debug "Warm boot flag: ${SERVICE}$DEV ${WARM_BOOT}."
debug "Fast boot flag: ${SERVICE}$DEV ${FAST_BOOT}."
# For WARM/FAST boot do not perform service stop
if [[ x"$WARM_BOOT" != x"true" ]] && [[ x"$FAST_BOOT" != x"true" ]]; then
if [[ x"$SERVICE" == x"radv" ]] && [[ x"$ACTIVE_ACTIVE" == x"true" ]]; then
debug "Killing Docker ${SERVICE}${DEV} for active-active dualtor device..."
/usr/bin/${SERVICE}.sh kill $DEV
else
/usr/bin/${SERVICE}.sh stop $DEV
debug "Stopped ${SERVICE}$DEV service..."
fi
else
debug "Killing Docker ${SERVICE}${DEV}..."
/usr/bin/${SERVICE}.sh kill $DEV