From 5796e544fa490300091d4dd320af0d0f4964e8ae Mon Sep 17 00:00:00 2001 From: Jipan Yang Date: Fri, 2 Nov 2018 11:42:46 -0700 Subject: [PATCH] Orchagent warm restart data restore requires three iterations (#670) Signed-off-by: Jipan Yang --- orchagent/orchdaemon.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/orchagent/orchdaemon.cpp b/orchagent/orchdaemon.cpp index ad4ce3f9e163..f5673dfc1b0d 100644 --- a/orchagent/orchdaemon.cpp +++ b/orchagent/orchdaemon.cpp @@ -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(); + } } /*