Skip to content

specification (v1): chunk sync markers #735

Open
@wkalt

Description

@wkalt

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions