Skip to content

Prune drained deployment versions #82

@pcholakov

Description

@pcholakov

Service Deployer registers new versions; Restate doesn't currently internally prune drained deployment versions - we support this in the k8s operator's RestateDeployment. We could have a configurable policy to clean up to a fixed number of fully drained deployments while running (we can avoid having a scheduled job to start). Here is a very rough shell-based approach to do this (for all drained deployments):

restate sql "SELECT d.id FROM sys_deployment d LEFT JOIN sys_service s ON (d.id = s.deployment_id) LEFT JOIN sys_invocation_status i ON (d.id = i.pinned_deployment_id) WHERE s.name IS NULL AND i.id IS NULL" --jsonl \
    | jq .id -r | xargs -n 1 -P 8 restate dep rm --yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions