Scheduled database backup verification#115
Open
gloskull wants to merge 2 commits into
Open
Conversation
…cation-process Add scheduled backup restore verification runbook and verification script
Contributor
|
resolve conflicts @gloskull |
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.
Motivation
Provide a system-wide, database-agnostic pattern to verify backups by actually restoring artifacts into isolated targets and running integrity probes.
Surface operational guidance for metrics, alerts, canary rollout, and failure runbook so backup verification is auditable and safe.
Description
Add an executable verification wrapper at scripts/verify_backup_restore.sh that supports --backup, --restore-command, multiple --probe-command entries, optional --manifest SHA-256 validation, --max-age-seconds, --canary-percent, and --dry-run.
Emit Prometheus textfile metrics (utility_backup_restore_verification_success, _duration_seconds, _last_timestamp_seconds) to a configurable --metric-file and ensure ephemeral restore cleanup on exit.
Document the design, example scheduled jobs, monitoring/alerting, blue-green/canary rollout, and runbook in docs/SCHEDULED_BACKUP_VERIFICATION.md.
Surface the feature in the main project README.md feature list.
Testing
bash -n scripts/verify_backup_restore.sh — syntax check passed.
./scripts/verify_backup_restore.sh --help | head -40 — help text verified.
End-to-end disposable test: created a temp backup, generated SHA-256 manifest, ran scripts/verify_backup_restore.sh with --restore-command 'cp {backup} {restore_dir}/restore.txt' and a probe test "$(cat {restore_dir}/restore.txt)" = ok, and verified the generated Prometheus metric file; the test completed successfully.
Closes #69