feat(canopy): N2: blob store backups and paired restore - #810
feat(canopy): N2: blob store backups and paired restore#810dannash100 wants to merge 10 commits into
Conversation
|
🤖 No Canopy code change. One config step, and it's required rather than optional: On Canopy, once the type name is final:
No migration, no PR. |
|
I think it does need something from canopy, because canopy won't allow the creds for the followers |
|
🤖 You're right, and my comment above is wrong on that. Still config rather than code, but with an ordering constraint: the type default has to exist, with Enabling can't be coded away regardless, since the staleness scan filters on If the ordering risk is worth code, the smallest version is an operator-set flag on the capability so Also correcting the comment above: restore creds aren't gated per type, only by the per-server restore window. |
Implements the bestool side of Tamanu's blob store backup spec (
specs/blob-storage/backups.md, id BKUP, on beyondessential/tamanu#10708). The store is a content-addressed, append-only tree, so atamanu-postgresbackup alone no longer captures a server's whole state, and the two captures have to stay ordered (database first, store second) and be restorable as a pair. Today types are independent: nothing orders them, and pairing is an operator eyeballing timestamps. Continues from #809.Three mechanisms:
after = "<type>". After a successful run of that type the driver runs its followers, so the store is captured right after each database backup. Needs nothing from Canopy; a schedule on the follower type is a safe backstop since a store capture alone is a superset of any earlier database capture. Chaining lives inrun_backupso daemon, CLI-via-daemon, and local runs behave identically.canopy-typetag every backup already carries, with the type in the kopia description as a second signal. kopia start time stands in for the freeze moment; it's conservative in the safe direction.[simple]acceptspath_commandas an alternative topath, andbestool tamanu blob-rootprints the store root from Tamanu'sblobStorage.rootsetting, so the def follows an admin-panel change instead of silently going stale, and a restored store lands where the just-restored database expects it.Checked on a real repo against the pinned kopia 0.23.1, since pairing rests on it: both signals come back from
snapshot list. Tags looked like they didn't because the key comes back spelledtag:canopy-type. Keying on the tag also covers snapshots taken before this branch, and drops a source-path fallback that could only fire on Linux. The proxy e2e asserts both now.USAGE.md was regenerated on macOS without the iti features and spliced by hand; the check-docs job is the byte-for-byte confirmation.