[ 
https://issues.apache.org/jira/browse/YUNIKORN-3442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Manikandan R resolved YUNIKORN-3442.
------------------------------------
    Fix Version/s: 1.11.0
       Resolution: Fixed

> [Core] Preemptor ask may never be scheduled when encountering pod 
> anti-affinity
> -------------------------------------------------------------------------------
>
>                 Key: YUNIKORN-3442
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-3442
>             Project: Apache YuniKorn
>          Issue Type: Bug
>          Components: core - scheduler
>    Affects Versions: 1.6.0
>            Reporter: Hedger Lai
>            Assignee: Hedger Lai
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.11.0
>
>
> h3. Problem
> When preemption is triggered, the K8s shim evaluates predicate plugins (such 
> as PodAntiAffinity or TopologySpreadConstraints) and returns a specific list 
> of victim pods that must be removed for the preemptor to fit on the node.
> However, in Core's {{TryPreemption()}} 
> ({{pkg/scheduler/objects/preemption.go#L650-L663}}), the scheduler does not 
> honor this finalized victim list. Instead, it iterates through the victims 
> and only collects allocations that contribute to unsatisfied resource 
> dimensions of the ask:
> {code:go}
> for k, needVal := range p.ask.GetAllocatedResource().Resources {
>     if victimsTotalResource.Resources[k] < needVal && allocRes.Resources[k] > 
> 0 {
>         finalVictims = append(finalVictims, victim)
>         victimsTotalResource.AddTo(allocRes)
>         break
>     }
> }
> {code}
> h3. Impact
> This secondary resource-based filtering breaks predicate guarantees.
> Once the ask's CPU/memory demands are satisfied by earlier victims, any 
> subsequent victim selected by the Shim solely to resolve a PodAntiAffinity 
> constraint is silently dropped by the Core.
> As a result:
> # Innocent victims are evicted unnecessarily without allowing the preemptor 
> to schedule.
> # The preemptor still fails predicate checks in subsequent scheduling cycles 
> because the anti-affinity culprit pod remains on the node.
> # Preemption triggers repeatedly for the same ask, leading to victim eviction 
> churn and preemption livelock.
> h3. Proposed Fix
> Core's {{TryPreemption()}} should respect the victim list finalized by the 
> Shim for the target node and avoid secondary resource-based truncation, 
> ensuring predicate conditions verified by the Shim remain intact.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to