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

Farmer fixes #3154

Merged
merged 4 commits into from
Oct 21, 2024
Merged

Farmer fixes #3154

merged 4 commits into from
Oct 21, 2024

Conversation

nazar-pc
Copy link
Member

Two fixes, both caused issues with pieces, but due to different reasons.

Code contributor checklist:

fn write(&self) -> &DirectIoFile {
// Always the same file or else overlapping writes will be corrupted due to
// read/modify/write internals, which are in turn caused by alignment requirements
&self.files[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is rather confusing despite the comment. Can you rephrase to explain writing API for a single file and reading API from different files?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you read it is fine to read concurrently, but due to alignment requirements when we do not write chunks of 512 bytes at a multiple of 512 bytes offset, we need to first read 512 bytes, then replace what we want to modify in those bytes with new contents and write it back to disk. We can't just write arbitrary sizes at arbitrary offsets with Direct IO, see the DirectIoFile implementation.

@nazar-pc nazar-pc added this pull request to the merge queue Oct 21, 2024
Merged via the queue into main with commit 6693a10 Oct 21, 2024
8 checks passed
@nazar-pc nazar-pc deleted the farmer-fixes branch October 21, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants