diff --git a/table/block_based/block_based_table_iterator.cc b/table/block_based/block_based_table_iterator.cc index 8c313ed6180fe945796d6425c9cf28ca3008f684..ac47043f0b6bc3ab5c0d250680f03bc100a8f182 100644 --- a/table/block_based/block_based_table_iterator.cc +++ b/table/block_based/block_based_table_iterator.cc @@ -79,13 +79,20 @@ void BlockBasedTableIterator::SeekImpl(const Slice* target, } } - if (read_options_.auto_readahead_size && read_options_.iterate_upper_bound) { + if (read_options_.auto_readahead_size && read_options_.iterate_upper_bound && + is_first_pass) { FindReadAheadSizeUpperBound(); if (target) { index_iter_->Seek(*target); } else { index_iter_->SeekToFirst(); } + + // Check for IO error. + if (!index_iter_->Valid()) { + ResetDataIter(); + return; + } } IndexValue v = index_iter_->value();