diff --git a/table/block_based/block_prefetcher.cc b/table/block_based/block_prefetcher.cc index 5cd2cc2b5..83ec2cb06 100644 --- a/table/block_based/block_prefetcher.cc +++ b/table/block_based/block_prefetcher.cc @@ -45,6 +45,10 @@ void BlockPrefetcher::PrefetchIfNeeded( return; } + if (initial_auto_readahead_size_ > max_auto_readahead_size) { + initial_auto_readahead_size_ = max_auto_readahead_size; + } + // In case of no_sequential_checking, it will skip the num_file_reads_ and // will always creates the FilePrefetchBuffer. if (no_sequential_checking) { @@ -81,10 +85,6 @@ void BlockPrefetcher::PrefetchIfNeeded( return; } - if (initial_auto_readahead_size_ > max_auto_readahead_size) { - initial_auto_readahead_size_ = max_auto_readahead_size; - } - if (rep->file->use_direct_io()) { rep->CreateFilePrefetchBufferIfNotExists( initial_auto_readahead_size_, max_auto_readahead_size,