feat(fault-remediation): keep the repair within the device of a partial drain #2510
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2510"
general
weight: 0.35
KaivalyaMDabhadkar
Summary
Part of #2247. This is the second part of ADR-071 (#2417): the [scope check](docs/designs/071-device-scope-from-configuration.md#scope-check) in fault-remediation (decision 3). It depends on #2477 and targets its branch, so the diff shows only this change. It should merge in the same release as #2477, because #2477 lets a custom action get a partial drain.
A partial drain evicts only the pods that use one device. If fault-remediation then runs an action on the full node, such as a reboot, or on another device, it stops pods that were not drained. Today nothing prevents this. This PR checks it at install and at run time.
Changes
partialRemediationEntityTypes, which the chart renders fromglobal.partialRemediationEntityTypes. It fails to start without the key, as node-drainer does after #2477.impactedEntityScopemust name a configured entity type, instead of one in the built-in GPU list.scopedActionsneeds amaintenance.actionsentry with the sameimpactedEntityScope. The chart also rejects animpactedEntityScopethat is not a configured entity type.DrainDecision.scope). If the drain was partial and the action acts on the full node, on another entity type or on another device, fault-remediation creates no CR and records no decision. It logs both scopes, incrementsfault_remediation_processing_errors_totalwitherror_type="drain_scope_mismatch", and retries the event with backoff. If the node was deleted, it closes the event like the other events of a deleted node, because no configuration fix can help. A full drain, and an event without a drain decision, are not checked.Behaviour changes
COMPONENT_RESETtoRebootNode, fails to upgrade. ADR-071 lists this as a consequence: that configuration reboots nodes after a partial drain today. Partial drains are off by default.GPU_UUIDentity of an event and node-drainer picks the first. For an event with two GPUs, the event now retries instead of resetting a GPU whose pods were not drained.Testing
helm templatewith partial drains on and the chart default (COMPONENT_RESETmapped toRebootNode) fails with the new message. WithCOMPONENT_RESETmapped to aGPUResetwithimpactedEntityScope: GPU_UUID, it renders.GPU_UUIDentry of the chart default.On a local Kind cluster deployed with Tilt from commit 535cb17c, before the merge of #2477's branch and before the deleted-node change:
TestGPUResetpasses. ACOMPONENT_RESETevent on a GPU UUID gets a partial drain, and fault-remediation creates aGPUResetCR for that GPU, which completes.TestNodeDrainerPartialDrainpasses, including the event whose GPU pods were already drained, which goes on to remediation.impactedEntityScoperemoved fromCOMPONENT_RESETin the live fault-remediation ConfigMap, the same event gets its partial drain, and fault-remediation creates no CR. The node keeps thedrain-succeededlabel,fault_remediation_processing_errors_total{error_type="drain_scope_mismatch"}increases with each retry, and the log names both scopes. After the ConfigMap is restored, the retry creates theGPUResetCR for the same event, scoped to the GPU UUID, and the node is uncordoned after the healthy event.Type of Change
Component(s) Affected
Checklist
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Added configurable per-device remediation scopes for supported actions, including GPU UUIDs and other configured entity types.
Remediation now checks whether a partial drain covers an action’s target device before proceeding. Uncovered actions on existing nodes are retried without creating a remediation resource.
Bug Fixes
Chart installation or upgrade now reports configuration errors when scoped actions lack a matching remediation scope or reference an unconfigured entity type.
Documentation
* Expanded guidance on configuring device-scoped remediation and how chart validation and runtime handling work.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->