Skip to content

Commit

Permalink
Update logic for determining start offset
Browse files Browse the repository at this point in the history
ReadAheadSizeTuning was messing up the
start offset because when we use the
file system buffer, we do not re-use
existing prefetched data (at least in
my current implementation)
  • Loading branch information
archang19 committed Nov 7, 2024
1 parent 377ddef commit f4cda31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion file/file_prefetch_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,12 @@ Status FilePrefetchBuffer::PrefetchInternal(const IOOptions& opts,
}

if (read_len1 > 0) {
s = Read(buf, opts, reader, read_len1, aligned_useful_len1, start_offset1);
if (UseFSBuffer(reader)) {
s = Read(buf, opts, reader, read_len1 + aligned_useful_len1, 0, offset);
} else {
s = Read(buf, opts, reader, read_len1, aligned_useful_len1,
start_offset1);
}
if (!s.ok()) {
AbortAllIOs();
FreeAllBuffers();
Expand Down

0 comments on commit f4cda31

Please sign in to comment.