Expand description
Restore on boot: a server whose data directory holds no store restores
the newest restore point of a backup prefix into it before it opens the
store (MUSHROOMDB_RESTORE_FROM_S3).
In order:
- A data directory that holds a store, and no install marker, is never
restored over:
BootRestore::Skipped. Only what killed restores into it left is swept. - The prefix’s bucket lease is taken. A fresh lease of another instance
means that instance may still be writing: nothing is restored and
nothing is written to the data directory (
BootError::ForeignLease). - Under the lease, a restore on boot that a crash stopped while it moved
its files in is undone (
crate::restore::undo_interrupted_install), unless the store has changed since that install (it may have served): then nothing is removed and the boot fails. - The newest restore point is restored in place
(
crate::restore::restore_in_place) while the lease is renewed. The store gets a new lineage and records the restore point it came from, so its backup can continue under the same prefix beside the parent’s chain without ever touching it (seecrate::worker, Lineage). A prefix with no backup at all isBootRestore::NoBackup: a first deploy starts an empty store. Any other failure is an error, and the data directory is left without a store.
The lease stays held, and renewed, until the caller hands it to the
backup worker (BootLease::into_lease, then
crate::BackupWorker::adopt_lease) or releases it.
Structs§
- Boot
Lease - The bucket lease a restore on boot took, renewed until it is handed on.
Enums§
- Boot
Error - Why a restore on boot failed. The data directory then holds no store.
- Boot
Restore - What a restore on boot did.
Functions§
- restore_
on_ boot - Restore the newest restore point of
config.s3_url’s prefix intodata_dirif it holds no store. See the module docs.