Disable backward scan in stress test when separate_key_value_in_data_block is enabled#14889
Disable backward scan in stress test when separate_key_value_in_data_block is enabled#14889anand1976 wants to merge 1 commit into
Conversation
…block is enabled Summary: When `separate_key_value_in_data_block=true`, the data block iterator stores keys and values in separate sections. Under certain conditions during backward iteration (Prev/SeekForPrev), `DBIter::FindValueForCurrentKey` encounters entries whose values cannot be pinned, causing a `NotSupported` error: "Backward iteration not supported if underlying iterator's value cannot be pinned." This manifests in the crash test as `TestIterateAgainstExpected` failures when the random flag combination includes `separate_key_value_in_data_block=1` (added in 47cfeb656ff3) with `test_backward_scan=1` (the default). The fix automatically disables `test_backward_scan` when `separate_key_value_in_data_block` is enabled, matching the pattern used for other option incompatibilities in the stress tool. Differential Revision: D109837793
|
@anand1976 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109837793. |
✅ clang-tidy: No findings on changed linesCompleted in 18.2s. |
🟡 Codex Code ReviewAuto-triggered after CI passed — reviewing commit ab91fee ❌ Codex review failed before producing findings. ℹ️ About this responseGenerated by Codex CLI. Limitations:
Commands:
|
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit ab91fee SummaryThis is a correct, minimal fix for a known crash in the stress test. The change disables backward scanning when High-severity findings (0): No high-severity findings. Full review (click to expand)Findings🟡 MEDIUMM1. Silent override without log message —
|
| Context | Affected? | Assessment |
|---|---|---|
| Production code (db engine) | NO | Change is stress-test-only |
| Public API | NO | No API changes |
| db_crashtest.py | Indirectly | Python does not set test_backward_scan; relies on C++ guard |
| Other table formats (plain, cuckoo) | NO | Only block-based tables use separate_key_value_in_data_block |
inplace_update_support |
Already handled | Has its own backward scan incompatibility check elsewhere |
Assumption stress-test:
- Claim: "the block-based table iterator cannot pin values" when
separate_key_value_in_data_block=true. - Verification:
BlockIter::IsValuePinned()(block.h:441) returnsblock_contents_pinned_, which CAN be true when blocks are cached. However,BlockBasedTableIterator::IsValuePinned()(block_based_table_iterator.h:186-193) additionally requirespinned_iters_mgr_to be set and enabled. During normal iteration in the stress test,pinned_iters_mgr_may not always be configured for backward iteration, causing theNotSupportederror. The guard is correct — the incompatibility exists even though it may not trigger 100% of the time.
Positive Observations
- The fix follows the established pattern for flag incompatibility handling in the stress tool (line 347).
- The comment clearly explains the technical reason for the incompatibility.
- The placement is correct — after the compaction filter check and before multi-ops txn setup, consistent with the ordering of other flag checks.
- The guard is minimal and low-risk — it only affects stress test behavior, not the database engine.
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/code_review.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
|
This pull request has been merged in ffb7788. |
Summary: When
separate_key_value_in_data_block=true, the data block iterator stores keys and values in separate sections. Under certain conditions during backward iteration (Prev/SeekForPrev),DBIter::FindValueForCurrentKeyencounters entries whose values cannot be pinned, causing aNotSupportederror: "Backward iteration not supported if underlying iterator's value cannot be pinned." This manifests in the crash test asTestIterateAgainstExpectedfailures when the random flag combination includesseparate_key_value_in_data_block=1(added in 47cfeb656ff3) withtest_backward_scan=1(the default). The fix automatically disablestest_backward_scanwhenseparate_key_value_in_data_blockis enabled, matching the pattern used for other option incompatibilities in the stress tool.Differential Revision: D109837793