sidecar: remove assert in sidecar node creation flow (#4044) - #4101
sidecar: remove assert in sidecar node creation flow (#4044)#4101babayet2 wants to merge 1 commit into
Conversation
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
There was a problem hiding this comment.
Pull request overview
This PR backports #4044 to relax assumptions in the sidecar client initialization so sidecar nodes can have non-zero base CPU ranges without triggering an assertion.
Changes:
- Removed the CPU base contiguity assertion during sidecar node discovery/initialization.
- Allows sidecar nodes whose
base_cpudoes not begin at CPU 0.
| Err(err) => return Err(err), | ||
| }; | ||
| assert_eq!(node.cpus.start, expected_base); | ||
| expected_base = node.cpus.end; |
8550264 to
4d58b19
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
openhcl/sidecar_client/src/lib.rs:153
- After removing the contiguity assert,
expected_baseis now never read. This will trigger an unused-variable warning (and may fail CI if warnings are denied). Either remove it entirely, or rename it to_expected_baseif it’s intentionally kept for future use.
}
Err(err) => return Err(err),
};
if node.cpus.start > expected_base {
tracing::info!(
The sidecar client initialization flow assumes that sidecar nodes are contiguous, and that the nodes' CPU range begin at CPU 0. This does not always hold; in scale tests in which we stress the IO path, most VPs need a full linux kernel, and the CPU range for the first sidecar client in nonzero. This PR removes the assert.
4d58b19 to
cf02031
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
openhcl/sidecar_client/src/lib.rs:156
- The new gap log message is misleading: this loop cannot “skip earlier node(s)” because
SidecarNode::newstops iteration at the first missing/dev/mshv_vtl_sidecar{node}. Also, after removing theassert_eq!, a node withcpus.start < expected_base(overlap / out-of-order range) would be silently accepted and could cause incorrect CPU->node mapping later. Consider treatingstart < expected_baseas an InvalidData error, and adjust the log text to describe a CPU-index gap (not skipped nodes).
if node.cpus.start > expected_base {
tracing::info!(
node = nodes.len(),
gap_start = expected_base,
gap_end = node.cpus.start,
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
openhcl/sidecar_client/src/lib.rs:161
- With the contiguous-CPU assert removed, an out-of-order/overlapping CPU layout (node.cpus.start < expected_base) would now pass silently, and the
expected_base = node.cpus.endupdate could move backwards and hide a real layout issue. Consider explicitly warning on overlaps/out-of-order layouts and keepingexpected_basemonotonic. Also, the current info message says "earlier node(s) skipped" but the condition is a CPU-range gap (including before the first node), so the wording is inaccurate in the nonzero-base scenario described in the PR.
"sidecar node follows a gap; earlier node(s) skipped (no sidecar-started APs)"
);
}
expected_base = node.cpus.end;
nodes.push(node);
Backport of #4044
The sidecar client initialization flow assumes that sidecar nodes are contiguous, and that the nodes' CPU range begin at CPU 0. This does not always hold; in scale tests in which we stress the IO path, most VPs need a full linux kernel, and the CPU range for the first sidecar client in nonzero.
This PR removes the assert.