-
Notifications
You must be signed in to change notification settings - Fork 110
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
Add append mode to Mcap Writer in the Typescript Core package #1016
Add append mode to Mcap Writer in the Typescript Core package #1016
Conversation
d2f966f
to
073c194
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach looks nicer. I think we could put the seek method in a separate interface to make the change backwards compatible.
FYI you will need to merge or rebase since I merged #1014 which updates some lint rules.
01fb93c
to
9eb6a8a
Compare
9eb6a8a
to
0b93060
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the continued work on this. In order to merge we will need to get some test coverage on this code. If you have some time & energy to put in, that would be appreciated – I think you should be able to follow some of the existing test patterns in McapWriter.test.ts, to create tests that write a file and then append to it with a 2nd writer instance, and demonstrating that the appended file has the correct records/indexes in it.
987e51d
to
7039375
Compare
074de29
to
e3c8f56
Compare
05384b8
to
4975788
Compare
@jtbandes Thanks for the feedback! Addressed all your comments. |
3a8ebb9
to
4e58b74
Compare
Sorry for the delay, this is on my radar but it might take a little while before I get more time to review it fully. |
4e58b74
to
1f2dbf9
Compare
1f2dbf9
to
67f0d17
Compare
67f0d17
to
a8fe009
Compare
Still planning on reviewing this but we've had a few other high-priority things come up. Thanks for your patience! |
Made various updates & fixes; opened a new PR here: #1060 |
### Public-Facing Changes - Added `InitializeForAppending()` to `McapWriter`. - `McapIndexedReader` now exposes `dataEndOffset` and `dataSectionCrc`. ### Description Append mode works by using `McapIndexedReader` to read the summary section, loading all indexes, channels, etc. from the footer into memory, then chopping off everything from DataEnd onwards and continuing to write from there. This does not work if the `DataEnd` record contains extra data or padding. This seems to be a fundamental flaw with the spec; a separate PR will be raised to change the spec to disallow this. See also: https://github.com/foxglove/mcap/blob/4d62967abe95e755b91f16cce390f6560d18e07e/go/cli/mcap/utils/mcap_amendment.go Supersedes / closes #1016 Resolves FG-5821 --------- Co-authored-by: Alex Ernst <alex.m.ernst14@gmail.com>
@alexern14 Thanks for getting this started and being patient! Now released in v2.1.0 🎉 https://mcap.dev/docs/typescript/classes/_mcap_core.McapWriter#InitializeForAppending |
Public-Facing Changes
Description