Repository navigation
Add priority preemption cascade problem - #821
Conversation
|
@thromel Thanks for the PR! I will review it soon. |
|
@thromel It looks like another contributor opened an RFC for this exact problem 3 days ago(#795). Since they've completed their eval task and haven't started implementation of the fault yet, there's no wasted effort on either side. That said, please do a quick check for open issues/PRs before creating a new one. With so many people actively implementing faults right now, duplicate efforts can be really unfortunate :) Thanks! |
@Saadmrp1038 Thanks for the review, and sorry about that. I should have checked for existing RFCs/issues before starting the implementation. Fortunately, it sounds like there wasn't any overlapping implementation work yet, but I'll make sure to do a more thorough check next time to avoid duplicate effort. Thanks for the heads-up! |
Saadmrp1038
left a comment
There was a problem hiding this comment.
@thromel Everything works great! I left some comments below. Mostly minor things.
Ping me after you address them. I will merge the PR.
|
@thromel
From the agent's perspective this seems excessively large and it tries to modify the memory request instead of investigating deeper and finding the priority issue. Can we do something about it? Maybe deploy some padding pods (with believable framing and each taking 8Gi/16Gi memory) in some namespace to request memory in reasonable amount. Then allocate realistic amount of memory to If there's some other way to achieve this that's also okay. |
|
Good catch. I pushed a fix in dcfb4b9: |
|
@Saadmrp1038 I addressed the review comments, please check again |
|
@thromel so fast! Thank you. Checking again. |
|
@thromel Thanks for adressing my comments so fast! Looks great now. |
|
@thromel Are you in our slack channel? I can't seem to find you. |
* Add priority preemption cascade problem * Harden priority preemption cascade injection * Tighten priority preemption cascade validation * Address priority preemption review comments * Keep priority preemption sizing realistic --------- Co-authored-by: Saad Mohammad Rafid Pial <[email protected]>
* Add priority preemption cascade problem * Harden priority preemption cascade injection * Tighten priority preemption cascade validation * Address priority preemption review comments * Keep priority preemption sizing realistic --------- Co-authored-by: Saad Mohammad Rafid Pial <[email protected]>
Summary
This PR adds
priority_preemption_cascade_hotel_reservation, a Hotel Reservation benchmark problem based on Grafana Labs' Kubernetes Pod Priorities outage in Hosted Prometheus.The failure is a scheduler-policy bug. A tenant workload gets a medium PriorityClass, preempts an existing production pod with priority 0, and then blocks the replacement production pod from reclaiming capacity because the replacement inherits the same unsafe default priority. The visible symptom is an under-replicated
reservationservice, but the root cause is PriorityClass policy and scheduler preemption.Real-world failure story
Grafana's incident writeup describes a Cortex rollout where new ingesters had medium priority while existing production ingesters had no priority. Under node pressure, Kubernetes preempted the existing ingesters for the new workload. Replacement production pods then had the wrong priority relationship and could not recover the cluster cleanly.
Related links:
Fault model
The problem starts from a normal Hotel Reservation deployment, then makes the scheduler state explicit:
reservationgets a capped memory request while its running pod still has priority 0.reservationis pinned to the selected pressure node so its replacement cannot escape to another worker.platform-mediumis created withglobalDefault: true. This is the bad platform policy.production-criticalis created with a higher value, but it is not applied toreservationduring injection.platform-medium, soreservationis the intended preemption victim.analytics-batch/report-cache-shard-*padding workloads are pinned to the same node with 8Gi or 16Gi memory requests and the sameplatform-mediumpriority as the tenant workload. They make large-memory nodes look like a busy cluster without makingreservationor the tenant request hundreds of GiB.analytics-batch/tenant-ingesteris pinned to the same node asreservationand requests enough memory that it can only schedule by preempting the lower-priorityreservationpod.The injector waits for actual evidence: the tenant workload is ready,
reservationis unavailable, a scheduler preemption event exists, and the replacementreservationpod has inheritedplatform-medium.What reviewers should see at runtime
When the fault is active:
analytics-batch/tenant-ingesteris Running on the target node.analytics-batch/report-cache-shard-*pods are Running on the same node withplatform-mediumpriority and 8Gi or 16Gi requests.reservationis under-replicated or unavailable.platform-mediumexists and is stillglobalDefault: true.production-criticalexists but is not applied to thereservationdeployment template.Useful checks:
A good diagnosis should avoid app-level explanations like bad image, broken service selector, DNS, or reservation code. The useful evidence is in scheduler events, pod priorities, and node memory requests.
Expected mitigation
The intended fix is to repair the priority policy while keeping the tenant workload present:
platform-mediumno longer the global default;deployment/reservationwith a PriorityClass whose value is higher thanplatform-medium;production-criticalfor that protection, or use another explicit higher-valued class such asreservation-high-priority;reservationrollout recover and regain ready endpoints.The mitigation oracle rejects shortcuts that would make a generic health check pass while missing the fault:
analytics-batch/tenant-ingester;Code changes
sregym/conductor/problems/priority_preemption_cascade.py: problem definition, scheduler setup, realistic request sizing, capacity padding, preemption evidence checks, and cleanup for app templates plus PriorityClasses.sregym/conductor/oracles/priority_preemption_mitigation.py: mitigation oracle for policy recovery and shortcut rejection.sregym/conductor/problems/registry.py: registerspriority_preemption_cascade_hotel_reservation.Problem List.md: adds the new problem entry.tests/problems/test_priority_preemption_cascade.pyandtests/oracles/test_priority_preemption_mitigation.py: focused coverage for injection assertions, padding behavior, cleanup, and oracle checks.No new Python dependencies or RBAC changes are included.
Validation
Requested CI validation:
Local checks run after the latest linked-comment fix:
The focused unit suite passed with 29 tests.
A targeted local lifecycle on
kind-sregym-calico-spikealso passed before the latest review-fix commits: app deploy, fault injection, oracle failure while the fault was active, recovery, oracle success after mitigation, and cleanup of app namespace, tenant namespace, PriorityClasses, and Hotel Reservation PVs.No agent-run result is claimed here. The evidence for this PR is the lifecycle validation and the scheduler state described above.