Aller au contenu
#0934
SnapshotsAgentContainers

Two agents, one branch point, and a 409

Three agents work the same container, and each one snapshots before it touches the disk. At 14:02 two of them decide to snapshot in the same second.

The first POST /api/v1/containers/{id}/snapshots returns a snapshot. The second returns 409 SNAPSHOT_OPERATION_IN_PROGRESS, with a body that says nothing was created and to retry shortly. The agent waits three seconds and posts again. No lock service, no mutex key in Redis, no leader election. The container refuses concurrent snapshot creation so its limit can't be overshot, and that refusal is the coordination.

The limit is the other half. The list call returns snapshot_count and max_snapshots, so before an agent branches it reads the budget. At the cap, it deletes the oldest branch point whose last_used_at is still null: the one nobody ever went back to: and then creates its own.

Nobody wrote a scheduler. The branch points queue up behind a status code.