mirror of
https://github.com/floci-io/floci.git
synced 2026-12-05 19:18:01 -05:00
A DocumentDB cluster's MongoDB container kept its data in the unnamed volume the mongo image declares for /data/db. Removing the container, as Floci's shutdown does, left that volume behind with nothing to find it by, so a cluster could never be started again on its data. With a persistent storage mode (persistent, hybrid or wal), a new cluster now gets a volume ID, kept in its record, and its container mounts floci-aws-docdb-<volume-id> at /data/db, or binds <host-path>/docdb/<volume-id> when the host persistent path is an absolute path. Memory mode and mock mode are unchanged. DeleteDBCluster removes the volume as the storage policy says: a persistent mode keeps it unless prune-volumes-on-delete is set. A cluster whose create fails, or that a failed snapshot or point-in-time restore discards, never reached the caller, so its volume goes whatever the policy. A container that started but whose MongoDB never answered is removed too, so it holds no volume. A cluster created again under a deleted one's identifier starts on a new, empty volume. Starting the clusters' containers again on these volumes when Floci restarts comes next. Part of #5664.