[WIP]Allow force deleting an actor from any state. - #788
Open
Sneha-at (Sneha-at) wants to merge 4 commits into
Open
[WIP]Allow force deleting an actor from any state.#788Sneha-at (Sneha-at) wants to merge 4 commits into
Sneha-at (Sneha-at) wants to merge 4 commits into
Conversation
…actor. This will bypass the requirement to suspend the workload cleanly before deletion. A new TERMINATING status is added to indicate that we're starting the termination sequence. The termination sequence will call atelet to terminate the workload. Once atelet termination succeeds, then we will proceed with control plane termination sequence. Finally we will move to the existing DELETING status to delete the actor resources.
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.
Fixes #643
The "Force Delete" feature allows deleting an actor from almost any state (e.g.,
RUNNING,CRASHED,SUSPENDING), bypassing the normal restriction that required the actor to beSUSPENDEDbefore deletion. This is crucial for cleaning up stuck or failed actors.Involved Components
sequenceDiagram autonumber actor Client participant Ateapi as Ateapi (Control Plane) participant Store as Store (DB) participant Atelet as Atelet (Node Agent) participant Ateom as Ateom (Runtime Agent) participant VM_Sandbox as VM/Sandbox (gVisor/CH) Client->>Ateapi: DeleteActor(Actor, force=true) activate Ateapi Ateapi->>Store: GetActor(Actor) Store-->>Ateapi: Actor State Note over Ateapi: MarkTerminatingStep Ateapi->>Ateapi: Verify state (allows almost any state if force=true) Ateapi->>Store: UpdateActor(Status=TERMINATING) alt Actor has Worker Assignment Note over Ateapi: CallAteletTerminateStep Ateapi->>Atelet: Terminate(ActorUID, TargetAteomUID) activate Atelet Atelet->>Ateom: TerminateWorkload(ActorUID) activate Ateom Ateom->>Ateom: Deactivate Networking alt Runtime is gVisor (ateom-gvisor) Ateom->>VM_Sandbox: runsc delete (containers) Note over Ateom, VM_Sandbox: Kills and deletes sandboxed containers else Runtime is MicroVM (ateom-microvm) Ateom->>VM_Sandbox: Shutdown VMM / Kill Process Note over Ateom, VM_Sandbox: Shuts down Cloud Hypervisor & virtiofsd end Ateom->>Ateom: Unmount OCI Overlays Ateom->>Ateom: Cleanup Actor Network Ateom-->>Atelet: TerminateWorkload Response deactivate Ateom Atelet->>Atelet: Unmount External Volumes on Node Atelet->>Atelet: Reset Actor Directories on Node Atelet-->>Ateapi: Terminate Response deactivate Atelet end Note over Ateapi: DetachVolumesForDeleteStep Ateapi->>Ateapi: Detach volumes from actor in control plane Note over Ateapi: ReleaseWorkerStep Ateapi->>Store: Get Worker Ateapi->>Store: UpdateWorker(Assignment=nil) (releases worker) Ateapi->>Store: UpdateActor(WorkerAssignment=nil, LocalSnapshotInfo=nil) Note over Ateapi: MarkDeletingStep Ateapi->>Store: UpdateActor(Status=DELETING, Volumes=DELETING) Note over Ateapi: DeleteVolumesStep Ateapi->>Ateapi: Delete volumes (durable storage) Note over Ateapi: FinalizeDeletedStep Ateapi->>Store: DeleteActor() (removes record) Ateapi-->>Client: Deleted ActorDetailed Step Descriptions (Control Plane)
LoadActorForDeleteStep: Fetches the latest actor state and template from the store.MarkTerminatingStep: Transition the actor status toTERMINATING. IfForceis true, this transition is allowed from any active state.CallAteletTerminateStep: If the actor is currently assigned to a worker node, this step dials theAteleton that node and requests termination.DetachVolumesForDeleteStep: Initiates detachment of any volumes associated with the actor.ReleaseWorkerStep: Clears the assignment on the worker resource in the store, making the worker available for other actors. It also clears the worker assignment on the actor record.MarkDeletingStep: Transitions the actor status toDELETINGand marks its volumes asDELETING.DeleteVolumesStep: Deletes the actual volume resources (e.g., GCS buckets or directories).FinalizeDeletedStep: Permanently removes the actor record from the store.