rocksdb/table/block_based
Anand Ananthabhotla ede2cbd67b Fix MultiScanIndexIterator crash on reseek after exhaustion (#14581)
Summary:
Pull Request resolved: https://github.com/facebook/rocksdb/pull/14581

In `MultiScanIndexIterator::Seek()` Case 3, when re-entering a scan range
after all ranges were exhausted, `block_idx = std::max(cur_scan_start_idx,
cur_idx_)` could produce an out-of-bounds value because `cur_idx_` was left
at `block_handles_.size()` from previous exhaustion. `SeekToBlockIdx()`
unconditionally set `valid_ = true` without checking bounds, causing the
subsequent `value()` call to hit the assertion
`cur_idx_ < block_handles_.size()`.

Added bounds check before `SeekToBlockIdx()` in Case 3 to correctly report
exhaustion instead of crashing.

Reviewed By: joshkang97

Differential Revision: D99604049

fbshipit-source-id: 9d5d91afde7c0984a7b4c2f62604f27f19b07922
2026-04-09 22:44:06 -07:00
..
binary_search_index_reader.cc Add interpolation search as an alternative to binary search (#14247) 2026-02-13 17:15:10 -08:00
binary_search_index_reader.h Extend Get/MultiGet deadline support to table open (#6982) 2020-06-29 14:53:17 -07:00
block.cc Support automated interpolation search (#14383) 2026-03-06 10:13:51 -08:00
block.h Support automated interpolation search (#14383) 2026-03-06 10:13:51 -08:00
block_based_table_builder.cc Prepopulate block cache during compaction (#14445) 2026-03-10 16:19:33 -07:00
block_based_table_builder.h Propagate builder error when flush produces empty output (#14418) 2026-03-05 14:18:08 -08:00
block_based_table_factory.cc Prepopulate block cache during compaction (#14445) 2026-03-10 16:19:33 -07:00
block_based_table_factory.h DROP support for block-based SST format_version < 2 (#14315) 2026-02-11 14:43:41 -08:00
block_based_table_iterator.cc Refactor MultiScan to use MultiScanIndexIterator (#14401) 2026-03-04 21:09:54 -08:00
block_based_table_iterator.h Refactor MultiScan to use MultiScanIndexIterator (#14401) 2026-03-04 21:09:54 -08:00
block_based_table_reader.cc Separate keys and values in data blocks (#14287) 2026-02-23 12:42:05 -08:00
block_based_table_reader.h Separate keys and values in data blocks (#14287) 2026-02-23 12:42:05 -08:00
block_based_table_reader_impl.h Separate keys and values in data blocks (#14287) 2026-02-23 12:42:05 -08:00
block_based_table_reader_sync_and_async.h Add per-block-type block read byte perf counters (#14473) 2026-03-19 14:54:24 -07:00
block_based_table_reader_test.cc Fix MultiScanIndexIterator crash on reseek after exhaustion (#14581) 2026-04-09 22:44:06 -07:00
block_builder.cc Support automated interpolation search (#14383) 2026-03-06 10:13:51 -08:00
block_builder.h Support automated interpolation search (#14383) 2026-03-06 10:13:51 -08:00
block_cache.cc Separate keys and values in data blocks (#14287) 2026-02-23 12:42:05 -08:00
block_cache.h Separate keys and values in data blocks (#14287) 2026-02-23 12:42:05 -08:00
block_prefetcher.cc Add prefetch feature enum to FSSupportedOps (#13917) 2025-10-17 19:54:49 -07:00
block_prefetcher.h Refactor FilePrefetchBuffer code (#12097) 2024-01-05 09:29:01 -08:00
block_prefix_index.cc Fix bug with kHashSearch and changing prefix_extractor with SetOptions (#10128) 2022-06-10 08:51:45 -07:00
block_prefix_index.h Fix bug with kHashSearch and changing prefix_extractor with SetOptions (#10128) 2022-06-10 08:51:45 -07:00
block_test.cc Support automated interpolation search (#14383) 2026-03-06 10:13:51 -08:00
block_type.h Add block type to corruption error message (#14225) 2026-01-09 14:37:46 -08:00
block_util.h Support automated interpolation search (#14383) 2026-03-06 10:13:51 -08:00
cachable_entry.h Support pro-actively erasing obsolete block cache entries (#12694) 2024-06-07 08:57:11 -07:00
data_block_footer.cc Support automated interpolation search (#14383) 2026-03-06 10:13:51 -08:00
data_block_footer.h Support automated interpolation search (#14383) 2026-03-06 10:13:51 -08:00
data_block_hash_index.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
data_block_hash_index.h Separate keys and values in data blocks (#14287) 2026-02-23 12:42:05 -08:00
data_block_hash_index_test.cc Preliminary support for custom compression algorithms (#13659) 2025-06-16 14:19:03 -07:00
filter_block.h Introduce tail estimation to prevent oversized compaction files (#14051) 2025-11-05 20:00:00 -08:00
filter_block_reader_common.cc Big refactor for preliminary custom compression API (#13540) 2025-05-15 17:14:23 -07:00
filter_block_reader_common.h Remove redundant no_io parameters to filter functions (#12762) 2024-06-12 18:47:11 -07:00
filter_policy.cc Merge BuiltinFilterBitsBuilder into FilterBitsBuilder for accurate filter size estimation (#14111) 2025-11-10 14:47:36 -08:00
filter_policy_internal.h Merge BuiltinFilterBitsBuilder into FilterBitsBuilder for accurate filter size estimation (#14111) 2025-11-10 14:47:36 -08:00
flush_block_policy.cc Refactor/improve PartitionedIndexBuilder::AddIndexEntry (#13828) 2025-08-04 14:15:38 -07:00
flush_block_policy_impl.h Refactor/improve PartitionedIndexBuilder::AddIndexEntry (#13828) 2025-08-04 14:15:38 -07:00
full_filter_block.cc Merge BuiltinFilterBitsBuilder into FilterBitsBuilder for accurate filter size estimation (#14111) 2025-11-10 14:47:36 -08:00
full_filter_block.h Introduce tail estimation to prevent oversized compaction files (#14051) 2025-11-05 20:00:00 -08:00
full_filter_block_test.cc Merge BuiltinFilterBitsBuilder into FilterBitsBuilder for accurate filter size estimation (#14111) 2025-11-10 14:47:36 -08:00
hash_index_reader.cc Big refactor for preliminary custom compression API (#13540) 2025-05-15 17:14:23 -07:00
hash_index_reader.h Extend Get/MultiGet deadline support to table open (#6982) 2020-06-29 14:53:17 -07:00
index_builder.cc Support automated interpolation search (#14383) 2026-03-06 10:13:51 -08:00
index_builder.h Support automated interpolation search (#14383) 2026-03-06 10:13:51 -08:00
index_reader_common.cc Big refactor for preliminary custom compression API (#13540) 2025-05-15 17:14:23 -07:00
index_reader_common.h Eliminate some parameters redundant with ReadOptions (#12761) 2024-06-12 15:44:37 -07:00
mock_block_based_table.h Reformat source files (#14331) 2026-02-13 11:56:22 -08:00
multi_scan_index_iterator.cc Fix MultiScanIndexIterator crash on reseek after exhaustion (#14581) 2026-04-09 22:44:06 -07:00
multi_scan_index_iterator.h Refactor MultiScan to use MultiScanIndexIterator (#14401) 2026-03-04 21:09:54 -08:00
parsed_full_filter_block.cc Hide FilterBits{Builder,Reader} from public API (#9592) 2022-02-17 16:34:46 -08:00
parsed_full_filter_block.h Major Cache refactoring, CPU efficiency improvement (#10975) 2023-01-11 14:20:40 -08:00
partitioned_filter_block.cc Separate keys and values in data blocks (#14287) 2026-02-23 12:42:05 -08:00
partitioned_filter_block.h Introduce tail estimation to prevent oversized compaction files (#14051) 2025-11-05 20:00:00 -08:00
partitioned_filter_block_test.cc DROP support for block-based SST format_version < 2 (#14315) 2026-02-11 14:43:41 -08:00
partitioned_index_iterator.cc Refactor FilePrefetchBuffer code (#12097) 2024-01-05 09:29:01 -08:00
partitioned_index_iterator.h Fix an assertion failure in stress test (#13988) 2025-09-22 14:28:38 -07:00
partitioned_index_reader.cc Big refactor for preliminary custom compression API (#13540) 2025-05-15 17:14:23 -07:00
partitioned_index_reader.h Support pro-actively erasing obsolete block cache entries (#12694) 2024-06-07 08:57:11 -07:00
reader_common.cc Add block type to corruption error message (#14225) 2026-01-09 14:37:46 -08:00
reader_common.h Add block type to corruption error message (#14225) 2026-01-09 14:37:46 -08:00
uncompression_dict_reader.cc Big refactor for preliminary custom compression API (#13540) 2025-05-15 17:14:23 -07:00
uncompression_dict_reader.h Remove obsolete compression code and some .h->.cc movement (#14325) 2026-02-13 11:18:05 -08:00
user_defined_index_wrapper.h Support all operation types in User Defined Index (UDI) interface (#14399) 2026-03-16 15:25:05 -07:00