Guard auto-readahead against exhausted index iter (#14631)#14631
Guard auto-readahead against exhausted index iter (#14631)#14631archang19 wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@archang19 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101217429. |
✅ clang-tidy: No findings on changed linesCompleted in 169.8s. |
Summary:
Observed crash from ZippyDB iterate scans:
```
onFatalError: unexpected error : Invariant SignalFatal:
fbcode/zippydb/server/Main.cpp:handleSigToFatalCommon:281:FATAL false
failed: Signal 11 (SIGSEGV) at address 0x0 ... method: MultiIterate ...
RocksDB Activity: iterate
```
Key stack frames:
rocksdb::BlockBasedTableIterator::IsNextBlockOutOfReadaheadBound()
fbcode/rocksdb/src/table/block_based/block_based_table_iterator.h:471
rocksdb::BlockBasedTableIterator::BlockCacheLookupForReadAheadSize()
fbcode/rocksdb/src/table/block_based/block_based_table_iterator.cc:878
rocksdb::FinalizeAsyncRead()
rocksdb::FilePrefetchBuffer::PollIfNeeded()
rocksdb::BlockFetcher::ReadBlockContents()
rocksdb::BlockBasedTableIterator::InitDataBlock()
rocksdb::DBIter::Next()
Reviewed By: xingbowang
Differential Revision: D101217429
84a3a3e to
ee54c15
Compare
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit ee54c15 Code Review: Guard auto-readahead against exhausted index iter (#14631)SummaryThis PR fixes a production SIGSEGV crash in Verdict: APPROVE — The fix is correct, minimal, and addresses a real production crash with negligible performance impact. Root Cause AnalysisThe crash occurs through this chain:
FindingsFinding 1: Fix is Correct and Sufficient — POSITIVEThe guard at line 876 prevents the crash at the only vulnerable call site. The early return with unmodified offsets is correct: Finding 2: Consider
|
|
This pull request has been merged in 3ef8b1b. |
Summary:
Observed crash from ZippyDB iterate scans:
Key stack frames:
rocksdb::BlockBasedTableIterator::IsNextBlockOutOfReadaheadBound()
fbcode/rocksdb/src/table/block_based/block_based_table_iterator.h:471
rocksdb::BlockBasedTableIterator::BlockCacheLookupForReadAheadSize()
fbcode/rocksdb/src/table/block_based/block_based_table_iterator.cc:878
rocksdb::FinalizeAsyncRead()
rocksdb::FilePrefetchBuffer::PollIfNeeded()
rocksdb::BlockFetcher::ReadBlockContents()
rocksdb::BlockBasedTableIterator::InitDataBlock()
rocksdb::DBIter::Next()
Reviewed By: xingbowang
Differential Revision: D101217429