-
Notifications
You must be signed in to change notification settings - Fork 265
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
[warm reboot] Warm Reboot Support for EVPN VXLAN #350
Changes from 1 commit
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 |
---|---|---|
|
@@ -181,6 +181,41 @@ bool WarmStart::isSystemWarmRebootEnabled(void) | |
return warmStart.m_systemWarmRebootEnabled; | ||
} | ||
|
||
void WarmStart::getWarmStartState(const std::string &app_name, WarmStartState &state) | ||
{ | ||
//WarmStartStateNameMap::iterator it; | ||
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.
Remove commented code #Closed 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. Will remove |
||
std::string statestr; | ||
|
||
auto& warmStart = getInstance(); | ||
|
||
state = RECONCILED; | ||
|
||
if(!isWarmStart()) | ||
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. Please have a space after 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. Done. |
||
return; | ||
|
||
warmStart.m_stateWarmRestartTable->hget(app_name, "state", statestr); | ||
|
||
/* If warm-start is enabled, state cannot be assumed as Reconciled | ||
* It should be set to unknown | ||
*/ | ||
state = WSUNKNOWN; | ||
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.
Is it expected state in runtime? If not, just throw an exception. #Closed 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. Yes, this is expected. When Module A check for the status of Module B, module B may not have reached/initialised to any state yet. Hence module A needs to know that Module B is not ready yet an act accordingly. |
||
|
||
for(std::map<WarmStart::WarmStartState, std::string>::const_iterator it = warmStartStateNameMap.begin(); it != warmStartStateNameMap.end(); it++) | ||
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.
auto? #Closed 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. will update |
||
{ | ||
if(it->second == statestr) | ||
{ | ||
state = it->first; | ||
break; | ||
} | ||
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.
Use 4x spaces as indentation #Closed 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. will change |
||
} | ||
|
||
SWSS_LOG_INFO("%s warm start state get %s(%d)", | ||
app_name.c_str(), statestr.c_str(), state); | ||
|
||
return; | ||
} | ||
|
||
|
||
// Set the WarmStart FSM state for a particular application. | ||
void WarmStart::setWarmStartState(const std::string &app_name, WarmStartState state) | ||
{ | ||
|
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.
Why not just return this state? #WontFix
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.
Don't see any issue with pass by reference. Will consider that while updating other files where this api is used.