-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linkmgrd subscribing State DB route event #13
Changes from 12 commits
ecfac00
21c8202
199917d
24a11ea
4bd2012
9d38f17
88403cc
2f9fed0
12f3b97
ba54965
7d4d091
cc60ba5
a0ddcf4
6c29483
d34cf11
afd2ec8
a784541
550aec3
5438347
0dd8eda
650a3b4
fe583f0
e14a524
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -815,6 +815,29 @@ void LinkManagerStateMachine::handleSwitchActiveRequestEvent() | |
} | ||
} | ||
|
||
// | ||
// ---> handleDefaultRouteStateNotification(const std::string &routeState); | ||
// | ||
// handle default route state notification from routeorch | ||
// | ||
void LinkManagerStateMachine::handleDefaultRouteStateNotification(const std::string &routeState) | ||
{ | ||
MUXLOGWARNING(boost::format("%s: state db default route state: %s") % mMuxPortConfig.getPortName() % routeState); | ||
|
||
if(mComponentInitState.test(MuxStateComponent)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add space after if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated accordingly. |
||
if (ms(mCompositeState) == mux_state::MuxState::Label::Active && | ||
routeState == "na") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest putting '{' on a new line, especially when if condition expands multiple lines. new line helps to identify the beginning of the if body. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated accordingly. |
||
CompositeState nextState = mCompositeState; | ||
enterLinkProberState(nextState, link_prober::LinkProberState::Wait); | ||
switchMuxState(nextState, mux_state::MuxState::Label::Standby); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does it behave if both ToRs have default route as "na" ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both ToRs will switch to standby, the one switches first will be "active" at the end. Do we expect both ToRs to be "standby" in this scenario? This is not supported currently by linkmgrd as I know, we might need find other workaround if so. |
||
LOGWARNING_MUX_STATE_TRANSITION(mMuxPortConfig.getPortName(), mCompositeState, nextState); | ||
mCompositeState = nextState; | ||
} else { | ||
enterMuxWaitState(mCompositeState); | ||
} | ||
} | ||
} | ||
|
||
// | ||
// ---> updateMuxLinkmgrState(); | ||
// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space after while please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated accordingly.