Skip to content

Commit

Permalink
Init OrchDaemon with optional warm starting (sonic-net#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiluo-msft authored Aug 21, 2018
1 parent 9f645e5 commit d7bd94f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
5 changes: 1 addition & 4 deletions orchagent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,7 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}

if (!WarmStart::isWarmStart())
{
syncd_apply_view();
}
syncd_apply_view();

orchDaemon->start();
}
Expand Down
14 changes: 5 additions & 9 deletions orchagent/orchdaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ using namespace swss;

extern sai_switch_api_t* sai_switch_api;
extern sai_object_id_t gSwitchId;
extern void syncd_apply_view();
/*
* Global orch daemon variables
*/
Expand Down Expand Up @@ -263,6 +262,11 @@ bool OrchDaemon::init()

m_orchList.push_back(&CounterCheckOrch::getInstance(m_configDb));

if (WarmStart::isWarmStart())
{
warmRestoreAndSyncUp();
}

return true;
}

Expand All @@ -285,8 +289,6 @@ void OrchDaemon::start()
{
SWSS_LOG_ENTER();

warmRestoreAndSyncUp();

for (Orch *o : m_orchList)
{
m_select->addSelectables(o->getSelectables());
Expand Down Expand Up @@ -336,11 +338,6 @@ void OrchDaemon::start()
*/
void OrchDaemon::warmRestoreAndSyncUp()
{
if (!WarmStart::isWarmStart())
{
return;
}

WarmStart::setWarmStartState("orchagent", WarmStart::INIT);

for (Orch *o : m_orchList)
Expand Down Expand Up @@ -372,7 +369,6 @@ void OrchDaemon::warmRestoreAndSyncUp()
warmRestoreValidation();

SWSS_LOG_NOTICE("Orchagent state restore done");
syncd_apply_view();

/* TODO: perform port and fdb state sync up*/

Expand Down

0 comments on commit d7bd94f

Please sign in to comment.