Cover trie index modes - #14967
Cover trie index modes#14967zaidoon1 wants to merge 10 commits into
Conversation
a34e1f1 to
8ae640f
Compare
|
| Check | Count |
|---|---|
cppcoreguidelines-pro-type-member-init |
1 |
| Total | 1 |
Details
utilities/trie_index/trie_index_test.cc (1 warning(s))
utilities/trie_index/trie_index_test.cc:5929:10: warning: constructor does not initialize these fields: handle [cppcoreguidelines-pro-type-member-init]
ebc48a0 to
361ea89
Compare
3ed65cf to
cbc3131
Compare
Claude Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit cbc3131 SummaryThis is Part 12 of 13 in the UDI (User Defined Index) split. The cumulative diff is large (50 files, ~6000 insertions), but the PR-specific delta is 1 file (trie_index_db_test.cc) with ~707 insertions and ~280 deletions. The cumulative diff introduces the High-severity findings (0): No high-severity findings. Full review (click to expand)Findings🔴 HIGHNone. 🟡 MEDIUMM1. C API
|
7e66d47 to
45a6afd
Compare
d9e9a55 to
46094f6
Compare
Summary: Part 1 of 13 in the UDI split. Stack order: 1. #14954 Add IndexFactory compatibility names 2. #14959 Add UDI index mode API vocabulary 3. #14960 Add optional UDI builder protocols 4. #14961 Add built-in index factory wrappers 5. #14969 Add built-in index factory tests 6. #14962 Promote IndexFactory as UDI SPI 7. #14963 Wire IndexFactory through block-based tables 8. #14964 Add IndexFactory table routing tests 9. #14970 Add IndexFactory parallel routing tests 10. #14965 Account UDI blocks as index blocks 11. #14966 Support parallel AddIndexEntry in trie index 12. #14967 Cover trie index modes 13. #14968 Add IndexFactory stress and benchmark flags Previous: none. Next: #14959. This PR adds `include/rocksdb/index_factory.h` as a source-compatible set of new names over the current experimental UDI API: - `IndexFactoryBuilder` -> `UserDefinedIndexBuilder` - `IndexFactoryIterator` -> `UserDefinedIndexIterator` - `IndexFactoryReader` -> `UserDefinedIndexReader` - `IndexFactoryOptions` -> `UserDefinedIndexOption` - `IndexFactory` -> `UserDefinedIndexFactory` - `kIndexFactoryMetaPrefix` -> `kUserDefinedIndexPrefix` This intentionally does not change table building, table reading, SST format, OPTIONS parsing, or the C API. Existing `UserDefinedIndexFactory` subclasses that only implement the old `NewBuilder()` and `NewReader(Slice&)` shape still compile and work through the new `IndexFactory` name. Validation: - `build_tools/rockstest.sh table_test --gtest_filter='IndexFactoryCompatibilityTest.*'` - `make check-sources` - GitHub Actions PR matrix passed on the current head Pull Request resolved: #14954 Reviewed By: jaykorean Differential Revision: D114358164 Pulled By: xingbowang fbshipit-source-id: 5c830dc1f9dfcf11373423a03103a595fd8ad921
97b7fa9 to
4096f07
Compare
Claude Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit 4096f07 SummaryClean, well-structured extension of test coverage from 2 modes (bool) to 3 modes (IndexMode). kCustomOnly guards are applied correctly throughout. The main issue is that SCOPED_TRACE labels in High-severity findings (0): No high-severity findings. Full review (click to expand)Findings🟡 MEDIUMM1. SCOPED_TRACE labels are swapped in kCustomDefault mode --
|
| Context | Does code execute? | Assumptions hold? | Action needed? |
|---|---|---|---|
| kStandardDefault | YES | YES | None |
| kCustomDefault | YES | YES (routing correct) | Fix SCOPED_TRACE labels |
| kCustomOnly | YES | YES (guards applied) | Fix SCOPED_TRACE labels |
| kStandardRequired | NOT TESTED | N/A | Not in INSTANTIATE (intentional -- tested elsewhere in the stack) |
| kStandardOnly | NOT TESTED | N/A | No UDI factory involvement |
Positive Observations
- Thorough kCustomOnly guards: Every test that uses
StandardIndexReadOptions()orBothIndexReadOptions()has been audited for kCustomOnly compatibility. The guards are correctly placed. - Good test decomposition:
BothIndexReadOptions()helper cleanly abstracts the mode-dependent RO selection. - Migration/rollback tests: The existing migration tests correctly skip in kCustomOnly mode where the mixed-mode path is inapplicable.
- New parallel compression tests: Good addition of
ParallelCompressionWithTrieIndexcovering all three modes, plusParallelCompressionWithHashStandardIndexAndTrieUdicovering the hash + trie combination. PrefetchWithCustomIndexWrapper: Well-targeted test for the Prefetch boundary comparison issue with user_key() vs key().ScanAllKeys()no-arg version: Correctly routes through trie in kCustomOnly, standard in kStandardDefault/kCustomDefault.- VerifyScanBothIndexes: Correctly uses hardcoded SCOPED_TRACE labels, avoiding the read_index-based issue.
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/ci_review_prompt.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
374d225 to
3f5543b
Compare
Summary: Part 2 of 13 in the UDI split. Stack order: 1. #14954 Add IndexFactory compatibility names 2. #14959 Add UDI index mode API vocabulary 3. #14960 Add optional UDI builder protocols 4. #14961 Add built-in index factory wrappers 5. #14969 Add built-in index factory tests 6. #14962 Promote IndexFactory as UDI SPI 7. #14963 Wire IndexFactory through block-based tables 8. #14964 Add IndexFactory table routing tests 9. #14970 Add IndexFactory parallel routing tests 10. #14965 Account UDI blocks as index blocks 11. #14966 Support parallel AddIndexEntry in trie index 12. #14967 Cover trie index modes 13. #14968 Add IndexFactory stress and benchmark flags Previous: #14954. Next: #14960. Depends on #14954. Until #14954 lands, GitHub shows the cumulative diff against main. After that lands, the intended review diff is: `zaidoon/udi-01-index-factory-compat-shim..zaidoon/udi-02-index-mode-api` That final review delta is 4 files with 52 insertions. What changed: - Add inert IndexMode and ReadIndex vocabulary to the public options headers. - Block those experimental enum fields from automatic C API generation until the explicit C API mapping lands later in the stack. - Keep behavior unchanged. Runtime wiring comes in later PRs. Validation: - `git diff --check` - `make check-sources` - `python3 tools/c_api_gen/verify_generated_up_to_date.py` - `AUTO_CLEAN=1 make check-c-api-gen` - `./c_test` Pull Request resolved: #14959 Reviewed By: jaykorean Differential Revision: D116211178 Pulled By: xingbowang fbshipit-source-id: 42edd3f0991d90b0b5c90232e5023de6e3740dac
3f5543b to
1858900
Compare
1858900 to
c631f3f
Compare
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit c631f3f SummaryClean test infrastructure migration from bool-parameterized to IndexMode-parameterized tests, with good kCustomOnly coverage and new parallel compression tests. The kCustomOnly adaptations (stub-aware skips, BothIndexReadOptions helper) are well-structured. High-severity findings (0): Full review (click to expand)Findings🟡 MEDIUMM1. SCOPED_TRACE labels are swapped in kCustomDefault mode --
|
| Context | Does code execute? | Assumptions hold? | Action needed? |
|---|---|---|---|
| kStandardDefault | YES | YES | N/A |
| kCustomDefault | YES | YES (labels are wrong but tests pass) | Fix labels |
| kCustomOnly | YES | YES | N/A |
| WritePreparedTxnDB | YES (TransactionDB tests exist) | YES | N/A |
| Parallel compression | YES (new tests) | YES | N/A |
| kHashSearch index_type | YES (new TEST_F) | YES | N/A |
Positive Observations
- The
BothIndexReadOptions()helper is a clean abstraction for handling kCustomOnly's single-index constraint. - New
CustomOnlySSTsSurviveLoweredIndexModetest (TEST_F, not parameterized) is excellent -- it validates the critical downgrade path. ParallelCompressionWithTrieIndexandParallelCompressionWithHashStandardIndexAndTrieUdiprovide end-to-end coverage of the parallel compression pipeline with custom indexes, which was previously untestable.- Tests that are inherently incompatible with kCustomOnly (migration paths, rollback-without-compact) are properly skipped with
ROCKSDB_GTEST_SKIP. - The test correctly verifies that kBuiltin reads on kCustomOnly SSTs fail with
IsInvalidArgument()(not silent empty results).
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/ci_review_prompt.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
Summary: Part 3 of 13 in the UDI split. Stack order: 1. #14954 Add IndexFactory compatibility names 2. #14959 Add UDI index mode API vocabulary 3. #14960 Add optional UDI builder protocols 4. #14961 Add built-in index factory wrappers 5. #14969 Add built-in index factory tests 6. #14962 Promote IndexFactory as UDI SPI 7. #14963 Wire IndexFactory through block-based tables 8. #14964 Add IndexFactory table routing tests 9. #14970 Add IndexFactory parallel routing tests 10. #14965 Account UDI blocks as index blocks 11. #14966 Support parallel AddIndexEntry in trie index 12. #14967 Cover trie index modes 13. #14968 Add IndexFactory stress and benchmark flags Previous: #14959. Next: #14961. Depends on #14959. Until #14954 and #14959 land, GitHub shows the cumulative diff against main. After those land, the intended review diff is: `zaidoon/udi-02-index-mode-api..zaidoon/udi-03-index-builder-protocols` That final review delta is 1 file with 62 insertions. What changed: - Add optional UserDefinedIndexBuilder protocols with default no-op behavior. - Keep the API additive. Runtime wiring comes in later PRs. Validation: - `git diff --check` - `make check-sources` Pull Request resolved: #14960 Reviewed By: jaykorean Differential Revision: D117536541 Pulled By: xingbowang fbshipit-source-id: affe3e49e7185af6cfdf85314bb6f2e002c84c08
Summary: Part 1 of 13 in the UDI split. Stack order: 1. facebook#14954 Add IndexFactory compatibility names 2. facebook#14959 Add UDI index mode API vocabulary 3. facebook#14960 Add optional UDI builder protocols 4. facebook#14961 Add built-in index factory wrappers 5. facebook#14969 Add built-in index factory tests 6. facebook#14962 Promote IndexFactory as UDI SPI 7. facebook#14963 Wire IndexFactory through block-based tables 8. facebook#14964 Add IndexFactory table routing tests 9. facebook#14970 Add IndexFactory parallel routing tests 10. facebook#14965 Account UDI blocks as index blocks 11. facebook#14966 Support parallel AddIndexEntry in trie index 12. facebook#14967 Cover trie index modes 13. facebook#14968 Add IndexFactory stress and benchmark flags Previous: none. Next: facebook#14959. This PR adds `include/rocksdb/index_factory.h` as a source-compatible set of new names over the current experimental UDI API: - `IndexFactoryBuilder` -> `UserDefinedIndexBuilder` - `IndexFactoryIterator` -> `UserDefinedIndexIterator` - `IndexFactoryReader` -> `UserDefinedIndexReader` - `IndexFactoryOptions` -> `UserDefinedIndexOption` - `IndexFactory` -> `UserDefinedIndexFactory` - `kIndexFactoryMetaPrefix` -> `kUserDefinedIndexPrefix` This intentionally does not change table building, table reading, SST format, OPTIONS parsing, or the C API. Existing `UserDefinedIndexFactory` subclasses that only implement the old `NewBuilder()` and `NewReader(Slice&)` shape still compile and work through the new `IndexFactory` name. Validation: - `build_tools/rockstest.sh table_test --gtest_filter='IndexFactoryCompatibilityTest.*'` - `make check-sources` - GitHub Actions PR matrix passed on the current head Pull Request resolved: facebook#14954 Reviewed By: jaykorean Differential Revision: D114358164 Pulled By: xingbowang fbshipit-source-id: 5c830dc1f9dfcf11373423a03103a595fd8ad921
Summary: Part 2 of 13 in the UDI split. Stack order: 1. facebook#14954 Add IndexFactory compatibility names 2. facebook#14959 Add UDI index mode API vocabulary 3. facebook#14960 Add optional UDI builder protocols 4. facebook#14961 Add built-in index factory wrappers 5. facebook#14969 Add built-in index factory tests 6. facebook#14962 Promote IndexFactory as UDI SPI 7. facebook#14963 Wire IndexFactory through block-based tables 8. facebook#14964 Add IndexFactory table routing tests 9. facebook#14970 Add IndexFactory parallel routing tests 10. facebook#14965 Account UDI blocks as index blocks 11. facebook#14966 Support parallel AddIndexEntry in trie index 12. facebook#14967 Cover trie index modes 13. facebook#14968 Add IndexFactory stress and benchmark flags Previous: facebook#14954. Next: facebook#14960. Depends on facebook#14954. Until facebook#14954 lands, GitHub shows the cumulative diff against main. After that lands, the intended review diff is: `zaidoon/udi-01-index-factory-compat-shim..zaidoon/udi-02-index-mode-api` That final review delta is 4 files with 52 insertions. What changed: - Add inert IndexMode and ReadIndex vocabulary to the public options headers. - Block those experimental enum fields from automatic C API generation until the explicit C API mapping lands later in the stack. - Keep behavior unchanged. Runtime wiring comes in later PRs. Validation: - `git diff --check` - `make check-sources` - `python3 tools/c_api_gen/verify_generated_up_to_date.py` - `AUTO_CLEAN=1 make check-c-api-gen` - `./c_test` Pull Request resolved: facebook#14959 Reviewed By: jaykorean Differential Revision: D116211178 Pulled By: xingbowang fbshipit-source-id: 42edd3f0991d90b0b5c90232e5023de6e3740dac
Summary: Part 3 of 13 in the UDI split. Stack order: 1. facebook#14954 Add IndexFactory compatibility names 2. facebook#14959 Add UDI index mode API vocabulary 3. facebook#14960 Add optional UDI builder protocols 4. facebook#14961 Add built-in index factory wrappers 5. facebook#14969 Add built-in index factory tests 6. facebook#14962 Promote IndexFactory as UDI SPI 7. facebook#14963 Wire IndexFactory through block-based tables 8. facebook#14964 Add IndexFactory table routing tests 9. facebook#14970 Add IndexFactory parallel routing tests 10. facebook#14965 Account UDI blocks as index blocks 11. facebook#14966 Support parallel AddIndexEntry in trie index 12. facebook#14967 Cover trie index modes 13. facebook#14968 Add IndexFactory stress and benchmark flags Previous: facebook#14959. Next: facebook#14961. Depends on facebook#14959. Until facebook#14954 and facebook#14959 land, GitHub shows the cumulative diff against main. After those land, the intended review diff is: `zaidoon/udi-02-index-mode-api..zaidoon/udi-03-index-builder-protocols` That final review delta is 1 file with 62 insertions. What changed: - Add optional UserDefinedIndexBuilder protocols with default no-op behavior. - Keep the API additive. Runtime wiring comes in later PRs. Validation: - `git diff --check` - `make check-sources` Pull Request resolved: facebook#14960 Reviewed By: jaykorean Differential Revision: D117536541 Pulled By: xingbowang fbshipit-source-id: affe3e49e7185af6cfdf85314bb6f2e002c84c08
Superseded by #14963 and #14966.
The index mode matrix, custom-only downgrade, and prefetch coverage are now included with the table routing changes in #14963. The two parallel compression cases are included with the trie parallel builder in #14966 so those tests do not precede the implementation. This test-only branch is no longer part of the UDI stack.