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

Byte stream writer should document the atomic write guarantee #240

Closed
claudiofahey opened this issue Mar 9, 2021 · 2 comments
Closed

Byte stream writer should document the atomic write guarantee #240

claudiofahey opened this issue Mar 9, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation Priority Should be prioritized

Comments

@claudiofahey
Copy link

Problem description
The byte stream writer writes buffers less than or equal to 8 MiB atomically. However, this critical feature is not documented. It should be documented so that users can safely utilize this guarantee without worrying about breaking implementation changes in the future.

Problem location
byte_stream.rs ByteStreamWriter::write.

Suggestions for an improvement

Add the following, assuming that it is correct.

If buf length is less than or equal to 8 MiB, the entire buffer will be written atomically. If buf length is greater than 8 MiB, only the first 8 MiB will be written, and it will be written atomically. In either case, the actual number of bytes written will be returned.

@tkaitchuck
Copy link
Member

tkaitchuck commented Mar 12, 2021

More to the point: The number of bytes written is returned. Those bytes will be persisted atomically. (Though perhaps not before the method returns.)

@tkaitchuck tkaitchuck added Priority Should be prioritized documentation Improvements or additions to documentation labels May 7, 2021
@Tristan1900
Copy link
Member

Thanks for the issue, it has been added to the Rust doc now.
https://pravega.github.io/pravega-client-rust/doc/pravega_client/byte/struct.ByteWriter.html#atomicity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Priority Should be prioritized
Projects
None yet
Development

No branches or pull requests

3 participants