-
Notifications
You must be signed in to change notification settings - Fork 262
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
Distinguish between Preemption due to reclamation and fair sharing #2411
Distinguish between Preemption due to reclamation and fair sharing #2411
Conversation
Skipping CI for Draft Pull Request. |
/ok-to-test |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
/assign @vladikkuzn @trasc |
45eee46
to
abb03fe
Compare
abb03fe
to
1223f92
Compare
1223f92
to
5e7d6b6
Compare
/cc @alculquicondor |
/assign @gabesaba |
* Rewrite to Targets * Cover CohortFairSharing
3d8d403
to
2f68cca
Compare
2f68cca
to
d15223d
Compare
* Dedicated GetWorkloadReferences function * Extract humanReadablePreemptionReasons * !strategy && belowThreshold -> InCohortReclaimWhileBorrowingReason * ExpectPreemptedCondition test util
d15223d
to
cad0de8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
/hold for nits
I'll leave LGTM to @trasc
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, vladikkuzn The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* Rename WL -> WorkloadInfo * Move getWorkloadReferences to logging
5977741
to
7327a1e
Compare
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only one NIT, otherwise LGTM
* Use slice in getWorkloadReferences
/lgtm |
LGTM label has been added. Git tree hash: 7b96a661745f64e63ec8b9cab6360cf63ea769ae
|
/retest |
/unhold |
log.V(3).Info("Preempted", "targetWorkload", klog.KObj(target.Obj), "reason", reason, "message", message) | ||
p.recorder.Eventf(target.Obj, corev1.EventTypeNormal, "Preempted", message) | ||
metrics.ReportEvictedWorkloads(target.ClusterQueue, kueue.WorkloadEvictedByPreemption) | ||
log.V(3).Info("Preempted", "targetWorkload", klog.KObj(target.WorkloadInfo.Obj), "reason", target.Reason, "message", message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also please add targetClusterQueue
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in #2538
WDYT should I also add preemptor's cluster queue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The preemptor's information is already part of the log (it comes from the scheduler.go file, which adds the fields to the contextual log).
// the function. | ||
allowBorrowing = false | ||
} else { | ||
reason = InCohortReclaimWhileBorrowingReason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bug here.
If allowBorrowingBelowPriority
is nil, then the reason should stay as InCohortReclamationReason
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be more like
if allowBorrowingBelowPriority != nil {
if priority.Priority(candWl.Obj) >= *allowBorrowingBelowPriority {
allowBorrowing = false
} else {
reason = InCohortReclaimWhileBorrowingReason
}
}
It looks like we forgot to change the release notes to match the review changes. /release-note-edit
|
…ubernetes-sigs#2411) * Distinguish between Preemption due to reclamation and fair sharing * Distinguish between Preemption due to reclamation and fair sharing * extract getPreemptionReason * borrowing in favour of reclamation * Distinguish between Preemption due to reclamation and fair sharing * Rewrite to Targets * Cover CohortFairSharing * Distinguish between Preemption due to reclamation and fair sharing * Dedicated GetWorkloadReferences function * Extract humanReadablePreemptionReasons * !strategy && belowThreshold -> InCohortReclaimWhileBorrowingReason * ExpectPreemptedCondition test util * Distinguish between Preemption due to reclamation and fair sharing * Rename WL -> WorkloadInfo * Move getWorkloadReferences to logging * Distinguish between Preemption due to reclamation and fair sharing * Use slice in getWorkloadReferences
What type of PR is this?
/kind feature
What this PR does / why we need it:
Introduces an additional reason in the Preemption condition to indicate that the preemption was due to fair sharing and not regular reclamation.
Which issue(s) this PR fixes:
Fixes #2404
Special notes for your reviewer:
Does this PR introduce a user-facing change?