Skip to content

[lldp] Fix lldp_syncd sync issue after config reload#26533

Open
Sumalatha-G-ML wants to merge 1 commit intosonic-net:masterfrom
Sumalatha-G-ML:fix-issue-26297-lldp-reload
Open

[lldp] Fix lldp_syncd sync issue after config reload#26533
Sumalatha-G-ML wants to merge 1 commit intosonic-net:masterfrom
Sumalatha-G-ML:fix-issue-26297-lldp-reload

Conversation

@Sumalatha-G-ML
Copy link
Copy Markdown

@Sumalatha-G-ML Sumalatha-G-ML commented Apr 2, 2026

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
  • Microsoft ADO (number only):

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

@Sumalatha-G-ML Sumalatha-G-ML requested a review from lguohan as a code owner April 2, 2026 12:07
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

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>
@Sumalatha-G-ML Sumalatha-G-ML force-pushed the fix-issue-26297-lldp-reload branch from af6fdc4 to e9c8d56 Compare April 2, 2026 12:23
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: config reload -f can break lldp_syncd sync for LLDP_LOC_CHASSIS

2 participants