| CreateActor (same as UpdateActor's tmpl) |
Set actor.template=templ. Must ensure tmpl exists in database. |
Set actor.template=templ. Must ensure tmpl exists in database. |
Copy all data from templ, including golden snapshot. Must ensure tmpl exists in database. |
ResumeActor (winner: c > a > b) |
Look up the template by foreign key. |
Look up the template by foreign key. May fail if the AT is deleted. |
No need to look up the actor template. |
Data at rest (winner: a = b > c, but for use cases with 1 actor per template (see #553 ), c is as good as a & b) |
#templates × template size |
#templates × template size |
#actors × template size. Estimate: 1 billion actors × 1 KB per template =~ 1 TB |
DeleteActorTemplate (winner: c > a > b) |
Blocks until all actors are deleted. (Least flexible) |
Does not block. Accidental deletion can cause outages. The user needs to either 1. ListActors() until pageToken=="", 2. Or "drain" a template by calling UpdateActor(replacementTempl) + ResumeActor(), then delete the template. After deleting the template, the above logic will still take effect, so ResumeActor will still succeed. |
Does not block. Accidental deletion does not cause outages. Actors can still resume with their self-contained spec. |
| When can users delete an ActorTemplate? |
When no actors reference it. |
When the draining mechanism above is in place and has soaked. |
When users will never call UpdateActor or CreateActor with the target template. May need the same draining logic to be confident. |
Vulnerability scanning of container images (winner: a = b > c) |
Iterate through all templates, and mark them as disabled. Subsequent ResumeActor calls using this template will fail. Customers must do UpdateActor(newTempl) + Resume. |
Iterate through all templates, and mark them as disabled. If the template is already deleted, existing actors referencing it cannot resume without updating their template first. |
Iterate through all Actors (and label them as "upgrade required"). |
List Actors by AT (winner: a = b > c) |
Look up by foreign key. |
Look up by foreign key while the AT still exists. |
Table scan. Look up all Actors that reference the AT. ActorTemplates are immutable. |
Actor -> ActorTemplate relationship
Today we read some data from ActorTemplate and Actor objects while running. Should we:
actor.template=templ.Must ensure tmpl exists in database.
actor.template=templ.Must ensure tmpl exists in database.
Must ensure tmpl exists in database.
(winner: c > a > b)
(winner: a = b > c, but for use cases with 1 actor per template (see #553 ), c is as good as a & b)
Estimate: 1 billion actors × 1 KB per template =~ 1 TB
(winner: c > a > b)
The user needs to either
1. ListActors() until pageToken=="",
2. Or "drain" a template by calling UpdateActor(replacementTempl) + ResumeActor(), then delete the template. After deleting the template, the above logic will still take effect, so ResumeActor will still succeed.
May need the same draining logic to be confident.
(winner: a = b > c)
(winner: a = b > c)
Conclusion