Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA DRA: implement transaction-like clean-up on DRA-related errors in PredicateSnapshot #7786

Open
towca opened this issue Jan 29, 2025 · 0 comments
Labels
area/cluster-autoscaler area/core-autoscaler Denotes an issue that is related to the core autoscaler and is not specific to any provider. wg/device-management Categorizes an issue or PR as relevant to WG Device Management.

Comments

@towca
Copy link
Collaborator

towca commented Jan 29, 2025

Which component are you using?:

/area cluster-autoscaler
/area core-autoscaler
/wg device-management

Is your feature request designed to solve a problem? If so describe the problem this feature should solve.:

PredicateSnapshot methods like AddNodeInfo() or SchedulePod() can fail because of DRA-related issues, but don't always clean up the partial DRA snapshot modifications that happened prior to the error. This shouldn't be an issue for the MVP implementation because these errors would mean aborting the whole loop anyway (see #7784), and the snapshot would be recreated from scratch in the next loop. It will be an issue if we want to proceed with the loop when seeing these errors though, so it should probably be tackled together with #7530.

Describe the solution you'd like.:

The most obvious solution would probably be to add clean-up defers to PredicateSnapshot methods, and use dynamicresources.Snapshot methods to reverse already performed actions. One caveat here is that ResourceClaim allocations are made by the DRA scheduler plugin code, so they aren't easily reversible from within PredicateSnapshot (we don't know what to reverse). We could solve that by having snapshotClaimTracker.SignalClaimPendingAllocation() save the modification to some intermediate place that can be rolled back, instead of just directly modifying the claim in the DRA snapshot. Then PredicateSnapshot could just call something like dynamicresources.Snapshot.RollBackLastClaimAllocations().

Additional context.:

This is a part of Dynamic Resource Allocation (DRA) support in Cluster Autoscaler. An MVP of the support was implemented in #7530 (with the whole implementation tracked in kubernetes/kubernetes#118612). There are a number of post-MVP follow-ups to be addressed before DRA autoscaling is ready for production use - this is one of them.

@k8s-ci-robot k8s-ci-robot added area/cluster-autoscaler area/core-autoscaler Denotes an issue that is related to the core autoscaler and is not specific to any provider. wg/device-management Categorizes an issue or PR as relevant to WG Device Management. labels Jan 29, 2025
@mbrow137 mbrow137 moved this from 🆕 New to 🏗 In Progress in SIG Autoscaler: Dynamic Resource Allocation Feb 4, 2025
@mbrow137 mbrow137 moved this from 🏗 In Progress to 🆕 New in SIG Autoscaler: Dynamic Resource Allocation Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cluster-autoscaler area/core-autoscaler Denotes an issue that is related to the core autoscaler and is not specific to any provider. wg/device-management Categorizes an issue or PR as relevant to WG Device Management.
Projects
None yet
Development

No branches or pull requests

2 participants