feat(ops): bind PostgreSQL backups to exact recovery provenance - #208
Draft
seonghobae wants to merge 30 commits into
Draft
feat(ops): bind PostgreSQL backups to exact recovery provenance#208seonghobae wants to merge 30 commits into
seonghobae wants to merge 30 commits into
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Purpose
Advance #188 from exact protected
develop@622e5e6c3d534f230c390f10e3832efadfc01825with a bounded PostgreSQL recovery-evidence path. Persistent Docker volumes are not backups, and a backup archive is not recoverability. This Draft provides an integrity-bound logical backup bundle plus a fail-closed disposable empty-target restore rehearsal. It still does not claim destructive production recovery, PITR, Kafka/Debezium/DLT rewind, external-target compensation, application-startup/readiness recovery, or measured RPO/RTO.Exact current identity
develop@622e5e6c3d534f230c390f10e3832efadfc01825;ops/postgres-recovery-manifest-622e5e6;5ea1d328a40544240504d271ebf8a5f01292d723;41f840d49f170496bf60cf2fd0d2f210712b88a4;510d033982f935aa9d933ea90dcb52824f2c6b7a;f33de0a8a6709947c0b19a94a931f1870afa386c;fb4743f2d2908944e455dd717e3d57750da582e5;Every predecessor-head/base check or review is historical after movement. Current protected PR workflows execute GitHub synthetic merge revisions, so aggregate-green jobs remain merged-tree evidence rather than accepted literal-source proof.
RCA chain
manifest.txt.pg_restore --exit-on-erroralone can leave partial objects after an earlier command committed.TDD / recovery evidence
The branch preserves fail-first history for backup creation, truthful recovery documentation, changelog discoverability, concurrent backup identity reservation, disposable-target restore rehearsal, independently authenticated manifest provenance, atomic
pg_restore --single-transaction, required relation checks, and representative durable-row invariants.Representative durable-row RED -> GREEN
Test-only
5ea1d328a40544240504d271ebf8a5f01292d723addedPostgresLogicalRestoreDurableDataInvariantTestbefore production changed. Hosted CI31379582437, macOS job93426522475, compiled normally and ran ETL with 287 tests, exactly one failure, zero errors/skips. The new recovery assertion failed because the restore command did not evaluate restored idempotency rows. Existing recovery contracts were green. This is valid RED at the post-restore application-integrity boundary.41f840d49f170496bf60cf2fd0d2f210712b88a4then added post-restore count-only, fail-closed checks for:Hosted CI
31379887799completed successfully on macOS/Ubuntu/Windows; ETL ran 287/287 green, CDC 106/106 green, gateway 3/3 green, and the full reactor succeeded. The same log still proved the inherited protected JaCoCo false green (Analyzed bundle 'etl-service' with 0 classes).Follow-on RED -> GREEN — exact protected failure-code grammar
Fresh source comparison against protected migration
V2__create_etl_job_records.sqlfound the first durable-row implementation used a looser recovery-only failure-code regex than the database constraint. The protected authority is:^[a-z][a-z0-9_]{2,127}$Test-only
510d033982f935aa9d933ea90dcb52824f2c6b7achanged only the recovery contract to require that exact grammar before production changed. CI31380086329, macOS job93428106291, checked out synthetic mergeac755919ebb0845dffc31b2549378750d6f5d6a1. Production/test compilation succeeded and ETL ran 287 tests with exactly one failure, zero errors/skips:restore must enforce the exact protected durable-job failure-code grammar. All earlier recovery assertions were green. This is valid RED at the intended schema/recovery consistency boundary.Exact current source
f33de0a8a6709947c0b19a94a931f1870afa386cis one fast-forward commit over that RED head and changes exactly one line in the restore script: the failure-code validation now matches the protected V2 constraint exactly. Immediate compare is ahead 1 / behind 0 with one file and one addition/one deletion.Exact-current-head hosted verification
For exact source head
f33de0a8a6709947c0b19a94a931f1870afa386cevery exposed aggregate is terminal-success:31380283009: success on macOS, Ubuntu and Windows;31380283063: success;31380283122: success;31380283074: success;31380283100: aggregate success.CI macOS job
93428715109checked out synthetic mergefb4743f2d2908944e455dd717e3d57750da582e5, not literal source. On that tree:PostgresLogicalRestoreDurableDataInvariantTest: green;BUILD SUCCESS.The same CI log still says
Analyzed bundle 'etl-service' with 0 classesbefore JaCoCo reports success. #162/#164 owns selected-class non-vacuity and #205 owns repository-wide coverage completeness. The log also repeats already-owned protected-base diagnostics such as resource-encoding (#217), Mockito agent setup (#194), ETL resource-ID logging (#218/#219), and CDC diagnostic logging (#170–#176/#210–#212); none is duplicated into this recovery branch.Shared evidence boundaries
Aggregate success is not protected merge authorization:
Do not copy shared workflow/security/coverage fixes into this branch merely to manufacture acceptance evidence.
Remaining #188 boundary
This remains bounded PostgreSQL artifact/rehearsal evidence, not complete disaster recovery. Later acceptance still needs realistic proof for application startup/readiness on a restored database, destructive-loss replacement/retry procedure, replay/cancellation/tenant invariants as those schemas integrate, Kafka/Debezium/DLT/external-target reconciliation, protected release linkage, and measured elapsed recovery before any RPO/RTO/SLA claim.
Merge boundary
Keep Draft. Merge only when the unchanged exact source head has accepted literal-source deterministic/security evidence, complete same-revision dependency/vulnerability/SBOM evidence, non-vacuous applicable owned-production coverage, zero valid unresolved review findings, qualifying independent non-author formal approval where governance requires it, and branch protection/rulesets permit expected-head merge. No predecessor-head, other-PR, incomplete-scanner, skipped-required, status-only, or synthetic-merge-only evidence transfers.