Skip to content

Add WAL recovery plan object#623

Merged
flyingrobots merged 1 commit into
mainfrom
cycle/574-recovery-plan-object
Jun 28, 2026
Merged

Add WAL recovery plan object#623
flyingrobots merged 1 commit into
mainfrom
cycle/574-recovery-plan-object

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Closes #574

Summary

  • Add WalRecoveryPlan and related posture records for recovery bootstrap source, checkpoint selection, replay suffix, tail posture, recovered index roots, retained-material posture, and projected evidence posture.
  • Support plan construction from either a projected WalRoot or storage WalManifest without requiring graph WAL nodes as input.
  • Add recovery_plan_bootstraps_from_wal_root and include the exact witness in cargo xtask test-slice durability-release.
  • Update the WAL topic, workflow command map, and changelog signposts.

Validation

  • cargo fmt --check
  • cargo test -p warp-core --test causal_wal_tests recovery_plan_bootstraps_from_wal_root
  • cargo clippy -p warp-core --test causal_wal_tests -- -D warnings
  • cargo test -p xtask test_slice_durability_release_stays_explicit
  • npx markdownlint-cli2 CHANGELOG.md docs/topics/WAL.md docs/workflows.md
  • git diff --check
  • cargo test -p warp-core --test causal_wal_tests
  • Pre-commit hook: cargo clippy -p warp-core --lib, cargo check -p warp-core, markdownlint
  • Pre-push hook: cargo fmt --all -- --check, cargo check -p warp-core --quiet, cargo test -p warp-core --test causal_wal_tests, Prettier markdown check

Test speed note

  • The release gate uses the exact cargo test -p warp-core --test causal_wal_tests recovery_plan_bootstraps_from_wal_root witness instead of Cargo's package-level name filter.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@flyingrobots, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 2 minutes and 37 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: bdebb52b-4d6a-43f6-b858-11966533f742

📥 Commits

Reviewing files that changed from the base of the PR and between 68b3875 and 543d3a1.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • crates/warp-core/src/causal_wal.rs
  • crates/warp-core/tests/causal_wal_tests.rs
  • docs/topics/WAL.md
  • docs/workflows.md
  • xtask/src/main.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cycle/574-recovery-plan-object

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Owner Author

Code Lawyer update

Item Status Evidence Resolving commit
#574 Recovery Plan Object Resolved Added WalRecoveryPlan with WAL-root and manifest bootstrap sources, checkpoint posture, replay suffix, tail posture, recovered index roots, retained-material posture, and projected evidence posture. 543d3a1
Release gate Resolved durability-release now includes exact recovery_plan_bootstraps_from_wal_root witness. 543d3a1
CI Clean 36/36 reported checks passed, including CI, det-gates, Security Audit, SPDX Header Check, and CodeRabbit status. 543d3a1
Review threads Clean GraphQL reviewThreads(first:100) returned zero nodes. 543d3a1
CodeRabbit Non-blocking Status context is SUCCESS; top-level comment reports review rate limit/credits only, with no actionable inline review. 543d3a1

Local validation before opening:

  • cargo fmt --check
  • cargo test -p warp-core --test causal_wal_tests recovery_plan_bootstraps_from_wal_root
  • cargo clippy -p warp-core --test causal_wal_tests -- -D warnings
  • cargo test -p xtask test_slice_durability_release_stays_explicit
  • npx markdownlint-cli2 CHANGELOG.md docs/topics/WAL.md docs/workflows.md
  • git diff --check
  • cargo test -p warp-core --test causal_wal_tests
  • pre-commit and pre-push hooks passed

@flyingrobots
flyingrobots merged commit adec9c9 into main Jun 28, 2026
36 checks passed
@flyingrobots
flyingrobots deleted the cycle/574-recovery-plan-object branch June 28, 2026 05:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 543d3a13e5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +3328 to +3329
let obstruction_count =
len_u64(retained_material_obstructions(index, available_material).len());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude diagnostic losses from recovery-plan obstruction counts

When a recovered WAL has only missing or corrupt RetainedMaterialKind::Diagnostic material, retained_material_obstructions returns a DiagnosticLoss scope; the existing doctor path filters that scope because diagnostic loss does not block causal recovery. This new posture uses the unfiltered obstruction count, so the recovery plan reports Obstructed even though all recovery-required material is available, creating false obstruction evidence for diagnostic-only loss.

Useful? React with 👍 / 👎.

Comment on lines +3331 to +3335
availability: if obstruction_count == 0 {
WalRecoveryRetainedMaterialAvailability::Available
} else {
WalRecoveryRetainedMaterialAvailability::Obstructed
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Count missing reading refs in recovery posture

When the WAL contains a ReadingEnvelopeRetained record whose ReadingRefRecord.posture is Missing, Corrupt, or Obstructed (or whose payload/envelope digest has no matching retained-material record), retained_material_obstructions still returns zero because it only walks material_by_digest. The plan then reports Available even with unrecoverable reading evidence, hiding the app-safe missing-retention posture during recovery planning.

Useful? React with 👍 / 👎.

Self {
bootstrap_source,
checkpoint_posture,
replay_suffix: WalRecoveryReplaySuffix::from_report(report),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Report only the post-checkpoint replay suffix

When checkpoint_posture is Selected, recovery is supposed to use the checkpoint as the base and replay only the WAL tail after that checkpoint, but this always derives the suffix from the full scan report. A plan for a checkpointed recovery will therefore report the WAL's first committed LSN and all committed transactions, including history already covered by the checkpoint, which makes the recorded replay evidence inaccurate for checkpoint-backed recovery.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[GP5-S1] Recovery Plan Object

1 participant