Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream snapshots and restores #6368

Open
neilalexander opened this issue Jan 13, 2025 · 0 comments
Open

Stream snapshots and restores #6368

neilalexander opened this issue Jan 13, 2025 · 0 comments
Labels
defect Suspected defect such as a bug or regression

Comments

@neilalexander
Copy link
Member

Observed behavior

Currently stream snapshots and restores work by archiving what's in the store directory for the stream on disk and restoring in-place. While this approach is simple, it has some problems.

When restoring a stream, we need to decompress the tar into a staging folder. It's not possible to apply limits at this point, as we can't know the full uncompressed size until we are in the process of decompressing it, and we also can't know which files may not be relevant for that version (i.e. as on-disk metadata has changed through the versions).

We also don't know that the layout of the restored files is optimal in the face of large numbers of interior deletes either, i.e. we may end up restoring lots of blocks with tombstones that could be compressed down into a contiguous range represented by a single delete range.

We also don't know if there'll be enough disk space free to satisfy both the JetStream reservations as well as the temporary space required for the restore staging directory.

Expected behavior

Ideally this wants a complete redesign, such that the stream snapshot is actually a stream of messages and their metadata, rather than the on-disk representation.

That way we can safely ingest messages into a new stream whilst obeying limits, updating the subject state etc inline correctly for the ingesting version, as well as removing any possibility of the archive containing information that isn't relevant to the new server.

Server and client version

All

Host environment

No response

Steps to reproduce

No response

@neilalexander neilalexander added the defect Suspected defect such as a bug or regression label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

1 participant