docs: restore drill runbook and testnet cutover runbook - #582
Open
onuibeblessing2019-hash wants to merge 1 commit into
Open
Conversation
|
@onuibeblessing2019-hash Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #501
Closes #502
Both issues ask for real operational work (a production restore drill, a runbook walked through by someone else) that needs staging access and team availability this pass doesn't have. Followed the precedent already established in this repo by
docs/ROLLBACK_RUNBOOK.md/docs/LAUNCH_CHECKLIST.md(both explicitly marked "template — not yet rehearsed/executed"): do the real, honest subset of the work that's actually possible without that access, document it with real numbers/findings rather than fabricated ones, and disclose exactly what's still missing.#501 — restore drill (
docs/RESTORE_DRILL_RUNBOOK.md)#431 (automated backups) is still open — there is no backup schedule or artifact to restore from yet, so the literal "take a production-shaped backup from staging" scope item can't be done. Instead, performed a real local drill answering the parts that don't depend on #431: does
pg_dump/pg_restoreactually round-trip this schema correctly (especially the partitionedsoroban_eventstable), and what does it cost in wall-clock time.What was actually run, not simulated:
database/schema.sql.create_soroban_partition, 50,000 rows seeded and confirmed distributed across both (29,196 / 20,804).pg_dump -Fc: 8.0s, 3.9 MB.pg_restoreinto a fresh DB: 8s, zero errors.Two real, unrelated bugs found and fixed/flagged along the way:
docker/docker-compose.dev.ymlwas checked into this repo with corrupted YAML — every double-quoted string had been mangled into literal backslash-newline sequences (confirmed viapython3 -c "import yaml; yaml.safe_load(...)"failing to parse the committed file at all). Traced to699fce4(chore(db): integrate sqlx-cli database migration management #93) — confirmed clean at the file's creation (ca79d07), already broken by699fce4.docker compose -f docker/docker-compose.dev.yml confignow resolves cleanly after the fix.create_soroban_partitionis documented as callable in migration0017but is missing fromdatabase/schema.sql, which its own header says "must mirror the end state of that chain."scripts/check-schema-drift.shdoesn't catch this — its own docs say it compares tables/columns/indexes/constraints, not functions. Worked around locally by applying0017's function definition directly; noted as a real gap in the runbook for whoever owns schema.sql's upkeep.Disclosed as still missing: a real backup to restore (blocked on #431), a production-shaped dataset, and RTO under real operational conditions (network transfer, indexer cursor reconciliation). See the runbook's "What's still missing" section.
#502 — testnet cutover runbook (
docs/runbooks/testnet-cutover.md)Built from what this repo's tooling and existing runbooks actually do, not generic advice:
docs/CI.md's real gates (coverage floors, schema-drift/migration-lint scripts — including the function-comparison gap found above), and the actual state of launch: automated Postgres backups with a restore we have actually performed #431/launch: rehearse the rollback before we need it #460/launch: incident response process with a named on-call owner #445 (launch: automated Postgres backups with a restore we have actually performed #431 open, launch: rehearse the rollback before we need it #460/launch: incident response process with a named on-call owner #445 closed but their own runbooks disclose real gaps worth reading before cutover — e.g.ROLLBACK_RUNBOOK.md's finding that zero of the 25 migrations have a.down.sql, so schema rollback isn't automated today).docs/deployment.md's existing deploy/migration/health-check procedure (verified the anchor links resolve to the correct headings) rather than restating it, with a verification after each step.incident-response.md's real SEV-1 definition andLAUNCH_CHECKLIST.md's real rollback-decision procedure, and calls out that a migration-boundary rollback decision (app-only vs. full schema) needs to be made before cutover given the.down.sqlgap above.Disclosed as still missing: the actual walkthrough by someone who didn't write it (#502's literal "done when"), and the on-call section in
incident-response.mdstill being a[FILL IN: ...]placeholder.Test plan
python3 -c "import yaml; yaml.safe_load(open('docker/docker-compose.dev.yml'))"— passes after the fix (failed before).docker compose -f docker/docker-compose.dev.yml config— resolves cleanly, confirming semantic validity beyond just YAML syntax (daemon not required forconfig).deployment.md,incident-response.md,LAUNCH_CHECKLIST.md,ROLLBACK_RUNBOOK.md, andRESTORE_DRILL_RUNBOOK.md) checked against the actual heading text in each target file, including GitHub's anchor-slug conversion for the em-dash in "SEV-1 — service down or data incorrect".