-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Fix stress test failure "Corruption: checksum mismatch" or "Iterator Diverged" with async_io enabled #10032
Fix stress test failure "Corruption: checksum mismatch" or "Iterator Diverged" with async_io enabled #10032
Conversation
26a350f
to
318ca5a
Compare
@akankshamahajan15 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
// are not sequential and Non sequential reads will be handled there. | ||
if (!enable_ || (offset < bufs_[curr_].offset_ && async_io_ == false)) { | ||
// requested bytes. | ||
if (bufs_[curr_].buffer_.CurrentSize() > 0 && offset < bufs_[curr_].offset_ && |
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 check basically fixes failure.
318ca5a
to
8338cb9
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
@akankshamahajan15 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
8338cb9
to
12c936d
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
12c936d
to
bdb5201
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
1 similar comment
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
@akankshamahajan15 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: In case of non sequential reads with
async_io
,FilePRefetchBuffer::TryReadFromCacheAsync
can be called for previous blocks withoffset < bufs_[curr_].offset_
which wasn't handled correctly resulting wrong data being returned from buffer.Since
FilePRefetchBuffer::PrefetchAsync
can be called for any data block, it setsprev_len_
to 0 indicatingFilePRefetchBuffer::TryReadFromCacheAsync
to go for the prefetching even though offset < bufs_[curr_].offset_ This is because async prefetching is always done in second buffer (to avoid mutex) even though curr_ is empty leading to offset < bufs_[curr_].offset_ in some cases.If prev_len_ is non zero then
TryReadFromCacheAsync
returns false ifoffset < bufs_[curr_].offset_ && prev_len != 0
indicating reads are not sequential and previous call wasn't PrefetchAsync.FilePRefetchBuffer::TryReadFromCacheAsync
as it was getting complicated covering different scenarios based onasync_io
enabled/disabled. Iffor_compaction
is set true, it now callsFilePRefetchBufferTryReadFromCache
following synchronous flow as before. Its decided in BlockFetcher.ccTest Plan:
make crash_test -j completed successfully locally