Skip to content

Commit

Permalink
Probably only need this for now
Browse files Browse the repository at this point in the history
  • Loading branch information
archang19 committed Dec 6, 2024
1 parent e43e419 commit 9a0a2c4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions file/file_prefetch_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -858,22 +858,14 @@ bool FilePrefetchBuffer::TryReadFromCacheUntracked(
buf = overlap_buf_;
}
if (offset < buf->offset_) {
fprintf(stderr,
fprintf(stdout,
"Requested offset %" PRIu64 " is less than buffer offset %" PRIu64
". UseFSBuffer(reader)=%d\n",
offset, buf->offset_, UseFSBuffer(reader));
assert(false);
return false;
}
uint64_t offset_in_buffer = offset - buf->offset_;
if (buf->CurrentSize() - offset_in_buffer < n) {
fprintf(stderr,
"Insufficient room in buffer. Only have %" PRIu64
" but need %lu. UseFSBuffer(reader)=%d\n",
buf->CurrentSize() - offset_in_buffer, n, UseFSBuffer(reader));
assert(false);
return false;
}
*result = Slice(buf->buffer_.BufferStart() + offset_in_buffer, n);
if (prefetched) {
readahead_size_ = std::min(max_readahead_size_, readahead_size_ * 2);
Expand Down

0 comments on commit 9a0a2c4

Please sign in to comment.