From dd618447e2cc1838431d94f1f8bffa807ef65d89 Mon Sep 17 00:00:00 2001 From: Jing Zhang Date: Thu, 14 Mar 2024 15:04:46 -0700 Subject: [PATCH] [active-standby] reset mux probing backoff factor in link flaps (#245) Description of PR Summary: Fixes # (issue) This PR is to address consistency in PXE boot scenario. In PXE boot, there is no ICMP heartbeats. During booting up, standby might switch to active. Mux probing is now the only way to find out mux toggles. But it's also expected to see mux probing fail when link is down, backoff factor can already be maximum when link is up. If we don't reset backoff factor, it might take ~40s for peer to correct the inconsistency. sign-off: Jing Zhang zhangjing@microsoft.com --- src/link_manager/LinkManagerStateMachineActiveStandby.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/link_manager/LinkManagerStateMachineActiveStandby.cpp b/src/link_manager/LinkManagerStateMachineActiveStandby.cpp index 52bd2d6..cfb5cea 100644 --- a/src/link_manager/LinkManagerStateMachineActiveStandby.cpp +++ b/src/link_manager/LinkManagerStateMachineActiveStandby.cpp @@ -567,6 +567,9 @@ void ActiveStandbyStateMachine::handleStateChange(LinkStateEvent &event, link_st // There is a problem with this approach as it will hide link flaps that result in lost heart-beats. initLinkProberState(nextState, true); // enterMuxWaitState(nextState); + + // reset mux probing backoff factor when link goes up + mMuxUnknownBackoffFactor = 1; } else if (ls(mCompositeState) == link_state::LinkState::Up && ls(nextState) == link_state::LinkState::Down && ms(mCompositeState) != mux_state::MuxState::Label::Standby) { @@ -575,6 +578,10 @@ void ActiveStandbyStateMachine::handleStateChange(LinkStateEvent &event, link_st mActiveUnknownUpCount = 0; mStandbyUnknownUpCount = 0; + + mWaitActiveUpCount = 0; + mWaitStandbyUpBackoffFactor = 1; + mUnknownActiveUpBackoffFactor = 1; } else { mStateTransitionHandler[ps(nextState)][ms(nextState)][ls(nextState)](nextState); }