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

Blockstore: Finalize but still readable #375

Closed
rvagg opened this issue Feb 15, 2023 · 1 comment · Fixed by #376
Closed

Blockstore: Finalize but still readable #375

rvagg opened this issue Feb 15, 2023 · 1 comment · Fixed by #376

Comments

@rvagg
Copy link
Member

rvagg commented Feb 15, 2023

@MichaelMure would like to be able to Finalize() a CARv2 blockstore, so safely flush it to disk along with the index, but still be able to read from it.

This is reasonable and doable, but it means we either have to introduce new APIs or break the Finalize() contract; we probably shouldn't do that.

Finalize() calling ReadOnly#Close() is the key problem here, but if we had a separate ReadWrite#Close() then we could avoid that, but we'd need a separate Finalize(). @MichaelMure has suggested FinalizeReadOnly(). An alternative API he's suggested is for that call to return a closer but that's a bit of a departure from the imperative style here so I'm 👎 on that one. Finalize() can then be a combination of FinalizeReadOnly() and Close() and the functionality provided by ReadOnly can still remain intact and the PutMany check of closed could change to a check on a new finalized property.

@masih @willscott any objections to allowing @MichaelMure to proceed with those changes, or do you have better suggestions, or even objections?

@MichaelMure
Copy link
Contributor

See #376

@rvagg rvagg closed this as completed in #376 Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🎉 Done
Development

Successfully merging a pull request may close this issue.

2 participants