Fix lldp_syncd force-repopulate cascade on high-scale systems#80
Closed
ZhaohuiS wants to merge 2 commits intosonic-net:masterfrom
Closed
Fix lldp_syncd force-repopulate cascade on high-scale systems#80ZhaohuiS wants to merge 2 commits intosonic-net:masterfrom
ZhaohuiS wants to merge 2 commits intosonic-net:masterfrom
Conversation
When new or deleted LLDP neighbors were detected, lldp_syncd's sync() method force-repopulated ALL changed interfaces (delete+re-add in APP_DB), bypassing the is_only_time_mark_modified optimization. On high-scale systems (500+ ports), this caused a cascading repopulation storm during LLDP convergence: new neighbors arriving each 10-second sync cycle triggered force-repopulate of all existing entries, resulting in continuous LLDP table churn that never stabilizes. This change removes the if/else branching based on new/deleted presence and always applies incremental updates for changed interfaces. New and deleted interfaces are still handled correctly. Tested on Mellanox SN5640 (512 ports, 200+ VM LLDP neighbors): - Before fix: 125 deletes, 3412+ force repopulates, never stable - After fix: 0 deletes, 0 unnecessary repopulates, stable in 3.5 min Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
The previous fix (PR sonic-net#71) force-repopulated ALL changed interfaces when new/deleted interfaces existed, to handle the case where APPL_DB was flushed externally but the daemon cache still had full data. However, on high-scale systems (500+ ports), this caused a cascading repopulation storm during LLDP convergence (issue sonic-buildimage#26568). Instead of using new/deleted as a proxy for APPL_DB staleness, verify APPL_DB completeness per-interface: check exists() + get_all() before using the time_mark-only optimization. If APPL_DB is missing or has only one field (stale), do full repopulate. This handles both: 1. APPL_DB flush scenario (PR sonic-net#71): entry missing -> full hmset 2. High-scale convergence (#26568): entry complete -> just time_mark Also fix mock set() to properly emulate Redis HSET (update one field instead of replacing entire hash), and add regression tests for both scenarios. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
DUT Verification - Combined Fix on SN5640 (512 ports)DUT: str5-sn5640-6 (Mellanox-SN5640-C512S2, t0-isolated-d256u256s2) Convergence Pattern (monotonic, NO oscillation)Syslog Event Counts
Key Findings
Comparison: Before vs After
Tested by: @ZhaohuiS |
Contributor
Author
|
Fix lldp issue for high scale testbed by sonic-net/sonic-buildimage#26873 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix LLDP neighbor table instability on high-scale systems (500+ ports) while preserving APPL_DB flush recovery.
Problem 1 (PR #71 scenario): When APPL_DB is flushed externally (e.g. orchagent restart), lldp_syncd's in-memory cache still has full data. For interfaces like eth0 that stay up, is_only_time_mark_modified() returns True, so only lldp_rem_time_mark gets written - leaving APPL_DB incomplete.
Problem 2 (issue #26568): PR #71 fixed this by force-repopulating ALL changed interfaces when new or deleted interfaces exist. But on high-scale systems (SN5640, 512 ports) with VM topology, new neighbors arrive every 10s sync cycle during convergence. This triggers force-repopulate every cycle - cascading storm (3412+ force repopulates, 125 deletes, table never stabilizes).
Root cause: Using new or deleted as a proxy for APPL_DB might be stale is too broad - it fires every cycle during normal convergence.
Instead of branching on new or deleted, verify APPL_DB completeness per-interface before using the time_mark-only shortcut:
This handles both scenarios:
Also fixes mock set() to properly emulate Redis HSET (update one field, not replace entire hash), and adds regression tests for both scenarios.
Verified on DUT str5-sn5640-6 (Mellanox SN5640, 512 ports, VM topology t0-isolated-d256u256s2):
New unit tests:
test_appl_db_flush_repopulates_changed_interfaces - PR [lldp]Fix the issue of only one field lldp_rem_time_mark in APPL_DB #71 regression
test_no_cascade_when_new_and_changed_coexist - issue #26568 regression
Microsoft work item
30233240