Promote IndexFactory as UDI SPI - #14962
Conversation
✅ clang-tidy: No findings on changed linesCompleted in 443.7s. |
5636137 to
5466b3a
Compare
5466b3a to
1cd1c15
Compare
8eea289 to
a2d5d2d
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 a2d5d2d SummaryWell-structured refactoring that promotes High-severity findings (0): Full review (click to expand)Findings🟡 MEDIUMM1.
|
| Context | Assumptions hold? | Action needed? |
|---|---|---|
| Partitioned index | Yes (IsPartitioned checks table_opts->index_type) | None |
| Parallel compression | Yes (SupportsParallelAddEntry=true) | None |
| User-defined timestamps | Yes (ts_sz passed through config) | None |
| TrieIndexFactory subclass | Yes (aliases + compat constants) | None |
| table_test TestUDI subclass | Yes (aliases work for all usage patterns) | None |
Verified claims:
- Type aliases preserve source compatibility: Confirmed. No
dynamic_cast<UserDefinedIndexFactory*>in codebase. Scoped enum +static constexprconstants handle ValueType change. All 15+ usage sites ofUserDefinedIndexBuilder::kValueetc. work through aliases. - On-disk format unchanged: Confirmed. Both constants equal
"rocksdb.user_defined_index.". Test pins with hardcoded literal. - IndexMode/ReadIndex not consulted: Confirmed. No code reads these fields outside options_settable_test.
Positive Observations
- On-disk format pinning test using hardcoded literals (not constants) catches accidental changes
- Direct path methods (
AddIndexEntryDirect,PrepareAddEntryDirect) bypass user-key repack overhead on hot path - Stack-local factory objects in
NewBuiltinIndexFactoryBuilderavoidshared_ptrheap allocation - Build system completeness: All three systems (Make, CMake, BUCK) properly updated
- Well-documented asymmetric API explaining why standard index reads bypass IndexFactory
ℹ️ 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
a2d5d2d to
9990bd8
Compare
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit 9990bd8 SummaryThis PR promotes High-severity findings (0): No high-severity findings. Full review (click to expand)Findings🟡 MEDIUMM1. Scoped enum
|
Part 6 of 13 in the UDI split.
Stack order:
Previous: #14969.
Next: #14963.
Depends on #14969. Until the earlier UDI PRs land, GitHub shows the cumulative diff against main. After those land, the intended review diff is:
zaidoon/udi-04-builtin-index-factory-tests..zaidoon/udi-05-promote-index-factory-spiThat final review delta is 11 files with 468 insertions and 432 deletions.
What changed:
IndexFactoryinto the public UDI SPI surface.user_defined_index.has a compatibility include path.NewBuilder()andNewReader(Slice&)overloads.Validation on the cumulative stack:
git diff --checkmake check-sourcespython3 tools/c_api_gen/verify_generated_up_to_date.pyAUTO_CLEAN=1 make -j14 builtin_index_factory_test table_test trie_index_test c_test options_settable_testAUTO_CLEAN=1 make -j14 builtin_index_factory_test table_test trie_index_test c_test options_settable_test block_fetcher_test partitioned_filter_block_test db_properties_test db_wide_blob_direct_write_test trie_index_db_test db_bench db_stress db_bench_tool_test./builtin_index_factory_test./table_test --gtest_filter='*UserDefinedIndex*:*IndexFactory*'./trie_index_test --gtest_filter='TrieIndexFactoryTest.*:TrieIndexSSTTest.*'./c_test