Skip to content

Commit fcb6c9d

Browse files
authored
Add a check for warm-restart, and do a clear only when warm-restart is enable. (sonic-net#1498)
This commit is to address the issue that the NEIGH_TABLE loaded by swssconfig after fast-reboot is cleared by neighsyncd. **What I did** Fix sonic-net#5841 and sonic-net#5580 We found that neighbor table loaded by ```swssconfig``` from ```arp.json``` after ```fast-reboot``` is cleared by ```neighsyncd``` mistakenly at the initial stage. This PR adds a check for ```WarmStart``` before cleaning up, and only do that if ```WarmStart``` is enable. **Why I did it** This PR is to fix the issue that arp table is not recovered after fast-reboot. **How I verified it** Verified on Arista-7260, running 201911 image. 1. Run some test to populate ARP entries on DUT, such as ```test_fast_reboot``` 2. Issue a fast-reboot 3. Verify the ```arp.json``` backed up by ```fast-reboot-dump.py``` is loaded and NEIGH_TABLE is restored.
1 parent 7a92100 commit fcb6c9d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

warmrestart/warmRestartAssist.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ void AppRestartAssist::registerAppTable(const std::string &tableName, ProducerSt
7979
m_psTables[tableName] = psTable;
8080

8181
// Clear the producerstate table to make sure no pending data for the AppTable
82-
psTable->clear();
82+
if (m_warmStartInProgress)
83+
{
84+
psTable->clear();
85+
}
8386
m_appTables[tableName] = new Table(m_pipeLine, tableName, false);
8487
}
8588

@@ -150,7 +153,7 @@ void AppRestartAssist::readTablesToMap()
150153
}
151154
return;
152155
}
153-
156+
154157
/*
155158
* Check and insert to CacheMap Logic:
156159
* if delete_key:

0 commit comments

Comments
 (0)