rocksdb/db_stress_tool
Anand Ananthabhotla b21eaa91c2 Fix memory accounting leak in IODispatcher ReadIndex() (#14569)
Summary:
Pull Request resolved: https://github.com/facebook/rocksdb/pull/14569

ReadSet::ReadIndex() moves block values out of pinned_blocks_ via std::move,
but never releases the associated prefetch memory accounting. This causes
ReleaseBlock() and the destructor to skip ReleaseMemory() since they check
pinned_blocks_.GetValue() which returns null after the move. Over time, the
memory budget is exhausted and no further prefetches can be dispatched when
max_prefetch_memory_bytes is set. The bug was introduced in https://github.com/facebook/rocksdb/pull/14401.

The fix releases memory accounting in ReadIndex() when moving values out
(both for Case 1: block already available, and Case 2: after async IO
polling), and zeros block_sizes_ to prevent double-release.

Also adds multiscan_max_prefetch_memory_bytes option to db_stress/crashtest
for stress testing this code path.

Reviewed By: hx235

Differential Revision: D99488961

fbshipit-source-id: 5ddd1f50e2f6ebb357f86e013d781a790e7e558a
2026-04-09 22:43:39 -07:00
..
batched_ops_stress.cc Print iterator status in stress tests when PrepareValue() fails (#13130) 2024-11-09 15:04:17 -08:00
cf_consistency_stress.cc Remove deprecated DB::Open raw pointer variants (and more) (#14335) 2026-02-17 23:33:39 -08:00
CMakeLists.txt Stress/crash test improvement to remote compaction with resumable compaction (#14041) 2025-10-21 12:13:57 -07:00
db_stress.cc Disable tiered storage + BlobDB stress test (#10699) 2022-09-19 15:39:31 -07:00
db_stress_common.cc A better approach to clearing DBs for crash test (#14254) 2026-01-22 11:48:06 -08:00
db_stress_common.h Fix memory accounting leak in IODispatcher ReadIndex() (#14569) 2026-04-09 22:43:39 -07:00
db_stress_compaction_filter.h Fix improper ExpectedValute::Exists() usages and disable compaction during VerifyDB() in crash test (#12933) 2024-08-15 12:32:59 -07:00
db_stress_compaction_service.cc Stress/crash test improvement to remote compaction with resumable compaction (#14041) 2025-10-21 12:13:57 -07:00
db_stress_compaction_service.h Stress/crash test improvement to remote compaction with resumable compaction (#14041) 2025-10-21 12:13:57 -07:00
db_stress_compression_manager.cc Support DbStressCustomCompressionManager in ldb and sst_dump (#13827) 2025-08-08 11:04:14 -07:00
db_stress_compression_manager.h Support DbStressCustomCompressionManager in ldb and sst_dump (#13827) 2025-08-08 11:04:14 -07:00
db_stress_driver.cc Fix remote compaction stress test (#13835) 2025-08-06 06:59:51 -07:00
db_stress_driver.h Remove unnecessary, confusing 'extern' (#12300) 2024-01-29 10:38:08 -08:00
db_stress_env_wrapper.h Propagate file_checksum through FileOptions on NewRandomAccessFile (#14321) 2026-02-17 13:05:44 -08:00
db_stress_filters.cc Add experimental range filters to stress/crash test (#12769) 2024-06-18 16:16:09 -07:00
db_stress_filters.h Add experimental range filters to stress/crash test (#12769) 2024-06-18 16:16:09 -07:00
db_stress_gflags.cc Fix memory accounting leak in IODispatcher ReadIndex() (#14569) 2026-04-09 22:43:39 -07:00
db_stress_listener.cc Fix/improve temperature handling for file ingestion (#12402) 2024-03-05 16:56:08 -08:00
db_stress_listener.h Add OnBackgroundJobPressureChanged listener callback (#14474) 2026-03-20 15:02:53 -07:00
db_stress_shared_state.cc Remove ROCKSDB_SUPPORT_THREAD_LOCAL define because it's a part of C++11 (#10015) 2022-05-18 15:25:19 -07:00
db_stress_shared_state.h Stress/crash test improvement to remote compaction with resumable compaction (#14041) 2025-10-21 12:13:57 -07:00
db_stress_stat.h Shorten the lifetime of statistics object in db stress (#13899) 2025-08-26 11:01:12 -07:00
db_stress_table_properties_collector.h Bug fix and refactoring on parallel compression (#13583) 2025-05-02 13:10:06 -07:00
db_stress_test_base.cc Fix memory accounting leak in IODispatcher ReadIndex() (#14569) 2026-04-09 22:43:39 -07:00
db_stress_test_base.h Rename IsExpectedTxnLockTimeout to IsExpectedTxnError (#14441) 2026-03-10 13:33:31 -07:00
db_stress_tool.cc Support all operation types in User Defined Index (UDI) interface (#14399) 2026-03-16 15:25:05 -07:00
db_stress_wide_merge_operator.cc Add the wide-column aware merge API to the stress tests (#11906) 2023-09-29 08:54:50 -07:00
db_stress_wide_merge_operator.h Add the wide-column aware merge API to the stress tests (#11906) 2023-09-29 08:54:50 -07:00
expected_state.cc Verify flushed data are recovered upon reopen in crash test (#12787) 2024-12-24 16:27:35 -08:00
expected_state.h Verify flushed data are recovered upon reopen in crash test (#12787) 2024-12-24 16:27:35 -08:00
expected_value.cc Fix improper ExpectedValute::Exists() usages and disable compaction during VerifyDB() in crash test (#12933) 2024-08-15 12:32:59 -07:00
expected_value.h Typo fix (#14024) 2025-10-03 14:28:37 -07:00
multi_ops_txns_stress.cc Auto refresh iterator with snapshot (#13354) 2025-02-11 19:36:47 -08:00
multi_ops_txns_stress.h Disable AttributeGroup in multiops txn test (#12781) 2024-06-18 16:05:18 -07:00
no_batched_ops_stress.cc Rename IsExpectedTxnLockTimeout to IsExpectedTxnError (#14441) 2026-03-10 13:33:31 -07:00