atecontroller: reclaim golden actor on ActorTemplate delete - #879
Closed
Alex Bulankou (AlexBulankou) wants to merge 1 commit into
Closed
Conversation
The ActorTemplate controller declares the actortemplates/finalizers RBAC verb but installs no finalizer, so deleting an ActorTemplate orphans its golden actor and snapshot blobs once status.GoldenActorID is GCd with the CR. Add an ate.dev/golden-actor-cleanup finalizer: installed on first reconcile, and on delete the golden actor is suspended if still running (FailedPrecondition -> SuspendActor + requeue) then deleted idempotently (NotFound / empty GoldenActorID are success). Signed-off-by: Alex Bulankou <alexbu@google.com>
Collaborator
|
The |
Collaborator
|
+1 I don't think we need to worry about this right now, because we decided to have ActorTemplate as a substrate resources so will remove the current CRD and controllers for it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ActorTemplate controller declares the
actortemplates/finalizersRBAC verb but installs no finalizer, so deleting an ActorTemplate lets the CR be GC'd immediately while the backing golden actor + snapshot blobs live on in the store — unreclaimable oncestatus.GoldenActorIDis gone with the CR.This adds an
ate.dev/golden-actor-cleanupfinalizer:cleanupGoldenActorruns while the finalizer is held, then releases it:NotFound(already reclaimed) or emptyGoldenActorID(actor never created) → success.DeleteActorrequiresSUSPENDED/CRASHED; a template deleted mid-lifecycle may have aRUNNINGgolden actor (FailedPrecondition), so weSuspendActor+ requeue (5s) rather than deadlock the CR's deletion.Tests: mock extended with
DeleteActor/SuspendActor; new cases for finalizer-install, delete-when-suspended, delete-when-running (suspend+requeue), delete-when-NotFound, delete-when-no-GoldenActorID.go build ./...,go vet, and the controller test suite pass locally.