hamgrd: ignore DPU HA set/scope state deletion messages#206
Merged
vivekrnv merged 1 commit intoJul 10, 2026
Merged
Conversation
get_dpu_ha_set_state and get_dpu_ha_scope_state now return None when the incoming DASH_HA_SET_STATE / DASH_HA_SCOPE_STATE message is a KeyOperation::Del, so deletion notifications are ignored instead of being treated as (empty) state updates. Signed-off-by: BYGX-wcr <wcr@live.cn>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Fixes a hamgrd edge case where DASH_HA_SET_STATE / DASH_HA_SCOPE_STATE deletion notifications (which carry empty field values) could be misinterpreted as empty state updates by adding explicit KeyOperation::Del guards in the DPU state accessors.
Changes:
- Skip
DASH_HA_SET_STATEmessages whoseKeyOpFieldValues.operationisDel(log at debug, returnNone). - Skip
DASH_HA_SCOPE_STATEmessages whoseKeyOpFieldValues.operationisDel(log at debug, returnNone).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/hamgrd/src/actors/ha_set.rs | Ignore DASH_HA_SET_STATE delete notifications before deserializing empty field values into a state update. |
| crates/hamgrd/src/actors/ha_scope/base.rs | Ignore DASH_HA_SCOPE_STATE delete notifications before deserializing empty field values into a state update. |
vivekrnv
approved these changes
Jul 9, 2026
Contributor
|
Ran the test and didn't observe any failures |
|
Cherry-pick PR to 202605: #207 |
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
get_dpu_ha_set_stateandget_dpu_ha_scope_statepreviously deserialized every incomingDASH_HA_SET_STATE/DASH_HA_SCOPE_STATEmessage regardless of the DB operation. ADelmessage carries empty field values, so it could be misinterpreted as an (empty) state update rather than being ignored.This PR adds an explicit
KeyOperation::Delcheck to both accessors so deletion notifications are logged at debug level and skipped (returningNone), which causes the callers to ignore them.Type of change
Fix Bug: [HA] hamgrd logs deserialization errors for HA state delete messages without last_updated_time sonic-buildimage#28162
Approach
How it works: Both accessor functions now inspect
kfv.operationafter deserializing theKeyOpFieldValues. When the operation isKeyOperation::Del, they returnNoneearly instead of attempting to deserialize the (empty) field values.How it was verified:
cargo test -p hamgrd— all 41 unit tests pass, including the ha_set and ha_scope NPU/DPU suites.