Skip to content

Stream restore plan selection across levels#1076

Merged
benbjohnson merged 4 commits intomainfrom
codex/restore-plan-streaming
Feb 3, 2026
Merged

Stream restore plan selection across levels#1076
benbjohnson merged 4 commits intomainfrom
codex/restore-plan-streaming

Conversation

@benbjohnson
Copy link
Owner

Summary

  • refactor CalcRestorePlan to stream iterators per level, picking the next file with the longest contiguous TXID range instead of collecting all level files first
  • add level cursors that concurrently advance through iterators, allowing gaps at higher levels to be filled by longer ranges from lower levels
  • expand test coverage to ensure the new planner prefers longer candidates and can recover from gaps using lower levels

Testing

  • Not run (not requested)

@benbjohnson
Copy link
Owner Author

I tested this against 350+ databases internally and they all pass with PRAGMA integrity_check. This PR also include a fuzz test which was run for a while too.

@benbjohnson benbjohnson merged commit b2d8145 into main Feb 3, 2026
19 checks passed
@benbjohnson benbjohnson deleted the codex/restore-plan-streaming branch February 3, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant