Repository navigation
Conversation
There was a problem hiding this comment.
Reviewed the Lucene-to-Pinot docId mapping change (correctness, mixed-version compatibility, concurrency). The core approach is sound and well tested.
I verified against Lucene 9.12 source that the MultiDocValues.getNumericValues + monotonic advanceExact(i) loop is correct for the mixed-leaf case: advanceExact sets docID = target before the null-value check, so the forward-only target >= docID() contract is never violated even when a leaf lacks the field, and the merged view uses the same global maxDoc-space ordinals as storedFields().document(i), so both paths address the same document. Forward compatibility also holds: doc values are not stored fields, so an older reader's stored-field iteration (and its single-stored-field assertion) is unaffected by the new index, and a newer reader falls back cleanly on older/mixed indexes. The one standing invariant to keep is no-deletions on the sealed index (maxDoc == numDocs), which is already relied on and guarded elsewhere in the reader.
LGTM — no blocking issues. Two minor, non-blocking consistency nits noted inline on the creator's fallback path. (Posting as a comment rather than a formal Approve because this review is running under the PR author's token, which GitHub does not allow to self-approve.)
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #19897 +/- ##
=============================================
- Coverage 69.37% 0.00% -69.38%
=============================================
Files 3544 3 -3541
Lines 233553 6 -233547
Branches 37353 0 -37353
=============================================
- Hits 162030 0 -162030
+ Misses 59001 6 -58995
+ Partials 12522 0 -12522
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
**Usage:** rebuild an immutable TEXT index with its existing configuration to write doc values; stored IDs remain available to older readers, and reordered IDs remain correct. **Validation:** 16 focused tests and style/license checks passed, including legacy compatibility and reordered document IDs.
Reproduce: convert a legacy TEXT index with a missing DocID; the conversion now exposes the missing-ID IOException. Cache StoredFields across fallback rows; 17 focused tests and affected-module checks passed.
9e78e98 to
2c07d0f
Compare
xiangfu0
left a comment
There was a problem hiding this comment.
Re-reviewed on the new push (2c07d0f). This revision resolves both minor nits I raised on the previous commit's buildMappingFile:
StoredFieldsis now hoisted and lazily cached once outside the loop instead of being re-created per fallback document, matching the reader'sfillDocIdMapping.- The fallback now guards a null stored docId and throws a clear
IOException("Missing Pinot document id for Lucene document: " + i)beforeInteger.parseInt, so the creator and reader paths behave consistently on a corrupt index.
It also tightens exception chaining (passing the cause instead of string-concatenating it) and adds testConvertMutableSegmentRejectsMissingStoredDocId, a focused regression test that asserts the new guard fires with the expected root-cause IOException and message.
The core doc-values mapping algorithm is unchanged from the version I verified against Lucene 9.12 source, and the delta is a clean, well-scoped follow-up. LGTM, no outstanding issues. (As before, this is posted as a comment rather than a formal Approve because the review runs under the PR author's token, which GitHub does not allow to self-approve.)
PR flow
Pinot text indexes store document IDs as numeric doc values for efficient mapping, with stored-field fallback.
AI-generated · Green: added · Yellow: modified · Red: removed · Gray: existing
Diff evidence
New immutable TEXT indexes write Pinot document IDs as numeric doc values, avoiding stored-document decompression when building mappings; old and mixed indexes retain the stored-field fallback.
Usage: rebuild an immutable TEXT index with its existing configuration to write doc values; stored IDs remain available to older readers, and reordered IDs remain correct.
Validation: 16 focused tests and style/license checks passed, including legacy compatibility and reordered document IDs.