Fix incorrect default value and incorrect operations ordering in NPU state machine#162
Merged
Merged
Conversation
…ring Signed-off-by: BYGX-wcr <wcr@live.cn>
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
This PR adjusts the NPU-driven HA scope state machine in hamgrd to use a more appropriate default HA state when state is missing/unparseable, and to change the ordering of side effects when entering Active (notably when coming from Standalone) so bulk sync is triggered after activating the DPU role. It also updates the HA scope actor tests to match the new message ordering.
Changes:
- Default missing/invalid NPU local/peer
HaStatevalues toUnspecifiedinstead ofDead. - Reorder
Active-entry side effects so DPU role activation happens before triggering bulk sync when transitioning fromStandalone. - Update HA scope test expectations so
BulkSyncUpdate(finished=true)is observed earlier relative to the DPU table update during pending activation approval.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/hamgrd/src/actors/ha_scope/npu.rs | Adjusts default HaState fallbacks and reorders Active transition side effects (bulk sync vs role activation). |
| crates/hamgrd/src/actors/ha_scope/mod.rs | Updates test message ordering expectations to match the revised state machine behavior. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: BYGX-wcr <wcr@live.cn>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Comment on lines
+1205
to
+1209
| // Bulk sync is triggered after Active role is activated | ||
| if *current_state == HaState::Standalone { | ||
| // If starting from Standalone, do bulk sync | ||
| let _ = self.add_bulk_sync_session(state); | ||
| } |
zjswhhh
approved these changes
May 13, 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.
What I did
Why I did it
This is the correct way.
How I verified it
Details if related