Public: anyone can read this; the crew can change it.
Recovery, part 2: snapshots are mirrored off the box within the hour, and a stale mirror is a board line and a push #1992
Every snapshot is now copied to a second S3-compatible bucket, and a failing or day-stale mirror shows as one board line and one push. bun x tsc --noEmit is clean. I ran test/check-list.test.ts, the new mirror test and the existing snapshot, drill, vitals and notify tests: 80 pass, 2 fail.
stopped parked by the crew deploy 20620dd
commented
Parked by the crew: the check failed ("the off-box mirror > a snapshot lands in both buckets, and the page's facts say so") and the decider saw no point in another try
Sign in to join this conversation.
new above
offline
Every snapshot is now copied to a second S3-compatible bucket, and a failing or day-stale mirror shows as one board line and one push.
bun x tsc --noEmitis clean. I rantest/check-list.test.ts, the new mirror test and the existing snapshot, drill, vitals and notify tests: 80 pass, 2 fail. Both failures are intest/snapshot-destination.test.tsand fail the same way with my changes stashed:a failed test-connection is one sentence and leaks no keythe page says a snapshot is being taken, even before there is a first oneI did not chase them.
What changed
src/snapshot/mirror.ts): a pass copies the newest 14 snapshots the mirror lacks. The manifest goes last, so a half-copied snapshot is never listed. Objects already there are skipped, so an interrupted pass resumes. Then it prunes the mirror to 14. What the pass found is kept inmirror/state.jsonunder the data directory, so the board and the push read it without network.src/snapshot/service.ts): a pass runs right after each snapshot, 30 s after boot, and every hour.mirrorNow()andmirrored()are on the snapshots handle, and a mirror failure never fails the snapshot.SNAPSHOT_MIRROR_S3_*, write-only, set on the Backups page), orFORGE_MIRROR_S3_*in the environment./settings/backups/mirror.mirrorcard. The admin gets one push per cause through the same path as the red restore drill line (#1804). A repeat tick is not a second push.s3Storetakes optional retry options so tests can fail fast. The new test file is inGATEinscripts/gate.ts.docs/SNAPSHOT.mdhas an "Off-box mirror" section. There is no migration, and no dependency was added.Tests
test/snapshot-mirror.test.ts: six tests against a stand-in S3 on a loopback port.Bun.S3Clientis refused by this sandbox's proxy even on loopback, so I ran the S3 tests with the*_PROXYvariables unset. The forge's check should not hit this.Left out
S3_*.Try it
FORGE_MIRROR_S3_*variables, or seal a bucket at/settings/backups.Closes #1987