DRA: refresh node resources after claim changes #829
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 359 lines diff across 4 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.352
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #829"
general
weight: 0.35
askervin
Refreshing node resources after claim changes
Eighth PR of the DRA series, on top of #823. Two commits: resmgr refreshes
the node resources after a claim change, and the
test42-dra-devicese2e testchecks the NodeResourceTopology CR after a claim and after its release.
The NRI path refreshes the NodeResourceTopology CR and the node's extended
resources after every change to the policy's allocations. The claim path did
not, so after a claim was allocated or released both kept what the last NRI
event left them. With topology-aware, the CR then still showed the claimed CPUs
as free.
Now
ClaimAllocatedandClaimReleasedrefresh both, after saving the cacheand updating the containers. A failed refresh is logged, as on the NRI path,
and does not fail the claim: it does not change what the claim was given. A
failed allocation is rolled back through
ClaimReleased, which refreshes then.A small helper,
updateNodeResources(), now does the refresh. It replaces thepaired
updateTopologyZones()/updateNodeExtendedResources()calls on the NRIpath and after a reconfiguration, so there is one list of what gets refreshed.
No policy or interface change is needed: the policy still answers
GetTopologyZonesandGetExtendedResourceswhen resmgr asks.The e2e test
test42-dra-devicesreads theshared cpusetattribute of a NUMA node's zonein the CR. After a claim takes CPUs of a node, the zone must stop listing them.
After the claim is released, it must list them again. The NRI path also
refreshes the CR when the claiming container is created, so the first check is
only a sanity check. No container event follows the release, so the second
check passes only if the claim path refreshes the CR. The test's
cpuset()helper now also accepts an empty string, which is what a zone with no shared
CPUs left reports.
What is not here
These are known limitations, each lifted by a later PR in the series:
but the policy resets its saved state on start, so after the plugin
restarts their CPUs are free again and can be granted twice.
DeviceClassships yet, so a claim needs one written by the user.Verification
go test -race ./...passes, and golangci-lint finds no issues inpkg/resmgr.TestClaimCommitRefreshesNodeResourceschecks that allocating and releasinga claim each refresh the node resources once, and that a failing NRT CR
update does not fail either call. Removing either of the two new calls fails
the test.
test42-dra-devicespasses on n4c16 with Kubernetes 1.37, containerdv2.4.1, and the
DRAConsumableCapacityandDRANodeAllocatableResourcesgates. A claim for 2 CPUs of node 0 got 0-1, the CR dropped 0-1 from the
zone's shared CPUs, and listed them again after the claim was released.