topology-aware: restore DRA claims after a restart #859
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 314 lines diff across 3 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.344
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #859"
general
weight: 0.35
bart0sh
topology-aware forgets its DRA claims when the plugin restarted.
Setup()clears the policy's cache entries, andSync()places every running container again, so containers holding a claim lost its CPUs, and new claims can get them. The kubelet does not prepare a claim again after our restart, so nothing rebuilt a claim once it was gone.Now
Setup()keeps the cache entries and restores the saved claim grants. Container grants are not restored:Sync()allocates every running container again, and finds the claims by then. A container which holds a claim the policy does not know gets a warning in the log.If the new configuration cannot give a claim its CPUs, because they are reserved or no longer available or the pool is gone, the claim gets other CPUs of the same NUMA nodes, and
Sync()moves its containers to them. A claim result is only a number of CPUs of a node, so the kubelet and the scheduler see no change. The claims which keep their CPUs are restored first, so a moved claim cannot take the CPUs of another claim. The start fails only when a node has too few CPUs for a claim. The error names the claim, and the agent writes it into the status of the config CR. Reverting the config lets the plugin start again with the claim restored. A runtime reconfiguration which cannot hold a claim is still refused.Two fixes on the side:
Reserve()took a reserved CPU which is also isolated for the isolated part of a claim, which also affected runtime reconfiguration onmain. And the topology-aware policy tests unpacked the sysfs tarball once per test, about 20s each with-race, which made the package hit the 10mgo testtimeout. With one shared copy the package runs in 42s with-race.Testing:
go test -race -count=1 ./...passes with the default 10m timeout.DRAConsumableCapacity, with images built from this branch: test42 (topology-aware, also withDRANodeAllocatableResources) and test01-dra (template) pass. test42 restarts the plugin and checks that running containers keep their claimed CPUs and a new claim gets only free CPUs, that a config which reserves a CPU of a claim moves the claim and its containers to the free CPU of the same node, and that a config which leaves too few CPUs fails the start with the claim named in the config status. test01-dra restarts template with fewer allowed CPUs: the claim keeps its CPUs with a warning, and a new claim does not get them.