Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YUNIKORN-2795] Handle Preemption cases between two siblings without … #944

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pkg/scheduler/objects/preemption.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package objects

import (
"sort"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -827,6 +828,18 @@ func (qps *QueuePreemptionSnapshot) GetRemainingGuaranteedResource() *resources.
if qps.AskQueue.QueuePath == qps.QueuePath && !remainingGuaranteed.IsEmpty() {
return resources.MergeIfNotPresent(remainingGuaranteed, parent)
}
// Queue (potential victim queue path) being processed currently sharing common ancestors or parent with ask queue should not propagate its
// actual remaining guaranteed to rest of queue's in the queue hierarchy downwards to let them use their own remaining guaranteed only if guaranteed
// has been set. Otherwise, propagating the remaining guaranteed downwards would give wrong perception and those queues might not be chosen
// as victims for sibling ( who is under guaranteed and starving for resources) in the same level.
// Overall, this increases the chance of choosing victims for preemptor from siblings without causing preemption storm or loop.
askQueueRemainingGuaranteed := qps.AskQueue.GuaranteedResource.Clone()
askQueueUsed := qps.AskQueue.AllocatedResource.Clone()
askQueueUsed = resources.SubOnlyExisting(askQueueUsed, qps.AskQueue.PreemptingResource)
askQueueRemainingGuaranteed = resources.SubOnlyExisting(askQueueRemainingGuaranteed, askQueueUsed)
manirajv06 marked this conversation as resolved.
Show resolved Hide resolved
if !remainingGuaranteed.IsEmpty() && strings.HasPrefix(qps.AskQueue.QueuePath, qps.QueuePath) && !askQueueRemainingGuaranteed.IsEmpty() {
return nil
}
}
return resources.ComponentWiseMin(remainingGuaranteed, parent)
}
Expand Down
Loading
Loading