Skip to content

[action] [PR:75] Add cache for local chassis table#77

Merged
mssonicbld merged 1 commit into
sonic-net:202511from
mssonicbld:cherry/202511/75
Dec 3, 2025
Merged

[action] [PR:75] Add cache for local chassis table#77
mssonicbld merged 1 commit into
sonic-net:202511from
mssonicbld:cherry/202511/75

Conversation

@mssonicbld
Copy link
Copy Markdown

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

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**
@mssonicbld
Copy link
Copy Markdown
Author

Original PR: #75

@mssonicbld
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit fdfad9b into sonic-net:202511 Dec 3, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant