Skip to content

Commit

Permalink
Orchagent warm restart data restore requires three iterations (#670)
Browse files Browse the repository at this point in the history
Signed-off-by: Jipan Yang <[email protected]>
  • Loading branch information
jipanyang authored and lguohan committed Nov 2, 2018
1 parent 15a2299 commit 5796e54
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions orchagent/orchdaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,19 +409,26 @@ bool OrchDaemon::warmRestoreAndSyncUp()
}

/*
* First iteration is to handle all the existing data in predefined order.
*/
for (Orch *o : m_orchList)
{
o->doTask();
}
/*
* Drain remaining data that are out of order like LAG_MEMBER_TABLE and VLAN_MEMBER_TABLE
* since they were checked before LAG_TABLE and VLAN_TABLE.
* Three iterations are needed.
*
* First iteration: Orch(s) which do not have dependency on port table,
* gBufferOrch, gPortsOrch(Port table and VLAN table),
* and orch(s) which have dependency on Port but processed after it.
*
* Second iteration: gBufferOrch (has inter-dependency with gPortsOrch),
* remaining attributes on port table for gPortsOrch,
* gIntfsOrch which has dependency on both gBufferOrch and port table of gPortsOrch.
* LAG_TABLE in gPortsOrch.
*
* Third iteration: Drain remaining data that are out of order like LAG_MEMBER_TABLE and
* VLAN_MEMBER_TABLE since they were checked before LAG_TABLE and VLAN_TABLE within gPortsOrch.
*/
for (Orch *o : m_orchList)
for (auto it = 0; it < 3; it++)
{
o->doTask();
for (Orch *o : m_orchList)
{
o->doTask();
}
}

/*
Expand Down

0 comments on commit 5796e54

Please sign in to comment.