Repository navigation
Conversation
mismithhisler
left a comment
There was a problem hiding this comment.
Hi @eyupcanakman, thanks for the contribution! The detailed description helped provide good background here for my review. Overall looks good with one suggestion.
| // sticky is only supported on dynamic host volumes. Reject it on any static | ||
| // host volume up front, before the per-volume checks below, which can return | ||
| // early for another volume in the same request set. | ||
| for _, req := range h.volumeReqs { |
There was a problem hiding this comment.
Since we're already iterating the volumeReqs below, can we move some of this logic there?
There was a problem hiding this comment.
Done, moved it into the static-volume branch of the loop. I switched the two sticky checks from early returns to continue so the loop still reaches a later volume, otherwise a sticky dynamic volume ahead of the static one in volumeReqs could short-circuit the check.
5d38813 to
869e782
Compare
tgross
left a comment
There was a problem hiding this comment.
HI @eyupcanakman! Sorry about the delayed re-review. I'm working on a bug in this same neck of the woods, so if you're not going to be able to get back to these remarks let me know and I can carry the PR.
sticky is only supported on dynamic host volumes. A sticky request that
resolved to a static host volume passed feasibility checking, so the alloc
was placed and plan apply then failed inserting a claim keyed by the empty
volume ID ("object missing primary index").
Check each host volume request in its own pass so the node is rejected when
any request is infeasible. This also fixes a case where a satisfied sticky
request short-circuited the checks for the other requests in the same group.
869e782 to
682fa5c
Compare
|
Got back to all of these. Reworked the loop into a per-request check, added a changelog entry for the second bug, and made the two tests deterministic. |
sticky is only supported on dynamic host volumes. A sticky request that
resolved to a static host volume passed feasibility checking, so the alloc
was placed and plan apply then failed inserting a claim keyed by the empty
volume ID ("object missing primary index").
Check each host volume request in its own pass so the node is rejected when
any request is infeasible. This also fixes a case where a satisfied sticky
request short-circuited the checks for the other requests in the same group.
sticky is only supported on dynamic host volumes. A sticky request that
resolved to a static host volume passed feasibility checking, so the alloc
was placed and plan apply then failed inserting a claim keyed by the empty
volume ID ("object missing primary index").
Check each host volume request in its own pass so the node is rejected when
any request is infeasible. This also fixes a case where a satisfied sticky
request short-circuited the checks for the other requests in the same group.
Description
Setting
sticky = trueon a static host volume passed feasibility checking, so the scheduler placed the allocation and then failed to apply the plan withTask group volume claim insert failed: object missing primary index. Static host volumes have an empty ID, and the sticky claim is keyed by volume ID, so the claim insert hits an empty primary index. Static and dynamic host volumes share the sametype = "host"jobspec, so the distinction is only known once a node is selected, which is why this can't be caught at job submission.The fix rejects
stickyon a static host volume during feasibility checking, before the allocation is placed. The check runs before the per-volume loop, so a feasible dynamic sticky volume in the same task group can't return early and skip it. A job that setssticky = trueon a static host volume will now fail feasibility with a clear constraint instead of failing the evaluation. Removing thestickyflag restores placement.Testing & Reproduction steps
Added two tests.
TestHostVolumeChecker_StaticStickycovers the feasibility checker directly. Sticky read-write and read-only on a static volume are infeasible, and non-sticky stays feasible.TestServiceSched_JobRegister_StickyStaticHostVolumeruns the service scheduler end to end. Onmainit fails with theobject missing primary indexclaim error, and with the fix the evaluation completes with the allocation left unplaced and the host volume constraint recorded.go test ./scheduler/feasible/ ./scheduler/passes.Links
Fixes #27153
Per @tgross's note on the issue, this can't be caught at job submission because the static/dynamic distinction isn't known until feasibility checking.
Contributor Checklist
.changelog/27153.txt.Changes to Security Controls
No changes to security controls.
This contribution was developed with AI assistance (Claude Code), used to trace the feasibility path and draft the fix and tests.