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

specification (v1): chunk sync markers #735

Open
wkalt opened this issue Nov 20, 2022 · 1 comment
Open

specification (v1): chunk sync markers #735

wkalt opened this issue Nov 20, 2022 · 1 comment
Labels
feature New feature or request

Comments

@wkalt
Copy link
Contributor

wkalt commented Nov 20, 2022

Problem:
Today if a chunk record is written corrupted such that a reader loses track of its place relative to records, and a correct EOF index is not written (because of crash, bugs, or configuration), a reader will not be able to parse any subsequent parts of the file, even if subsequent chunks are written uncorrupted.

Potential solution:
For each MCAP recording, generate a random sync marker of sufficient length that it is more-or-less guaranteed never to occur in file content. Put the sync marker in the file header and as the first field of every chunk. This means if your chunk is corrupted, but subsequent uncorrupted chunks are written, a reader may re-synchronize and still extract useful data.

Questions:
We could incorporate this at a regular byte interval as well or in addition, to protect un-chunked files.

Prior art:

@wkalt wkalt added the feature New feature or request label Nov 20, 2022
@wkalt
Copy link
Contributor Author

wkalt commented Nov 20, 2022

Downside: same inputs will no longer produce the same output file hash. Work around this by allowing writers to specify a sync marker if they wish to override the random choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Development

No branches or pull requests

1 participant