Skip to content

Commit

Permalink
Add a check for warm-restart, and do a clear only when warm-restart i…
Browse files Browse the repository at this point in the history
…s enable. (#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 #5841 and #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.
  • Loading branch information
bingwang-ms authored and abdosi committed Dec 4, 2020
1 parent d097260 commit 17adc13
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions warmrestart/warmRestartAssist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -150,7 +153,7 @@ void AppRestartAssist::readTablesToMap()
}
return;
}

/*
* Check and insert to CacheMap Logic:
* if delete_key:
Expand Down

0 comments on commit 17adc13

Please sign in to comment.