[lldp] Fix lldp_syncd sync issue after config reload#26533
Open
Sumalatha-G-ML wants to merge 1 commit intosonic-net:masterfrom
Open
[lldp] Fix lldp_syncd sync issue after config reload#26533Sumalatha-G-ML wants to merge 1 commit intosonic-net:masterfrom
Sumalatha-G-ML wants to merge 1 commit intosonic-net:masterfrom
Conversation
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Issue: config reload -f can break lldp_syncd synchronization for LLDP_LOC_CHASSIS table Root Cause: During 'config reload -f', the database is cleared but the lldp container may continue running. lldp_syncd maintains an internal cache and only updates the database when the cached data differs from new data. This causes the LLDP_LOC_CHASSIS table to remain empty after reload when chassis information hasn't changed. Fix: Modified lldp_syncd to check if the database table exists before relying solely on cache comparison. If the table doesn't exist (indicating DB was cleared), the daemon will repopulate it even if the cache hasn't changed. This ensures proper synchronization after config reload operations. Fixes sonic-net#26297 Signed-off-by: Sumalatha G <sumalatha.g@xoriant.com>
af6fdc4 to
e9c8d56
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Issue: config reload -f can break lldp_syncd synchronization for LLDP_LOC_CHASSIS table
Root Cause:
During 'config reload -f', the database is cleared but the lldp container may continue running. lldp_syncd maintains an internal cache and only updates the database when the cached data differs from new data. This causes the LLDP_LOC_CHASSIS table to remain empty after reload when chassis information hasn't changed.
Fix:
Modified lldp_syncd to check if the database table exists before relying solely on cache comparison. If the table doesn't exist (indicating DB was cleared), the daemon will repopulate it even if the cache hasn't changed.
This ensures proper synchronization after config reload operations.
Fixes #26297
Why I did it
Fix #26297: config reload -f leaves LLDP_LOC_CHASSIS table empty because lldp_syncd cache prevents database repopulation.
Work item tracking
How I did it
Added database existence check in lldp_syncd to force repopulation when table is missing after reload:
if chassis_update != self.chassis_cache or not db_table_exists:
# Update database
How to verify it
redis-cli -n 0 HGETALL "LLDP_LOC_CHASSIS" # Check initial state
sudo config reload -f -y # Reload
sleep 30 # Wait
redis-cli -n 0 HGETALL "LLDP_LOC_CHASSIS" # Should be populated
Which release branch to backport (provide reason below if selected)
☑ All active branches (202305, 202311, 202405, 202411, 202505, 202511)
Reason: Critical bug affecting LLDP monitoring after config reload.
Tested branch (Please provide the tested image version)
Description for the changelog
[lldp] Fix LLDP_LOC_CHASSIS not repopulating after config reload -f (#26297)
Link to config_db schema for YANG module changes
N/A