Skip to content

Commit

Permalink
[reboot]: Stop mux before reboot on dual ToR (sonic-net#1500)
Browse files Browse the repository at this point in the history
If the script detects it is running on a dual ToR system, stop the mux container before shutting down syncd

This is necessary to prevent some links from flapping when the standby ToR is rebooted - when reboot stop syncd, the linkmgr will stop receiving heartbeats and will then tell the mux to switchover. However, since the device is rebooting, no heartbeats will be sent out. The peer ToR will see this absence of heartbeats and tell the mux to switch back to itself (the peer ToR), causing the flap.

By stopping the mux container before shutting down syncd, we prevent the rebooting ToR from switching the mux.

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
  • Loading branch information
theasianpianist authored Mar 17, 2021
1 parent fbad274 commit aa71231
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fi
REBOOT_USER=$(logname)
PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
ASIC_TYPE=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type)
SUBTYPE=$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype)
VERBOSE=no
EXIT_NEXT_IMAGE_NOT_EXISTS=4
EXIT_SONIC_INSTALLER_VERIFY_REBOOT=21
Expand Down Expand Up @@ -52,6 +53,10 @@ function tag_images()

function stop_sonic_services()
{
if [[ x"$SUBTYPE" == x"DualToR" ]]; then
debug "DualToR detected, stopping mux container before reboot..."
systemctl stop mux
fi
if [[ x"$ASIC_TYPE" != x"mellanox" ]]; then
debug "Stopping syncd process..."
docker exec -i syncd /usr/bin/syncd_request_shutdown --cold > /dev/null
Expand Down

0 comments on commit aa71231

Please sign in to comment.