From cbfcc7699cecbd76c6b8bd4f6aa049183e8c99b5 Mon Sep 17 00:00:00 2001 From: bingwang Date: Tue, 10 Nov 2020 09:13:33 +0000 Subject: [PATCH] Add a check for warm-restart, and do a clear only when warm-restart is enable. This commit is to address the issue that the NEIGH_TABLE loaded by swssconfig after fast-reboot is cleared by neighsyncd. Signed-off-by: bingwang --- warmrestart/warmRestartAssist.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/warmrestart/warmRestartAssist.cpp b/warmrestart/warmRestartAssist.cpp index 2a02e5ec95..ca19398577 100644 --- a/warmrestart/warmRestartAssist.cpp +++ b/warmrestart/warmRestartAssist.cpp @@ -79,7 +79,10 @@ void AppRestartAssist::registerAppTable(const std::string &tableName, ProducerSt m_psTables[tableName] = psTable; // Clear the producerstate table to make sure no pending data for the AppTable - psTable->clear(); + if (m_warmStartInProgress) + { + psTable->clear(); + } m_appTables[tableName] = new Table(m_pipeLine, tableName, false); } @@ -150,7 +153,7 @@ void AppRestartAssist::readTablesToMap() } return; } - + /* * Check and insert to CacheMap Logic: * if delete_key: