swss-common-bridge: replay unchanged producer updates - #210
Merged
BYGX-wcr merged 1 commit intoJul 28, 2026
Merged
Conversation
Signed-off-by: BYGX-wcr <wcr@live.cn>
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR fixes a producer-side replay correctness issue in swss-common-bridge where identical producer updates were previously deduplicated and skipped. Because that dedup cache could outlive an external DB state loss (e.g., DPU control-plane reset clearing DASH_HA_SET_TABLE), hamgrd replays of unchanged data would not restore missing entries; the bridge now always applies valid producer requests so external state loss can be recovered.
Changes:
- Removed producer-side
TableCachededuplication so identicalSET/DELrequests are always applied to theProducerTable. - Updated tests to require identical updates to be replayed (including after ZMQ consumer recreation).
- Narrowed
TableCache’s documented purpose to consumer-side merge + duplicate-notification filtering and removed the producer-orientedreplace_kfvAPI.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/swss-common-bridge/src/producer.rs | Always applies producer requests (no dedup) and updates tests to assert identical updates are replayed. |
| crates/swss-common-bridge/src/lib.rs | Updates TableCache docs to consumer-only semantics and removes producer-side replace_kfv dedup method. |
vivekrnv
approved these changes
Jul 28, 2026
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.
Description of PR
Summary:
The producer bridge cached the last update and skipped identical requests. That cache can outlive a DPU control-plane reset, so an HA_SET entry removed from the destination DB was not restored when hamgrd replayed unchanged data. Always apply valid producer requests so replay can recover externally lost DB state. Consumer-side caching remains unchanged.
Fixes: sonic-net/sonic-buildimage#28073
Type of change
Approach
What is the motivation for this PR?
A DPU control-plane reset can clear DASH_HA_SET_TABLE while swss-common-bridge remains running. Replaying the same HA_SET data previously returned "No change in data" without writing it, leaving the destination DB entry missing.
How did you do it?
How did you verify/test it?
cargo fmt --check --allcargo build --workspace --all-featurescargo test -p swss-common-bridge(9 passed)Any platform specific information?
Validated on SONiC SmartSwitch DPU containers using both Redis ProducerStateTable and ZmqProducerStateTable paths.
Documentation
No documentation change is required; this restores producer replay correctness without changing the public interface.