Conversation
Associate each ObjectBulker create result with the request that queued it instead of the returned object ID. This prevents failed preallocated VIDs from being lost when the caller OID is reset to null and keeps unwritten results as NOT_EXECUTED. Pass the next-hop result through NeighborContext so NeighOrch cannot manufacture success from a missing null-OID lookup. Add focused, chunked, and end-to-end regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a41b9f81-e913-42b1-aa01-5cd553b97791 Signed-off-by: Xichen Lin <lukelin0907@gmail.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Preserves per-request bulk-create statuses so failed next-hop creations are not treated as successful.
Changes:
- Adds request-associated status tracking to
ObjectBulker. - Updates
NeighOrchto consume direct next-hop statuses. - Adds bulker, neighbor, and MUX rollback regression tests.
| File | Description |
|---|---|
tests/mock_tests/neighorch_ut.cpp |
Tests failed and unexecuted next-hop handling. |
tests/mock_tests/mux_rollback_ut.cpp |
Tests MUX rollback behavior. |
tests/mock_tests/bulker_ut.cpp |
Tests status propagation scenarios. |
orchagent/neighorch.h |
Initializes next-hop state safely. |
orchagent/neighorch.cpp |
Handles failed and unexecuted next-hop creates. |
orchagent/bulker.h |
Tracks and propagates per-request create statuses. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Added optional per-request create-status output to
ObjectBulkerand associated each bulk result with the request that queued it.NeighborContextnow receives its own next-hop create status, and NeighOrch consumes that status directly instead of looking it up by the returned object ID.The OID-keyed create-status map and
create_status(oid)accessor are removed. Existing callers that do not request a status remain source-compatible.Why I did it
The old status path lost the relationship between a bulk-create request and its result:
ObjectBulkerstored the status under that returned VID, but reset the caller's failed output OID toSAI_NULL_OBJECT_ID.create_status(SAI_NULL_OBJECT_ID).unordered_map::operator[]inserted a zero-initialized value. Numeric zero isSAI_STATUS_SUCCESS.The previous unit mock did not populate returned object IDs. Failed requests therefore appeared under the null key and accidentally hid the production VID-to-null mismatch.
The correction stores the caller's optional status pointer beside each queued request, initializes it to
SAI_STATUS_NOT_EXECUTED, initializes the SAI status array to the same value, and copiesstatuses[i]directly back to requesti. A failed or unwritten next-hop result can no longer become success through an unrelated OID lookup.This change deliberately does not redesign
SAI_STATUS_ITEM_ALREADY_EXISTSbehavior or MUX transition logic.How I verified it
SAI_STATUS_FAILURE, a nonzero returned VID, and per-objectSAI_STATUS_INSUFFICIENT_RESOURCES.hw_configured=true, and incorrect CRM and router-interface reference increments.Details if related
This is an independent ObjectBulker status-integrity correction. Follow-up handling for a trustworthy next-hop
SAI_STATUS_ITEM_ALREADY_EXISTSresult without a recoverable OID is intentionally out of scope.Work item tracking