Skip to content

[release-1.14] fix: fall back minAvailable to replicas when partition minPartitions is omitted - #5459

Merged
volcano-sh-bot merged 2 commits into
release-1.14from
copilot/release-114-fix-fall-back-minavailable
Jun 18, 2026
Merged

[release-1.14] fix: fall back minAvailable to replicas when partition minPartitions is omitted#5459
volcano-sh-bot merged 2 commits into
release-1.14from
copilot/release-114-fix-fall-back-minavailable

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Manual cherry-pick of #5402 to release-1.14 (automated cherry-pick failed due to test struct differences).

When PartitionPolicy is set but MinPartitions is omitted (defaults to 0), the mutate webhook computed MinAvailable = 0 * PartitionSize = 0, silently dropping the task's gang scheduling guarantee. The validate webhook then rejected the corrected value because 0 != MinAvailable.

Changes

  • mutate_job.go — Gate partition-derived MinAvailable on MinPartitions > 0; otherwise fall back to Replicas
  • admit_job.go — Skip MinAvailable == MinPartitions*PartitionSize validation when MinPartitions is 0
  • mutate_job_test.go — Fix existing expectation (MinAvailable = 1 not 0) and add regression test
  • admit_job_test.go — Add regression test (adapted to release-1.14 test struct which lacks PodLevelResourcesEnabled)
// Before: MinPartitions=0 yields MinAvailable=0
if tasks[index].PartitionPolicy != nil {
    minAvailable := tasks[index].PartitionPolicy.MinPartitions * tasks[index].PartitionPolicy.PartitionSize

// After: only use partition math when MinPartitions is explicitly set
if tasks[index].PartitionPolicy != nil && tasks[index].PartitionPolicy.MinPartitions > 0 {
    minAvailable := tasks[index].PartitionPolicy.MinPartitions * tasks[index].PartitionPolicy.PartitionSize

@volcano-sh-bot volcano-sh-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 16, 2026
@volcano-sh-bot volcano-sh-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 16, 2026
Copilot AI changed the title [WIP] Fix fall back minAvailable to replicas when partition minPartitions is omitted [release-1.14] fix: fall back minAvailable to replicas when partition minPartitions is omitted Jun 16, 2026
Copilot AI requested a review from JesseStutler June 16, 2026 11:46
@JesseStutler
JesseStutler marked this pull request as ready for review June 16, 2026 12:13
@volcano-sh-bot volcano-sh-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 16, 2026
@JesseStutler

Copy link
Copy Markdown
Member

/approve
/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 18, 2026
@volcano-sh-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JesseStutler

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 18, 2026
@volcano-sh-bot
volcano-sh-bot merged commit 3b72e24 into release-1.14 Jun 18, 2026
20 of 28 checks passed
@JesseStutler
JesseStutler deleted the copilot/release-114-fix-fall-back-minavailable branch July 14, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[release-1.14] fix: fall back minAvailable to replicas when partition minPartitions is omitted

3 participants