feat(recovery): assess bounded WAL manifest continuity - #239
Draft
seonghobae wants to merge 9 commits into
Draft
Conversation
|
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 was referenced Aug 17, 2026
seonghobae
changed the base branch from
main
to
fix/recovery-evidence-weakref-coverage-b84f0c9
August 19, 2026 02:26
This was referenced Aug 20, 2026
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.
Summary
Add a bounded deterministic PostgreSQL WAL filename-continuity assessment for one explicit timeline and exact start/target LSN interval. The implementation validates PostgreSQL WAL filename geometry for reviewed 1 MiB–1 GiB power-of-two segment sizes, rejects malformed or hostile inputs, bounds work to 4096 segments, rejects the reserved first segment containing LSN zero, and emits content-free continuity metadata only.
This seam does not inspect WAL file bytes, prove cluster identity, establish timeline ancestry, execute replay, prove PITR/RPO/RTO, or promote a recovery target. Those remain separately governed under #204.
Exact stack boundary
main:b84f0c94154043a3473939c01bb6471de5a129aefix/recovery-evidence-weakref-coverage-b84f0c95951b7a4d779903b8924abaef2a387cae50b7f54feat/postgres-wal-continuity-b84f0c924705a7de353c40a11e1172f7485e6ef04e22489pg_llm_batch/postgres_wal_continuity.pytests/test_postgres_wal_continuity.py24705a7...is a non-destructive merge commit retaining the original WAL-continuity history and exact #233 head5951b7a...as parents. It includes #233's focused weak-reference coverage regression only as predecessor history; that file is not part of this PR's relative diff. No source or documentation was written directly to protected main.Fresh targeted writer inventory finds only
feat/postgres-wal-continuity-b84f0c9on this exact source surface. Fresh formal-review inventory remains empty; absence of review is not approval.RED → narrow canonical-LSN repair
The branch contract requires
start_lsnandtarget_lsnto be canonical PostgreSQL LSN text. PostgreSQL emitspg_lsntext with an unpadded uppercase high component and an exactly eight-digit uppercase low component (%X/%08X). The prior parser accepted equivalent zero-padded high components such as00000000/01000000, allowing noncanonical textual identities into otherwise deterministic evidence.9b331b378638cf8a95b8b3286abac649f5ec1dd3— test-first regression rejects a zero-padded high component for both start and target.12fc3f99753b2d045d8369d8671f91b75d1316b3— narrow source repair parses the values, reconstructs PostgreSQL's canonical%X/%08Xform, and rejects textual disagreement without widening accepted authority or diagnostics.72aa141cd7e8b14c1d0de85cad1b8f518ae2112f— updates zero-LSN fixtures to canonical0/00000000so invalid-input, reserved-segment, and bounded-work regressions retain their intended causal boundaries.The repair preserves exact built-in primitive validation, fixed content-free errors, bounded 4096-segment work, canonical uppercase 24-hex segment names, segment-size-dependent filename geometry, target-order validation, and the explicit non-guarantees above.
Exact validation state
Pre-stack exact head
72aa141...produced terminal-success Release Acceptance32205580414, SAST Semgrep32205580445, Security Scan32205580399, Python 3.10/3.12/3.14 unit lanes, PostgreSQL/container smokes, compile, Ruff, and 100% public-docstring coverage. CI32205580418failed only at repository aggregate coverage: the WAL-continuity module was exact 100%, 1358 tests passed, and the only uncovered branches were protected-mainpostgres_backup_evidence.py:65->exitandpostgres_schema_evidence.py:49->exit, owned by dependency-root #233. That predecessor evidence is RCA context only and does not transfer.For unchanged exact stacked head
24705a7de353c40a11e1172f7485e6ef04e22489, repository-local workflows concluded terminal-success:32208530970: success;32208531078: success;32208530972: success; and32208531005: success.Those historical conclusions remain branch evidence only. Final integration still requires fresh proof that every then-required scanner actually analyzed the final contributor head under then-protected central semantics. No predecessor, synthetic, or stale evidence transfers.
Contract boundary
assess_postgres_wal_continuity(...)accepts exact primitive values for:wal_segment_size_bytes: a reviewed PostgreSQL-supported power-of-two size from 1 MiB through 1 GiB;timeline_id: explicit nonzero uint32 timeline;start_lsnandtarget_lsn, with target not before start; andThe assessment requires the exact ordered segment tuple needed to cover the inclusive target LSN, rejects PostgreSQL's bootstrap-skipped first segment containing invalid LSN zero, and enforces a finite 4096-segment work budget.
Dependency and governance boundary — refreshed 2026-08-30
#233 is the exact predecessor and must integrate first. The former read-only central coverage/review failure is historical RCA rather than the current capability boundary. Unchanged #233 now has fresh exact-contributor-head CI, Release Acceptance, Trivy Security Scan, Semgrep SAST and bounded Strix evidence under protected central semantics. None of that evidence transfers to this child.
#233 remains non-passing because its active same-head OpenCode formal state is still
CHANGES_REQUESTED, that disposition has not been superseded by a fresh qualifying semantic review, and no qualifying approval exists under live governance. Central.githubremains read-only; mutable control-plane/reviewer/provider truth is centralized in #244. Do not mutate central, copy its workaround, churn pg heads merely to manufacture events, or transfer predecessor evidence.This branch owns only the two WAL-continuity files above. It does not mutate #236 WAL receive execution, #238 PITR-target binding, #240 WAL-byte binding, #241 timeline-history assessment, canonical-documentation writer #229, or read-only central dependencies.
After #233 integrates, retarget/reconcile this PR non-destructively to then-current protected main, prove the relative diff remains exactly the two WAL-continuity files, and reacquire every exact-final-head/current-base CI, security, coverage, package, SBOM, provenance, release, review, and thread-resolution gate. Merge only with the qualifying independent non-author approval required by then-live policy.
Queued, pending, cancelled, skipped-required, absent, neutral, stale, predecessor, status-only, synthetic, author-only, rate-limited, infrastructure-failed, dismissed, or conclusion-null evidence is non-passing.
Refs #204, #233, #244.