Skip to content

Streaming restore.#879

Open
ximon18 wants to merge 3 commits into
mainfrom
streaming-restore
Open

Streaming restore.#879
ximon18 wants to merge 3 commits into
mainfrom
streaming-restore

Conversation

@ximon18

@ximon18 ximon18 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Don't load entire large persisted zone snapshot and diff files into memory, instead parse a subset of records at a time.

This PR introduces a persistence::stream module containing a StreamingParser based around BufReader, using BufRead::fill_buf() and an overflow buffer (for reconstructing records that cross the boundary of the end of the BufReader buffer and the beginning of the next buffer content after consuming the current buffer content).

It also moves code around, adds error types and Rust Docs (also for existing restore related code that lacked Rust Docs).

Whether any of this is worth it is questionable: the main benefit is for large zones, but given that multiple gigabytes of memory are required to load and sign large zones, fully reading a wire serialized zone snapshot into memory isn't that large in comparison (e.g. I have a snapshot for .nl that is just under 1 GiB in size, while many GiB are needed to load and sign the zone.


  • If you are changing Rust code or integration tests (Cargo.*, crates/, etc/, integration-tests/, src/):
    • Did you run the integration tests with act through the act-wrapper (as described in TESTING.md)?

ximon18 added 2 commits July 8, 2026 12:17
Instead of loading it all (e.g. 1 GiB for a large snapshot) into memory
at once. Also moves code around to make it easier to read and adds doc
comments and error types.
@ximon18 ximon18 added the enhancement New feature or request label Jul 8, 2026
It doesn't need to be a clickable link...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant