Address reverse MultiScan follow-up comments#14922
Conversation
Summary: - Preserve source compatibility for `Scan::Reset` by restoring the default `reverse` argument. - Make `HasMoreScanRanges()` defensive for reverse prepared scans instead of asserting. - Restore broader forward coverage in `MultiScanAsyncIOTest` while keeping reverse coverage on the representative async IO matrix. - Let `--multiscan_reverse` drive reverse MultiScan stress coverage independently of `--test_backward_scan`. - Add the reverse MultiScan public API release note. Differential Revision: D111127403
|
@jaykorean has exported this pull request. If you are a Meta employee, you can view the originating Diff in D111127403. |
✅ clang-tidy: No findings on changed linesCompleted in 97.2s. |
🟡 Codex Code ReviewAuto-triggered after CI passed — reviewing commit 72d7808 ❌ Codex review failed before producing findings. ℹ️ About this responseGenerated by Codex CLI. Limitations:
Commands:
|
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit 72d7808 SummaryClean follow-up PR that addresses review comments on reverse MultiScan. All five changes are well-motivated: restoring source compatibility for High-severity findings (0): No high-severity findings. Full review (click to expand)Findings🟡 MEDIUMM1. Test
|
| Context | Does code execute? | Assumptions hold? | Action needed? |
|---|---|---|---|
| Forward MultiScan | YES | YES - HasMoreScanRanges() works as before |
None |
| Reverse MultiScan | YES (defensive path) | YES - returns false, caller falls through to return |
None |
| WritePreparedTxnDB | N/A - MultiScan is orthogonal | N/A | None |
| ReadOnly DB | YES | YES | None |
| User-defined timestamps | YES | YES | None |
Assumption stress-test:
Claim: "HasMoreScanRanges() is unreachable in reverse"
IsScanRangeExhausted()must return true forHasMoreScanRanges()to be called (block_based_table_iterator.cc:692-694).scan_range_exhausted_is set to true ONLY bySetExhausted().SetExhausted()is called from:Seek()(forward-only, line 119 guards),Next()(line 340), andSeekToBlock()(forward-only). None called in reverse.Prev()does NOT callSetExhausted()-- setsvalid_ = falsedirectly (line 469).SeekForPrev()resetsscan_range_exhausted_ = false(line 386).- Verified: claim holds. The defensive check is a safety net for future changes.
Claim: "Decoupling multiscan_reverse from test_backward_scan is safe"
FLAGS_test_backward_scangates backward scan inTestIterate(no_batched_ops_stress.cc). It does NOT gate any infrastructure used byTestMultiScan.TestMultiScansetsiterate_lower_boundindependently when reverse (line 2261-2263).- Verified: claim holds.
Positive Observations
- Assert-to-defensive-check in
HasMoreScanRanges()is the right pattern -- asserts are no-ops in release builds. - Default parameter on
Scan::Resetmatches the constructor's signature -- good API consistency. - Test restructuring wisely broadens forward coverage while keeping reverse on the cheapest representative config.
- Stress tool decoupling is correct -- reverse MultiScan doesn't share infrastructure with backward scan.
ℹ️ 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 f32f747. |
Summary:
Scan::Resetby restoring the defaultreverseargument.HasMoreScanRanges()defensive for reverse prepared scans instead of asserting.MultiScanAsyncIOTestwhile keeping reverse coverage on the representative async IO matrix.--multiscan_reversedrive reverse MultiScan stress coverage independently of--test_backward_scan.Differential Revision: D111127403