Hedger Lai created YUNIKORN-3464:
------------------------------------
Summary: [k8shim] PreemptionFilter fails for affinity and topology
predicates due to stale CycleState
Key: YUNIKORN-3464
URL: https://issues.apache.org/jira/browse/YUNIKORN-3464
Project: Apache YuniKorn
Issue Type: Bug
Components: shim - kubernetes
Affects Versions: 1.6.0
Reporter: Hedger Lai
Assignee: Hedger Lai
h3. Problem
In {{PreemptionFilter()}}, removing candidate victim pods from {{NodeInfo}}
fails to clear predicate violations for plugins that rely on {{CycleState}}
(such as {{InterPodAffinity}} and {{PodTopologySpread}}), causing preemption to
falsely fail and return -1 even when all conflicting pods are removed.
h3. Root Cause
Kubernetes affinity/topology plugins check counters cached in {{CycleState}}
rather than inspecting {{NodeInfo}}:
{code:go}
//
k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go
if state.antiAffinityCounts[tp] > 0 {
return false // rejects node because CycleState counter was never
decremented
}
{code}
In {{PreemptionFilter()}}, {{cycleState}} is passed without cloning, and
{{PreFilterExtensions.RemovePod()}} is never invoked when victims are
tentatively removed from {{NodeInfo}}. Consequently, {{CycleState}} retains
stale positive counters, and {{Filter()}} unconditionally rejects the node.
h3. Fix
1. Clone {{CycleState}} at the start of {{PreemptionFilter()}} to isolate
tentative mutations.
2. Invoke {{ext.RemovePod()}} and {{ext.AddPod()}} on active
{{PreFilterExtensions}} plugins when candidate victims are tentatively removed
or restored.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]