mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 23:59:27 -05:00
Floci's shutdown stopped every Neptune cluster's proxy and graph database container and nothing started them again, so after a restart with persistent storage a cluster reported available with nothing behind its port. At startup each cluster now reports maintenance, and its instances starting, with its proxy port held for it at once, so a cluster created meanwhile is never handed it. Its container comes back in the background on the volume its graph is kept in, in the engine the graph was kept in, which the cluster's record now names, and its proxy listens on its port again; the cluster and its instances then report available. With no Docker daemon reachable they come back available with no container, as a cluster created then does. A cluster whose container or proxy does not start is left with none and its instances failed, and is tried again at the next start. The restore runs in each cluster's own account and Region, and marking the clusters calls no Docker. Floci now records which cluster holds each proxy port, so a cluster whose stored port another cluster holds moves to a free one, its instances with it, and one restored in the same process keeps its own. One recorded before its engine was kept is taken to be in the configured one, and one recorded before its graph was kept in a volume gets a volume, both kept before any Docker call. A DeleteDBCluster while the restore is starting the cluster's container leaves it deleting until the container has started, a second one too, and the restore removes it then. A delete defers only while a restore owns the cluster, which it does only once its marking is done, so one a failed write left deleting is retried at once; one still deleting at the next start is removed in the background. The delete, the restore and CreateDBInstance decide under a per-cluster lock, and instance creation, deletion and the restore's status writes under a per-instance one, taken first, so the restore never puts back an instance deleted meanwhile. CreateDBInstance is refused with InvalidDBClusterStateFault for a cluster that is not available. Shutdown now marks the container manager first, after which no container starts. A container left under a cluster's name, by a Floci that exited without stopping it, is now stopped with the same 30 seconds as at shutdown before its replacement starts, rather than removed outright, so Gremlin Server saves its graph to the volume first. The message refusing to delete a cluster with instances uses a colon in place of its dash. Closes #5664.