[action] [PR:75] Add cache for local chassis table#77
Merged
Conversation
Previously Every sync cycle (every 10 seconds by default) would unconditionally: Delete the LLDP_LOC_CHASSIS table from Redis Write all chassis attributes back to Redis for the LLDP_LOC_CHASSIS table, This leads to race conditions, since there is a possibility to perform an snmp query at the same time leading to missing data: `2025 Oct 19 00:41:14.530572 sonic WARNING snmp#snmp-subagent [sonic_ax_impl] WARNING: Missing lldp_loc_man_addr from APPL DB` The change which is done compares new chassis data with the cached version Only performs DB operations (delete + set) if data has actually changed Skips all DB writes when chassis data is unchanged Unit test: ``` tests/test_lldpSyncDaemon.py::TestLldpSyncDaemon::test_chassis_cache_no_db_calls_when_unchanged PASSED [ 21%] ``` **Required for 202505 branch**
Author
|
Original PR: #75 |
Author
|
/azp run |
|
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.
Previously Every sync cycle (every 10 seconds by default) would unconditionally:
Delete the LLDP_LOC_CHASSIS table from Redis
Write all chassis attributes back to Redis for the LLDP_LOC_CHASSIS table,
This leads to race conditions, since there is a possibility to perform an snmp query at the same time leading to missing data:
2025 Oct 19 00:41:14.530572 sonic WARNING snmp#snmp-subagent [sonic_ax_impl] WARNING: Missing lldp_loc_man_addr from APPL DBThe change which is done compares new chassis data with the cached version
Only performs DB operations (delete + set) if data has actually changed
Skips all DB writes when chassis data is unchanged
Unit test:
Required for 202505 branch