Skip to content

Commit d7bd94f

Browse files
authored
Init OrchDaemon with optional warm starting (sonic-net#587)
1 parent 9f645e5 commit d7bd94f

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

orchagent/main.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,7 @@ int main(int argc, char **argv)
281281
exit(EXIT_FAILURE);
282282
}
283283

284-
if (!WarmStart::isWarmStart())
285-
{
286-
syncd_apply_view();
287-
}
284+
syncd_apply_view();
288285

289286
orchDaemon->start();
290287
}

orchagent/orchdaemon.cpp

+5-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ using namespace swss;
1717

1818
extern sai_switch_api_t* sai_switch_api;
1919
extern sai_object_id_t gSwitchId;
20-
extern void syncd_apply_view();
2120
/*
2221
* Global orch daemon variables
2322
*/
@@ -263,6 +262,11 @@ bool OrchDaemon::init()
263262

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

265+
if (WarmStart::isWarmStart())
266+
{
267+
warmRestoreAndSyncUp();
268+
}
269+
266270
return true;
267271
}
268272

@@ -285,8 +289,6 @@ void OrchDaemon::start()
285289
{
286290
SWSS_LOG_ENTER();
287291

288-
warmRestoreAndSyncUp();
289-
290292
for (Orch *o : m_orchList)
291293
{
292294
m_select->addSelectables(o->getSelectables());
@@ -336,11 +338,6 @@ void OrchDaemon::start()
336338
*/
337339
void OrchDaemon::warmRestoreAndSyncUp()
338340
{
339-
if (!WarmStart::isWarmStart())
340-
{
341-
return;
342-
}
343-
344341
WarmStart::setWarmStartState("orchagent", WarmStart::INIT);
345342

346343
for (Orch *o : m_orchList)
@@ -372,7 +369,6 @@ void OrchDaemon::warmRestoreAndSyncUp()
372369
warmRestoreValidation();
373370

374371
SWSS_LOG_NOTICE("Orchagent state restore done");
375-
syncd_apply_view();
376372

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

0 commit comments

Comments
 (0)