Skip to content

Clusterqueues must prefer borrowing within a cohort before borrowing across cohorts. #7016

@varunsyal

Description

@varunsyal

What happened:

When hierarchical cohorts are used with multiple flavors, a clusterqueue should prefer scheduling in the flavor such that borrowing first happens from other clusterqueues within its parent cohort, before borrowing from clusterqueues of other cohorts. However that does not happen with multiple flavors.
Due to this, even when the cohort has nominal quota in the second flavor, it tends to borrow in the first flavor, making the workloads prone to preemption.

What you expected to happen:

If a cohort's usage is below its nominal quota, it should not try to borrow from another cohort in case of multiple flavors. This leads to unnecessary preemptions when the other cohort needs to reclaim it nominal quota

How to reproduce it (as minimally and precisely as possible):

Example:
Total Size of Cluster:

  • Flavor-1 = 10
  • Flavor-2 = 10
Image

If we submit 18 workloads each using resources = 1 to clusterqueue cq-p1, we observe that it schedules 10 workloads in Flavor-1 and 8 workloads in Flavor-2. This makes the cohort-A which has a total nominal quota of 18 in its subtree to be borrowing 2 resources from cohort-B, and thus has a positive fair sharing weighted share, even though its total usage is within its total nominal quota.

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): v1.32.7
  • Kueue version (use git describe --tags --dirty --always): 0.13.4
  • Feature Flag enabled: FlavorFungibilityImplicitPreferenceDefault=True

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions