Binding preemption Design for Karmada scheduler#7327
Binding preemption Design for Karmada scheduler#7327seanlaii wants to merge 1 commit intokarmada-io:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a comprehensive design proposal for binding-level preemption within the Karmada scheduler. The core purpose is to resolve resource contention by allowing higher-priority workloads to preempt lower-priority ones, preventing high-priority tasks from being indefinitely blocked. The proposal outlines a strategic, phased approach, beginning with a foundational summary-based preemption for single-cluster environments and planning for a more advanced estimator-based system in the future. This enhancement significantly improves resource utilization and fairness for critical workloads. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive proposal for binding-level preemption within the Karmada scheduler, specifically for single-cluster scheduling. The feature aims to allow high-priority ResourceBindings to evict lower-priority ones when cluster resources are insufficient. The proposal details a two-phase implementation, starting with summary-based preemption and progressing to estimator-based preemption for more precise victim selection. A review comment suggests enhancing the clarity of eviction messages for victim bindings by including the workload's kind, namespace, and name for better user understanding.
| workv1alpha2.WithMessage(fmt.Sprintf("Preempted by %s/%s (priority=%d)", | ||
| preemptor.Namespace, preemptor.Name, | ||
| preemptor.Spec.SchedulePriority.Priority)), |
There was a problem hiding this comment.
The eviction message for the victim binding could be more informative. Currently, it uses preemptor.Namespace and preemptor.Name, which refer to the ResourceBinding's metadata. This might be confusing for users, as the ResourceBinding name is often generated (e.g., my-app-deployment) and doesn't directly reflect the workload's identity.
To improve clarity, I suggest using the workload's kind, namespace, and name from preemptor.Spec.Resource. This would generate a more user-friendly message like Preempted by Deployment default/my-app (priority=100).
This change should also be reflected in the Observability section's event table for the Preempted event.
| workv1alpha2.WithMessage(fmt.Sprintf("Preempted by %s/%s (priority=%d)", | |
| preemptor.Namespace, preemptor.Name, | |
| preemptor.Spec.SchedulePriority.Priority)), | |
| workv1alpha2.WithMessage(fmt.Sprintf("Preempted by %s %s/%s (priority=%d)", | |
| preemptor.Spec.Resource.Kind, preemptor.Spec.Resource.Namespace, preemptor.Spec.Resource.Name, | |
| preemptor.Spec.SchedulePriority.Priority)), |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7327 +/- ##
=======================================
Coverage 42.02% 42.03%
=======================================
Files 874 874
Lines 53551 53551
=======================================
+ Hits 22505 22509 +4
+ Misses 29354 29351 -3
+ Partials 1692 1691 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: seanlaii <qazwsx0939059006@gmail.com>
a5c9fa3 to
16f153a
Compare
What type of PR is this?
/kind documentation
/kind feature
What this PR does / why we need it:
This PR adds a design proposal for binding-level preemption in the Karmada scheduler.
Currently, priority-based scheduling only orders the queue — a high-priority binding that arrives after cluster resources are consumed by lower-priority bindings remains pending indefinitely. This proposal introduces preemption so the scheduler can evict lower-priority bindings to make room, scoped to single-cluster Divided scheduling in Phase 1 with estimator-based node-level simulation planned for Phase 2.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: