Skip to content

Commit 5796e54

Browse files
jipanyanglguohan
authored andcommitted
Orchagent warm restart data restore requires three iterations (sonic-net#670)
Signed-off-by: Jipan Yang <[email protected]>
1 parent 15a2299 commit 5796e54

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

orchagent/orchdaemon.cpp

+18-11
Original file line numberDiff line numberDiff line change
@@ -409,19 +409,26 @@ bool OrchDaemon::warmRestoreAndSyncUp()
409409
}
410410

411411
/*
412-
* First iteration is to handle all the existing data in predefined order.
413-
*/
414-
for (Orch *o : m_orchList)
415-
{
416-
o->doTask();
417-
}
418-
/*
419-
* Drain remaining data that are out of order like LAG_MEMBER_TABLE and VLAN_MEMBER_TABLE
420-
* since they were checked before LAG_TABLE and VLAN_TABLE.
412+
* Three iterations are needed.
413+
*
414+
* First iteration: Orch(s) which do not have dependency on port table,
415+
* gBufferOrch, gPortsOrch(Port table and VLAN table),
416+
* and orch(s) which have dependency on Port but processed after it.
417+
*
418+
* Second iteration: gBufferOrch (has inter-dependency with gPortsOrch),
419+
* remaining attributes on port table for gPortsOrch,
420+
* gIntfsOrch which has dependency on both gBufferOrch and port table of gPortsOrch.
421+
* LAG_TABLE in gPortsOrch.
422+
*
423+
* Third iteration: Drain remaining data that are out of order like LAG_MEMBER_TABLE and
424+
* VLAN_MEMBER_TABLE since they were checked before LAG_TABLE and VLAN_TABLE within gPortsOrch.
421425
*/
422-
for (Orch *o : m_orchList)
426+
for (auto it = 0; it < 3; it++)
423427
{
424-
o->doTask();
428+
for (Orch *o : m_orchList)
429+
{
430+
o->doTask();
431+
}
425432
}
426433

427434
/*

0 commit comments

Comments
 (0)