Skip to content
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

Merged
merged 3 commits into from
Oct 12, 2020

Conversation

srj102
Copy link
Contributor

@srj102 srj102 commented Jun 10, 2020

  1. Added new enums to WarmStartState
  2. Added a new function to get the warm start state.

Refer to HLD: sonic-net/SONiC#437

1. Added new enums to WarmStartState
2. Added a new function to get the warm start state.

Refer to HLD: sonic-net/SONiC#437
@prsunny
Copy link
Contributor

prsunny commented Sep 10, 2020

Request review from @dzhangalibaba , @zhenggen-xu

@@ -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;
Copy link
Contributor

@qiluo-msft qiluo-msft Sep 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//WarmStartStateNameMap::iterator it; [](start = 4, length = 37)

Remove commented code #Closed

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove

@@ -181,6 +181,41 @@ bool WarmStart::isSystemWarmRebootEnabled(void)
return warmStart.m_systemWarmRebootEnabled;
}

void WarmStart::getWarmStartState(const std::string &app_name, WarmStartState &state)
Copy link
Contributor

@qiluo-msft qiluo-msft Sep 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WarmStartState [](start = 63, length = 14)

Why not just return this state? #WontFix

Copy link

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.

*/
state = WSUNKNOWN;

for(std::map<WarmStart::WarmStartState, std::string>::const_iterator it = warmStartStateNameMap.begin(); it != warmStartStateNameMap.end(); it++)
Copy link
Contributor

@qiluo-msft qiluo-msft Sep 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::map<WarmStart::WarmStartState, std::string>::const_iterator [](start = 8, length = 64)

auto? #Closed

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will update

{
state = it->first;
break;
}
Copy link
Contributor

@qiluo-msft qiluo-msft Sep 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[](start = 4, length = 2)

Use 4x spaces as indentation #Closed

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will change

/* If warm-start is enabled, state cannot be assumed as Reconciled
* It should be set to unknown
*/
state = WSUNKNOWN;
Copy link
Contributor

@qiluo-msft qiluo-msft Sep 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

state = WSUNKNOWN; [](start = 4, length = 18)

Is it expected state in runtime? If not, just throw an exception. #Closed

Copy link

Choose a reason for hiding this comment

The 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.


state = RECONCILED;

if(!isWarmStart())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a space after if, also with open/close braces. Please do it for the rest of the if and for below

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@prsunny prsunny merged commit 0253214 into sonic-net:master Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants