Skip to content

Preserve queryableDocIds tracking when preloading upsert segment with no valid docs#18527

Merged
xiangfu0 merged 3 commits into
apache:masterfrom
deepthi912:fix-empty-queryable-doc-ids-on-preload
May 19, 2026
Merged

Preserve queryableDocIds tracking when preloading upsert segment with no valid docs#18527
xiangfu0 merged 3 commits into
apache:masterfrom
deepthi912:fix-empty-queryable-doc-ids-on-preload

Conversation

@deepthi912
Copy link
Copy Markdown
Collaborator

Context:
When an immutable upsert segment is preloaded via BasePartitionUpsertMetadataManager.doPreloadSegment() and its validdocids.bitmap.snapshot file deserializes to an empty bitmap, the fast-path early-return calls:

segment.enableUpsert(this, new ThreadSafeMutableRoaringBitmap(), null);

For tables that track queryable docs (i.e. deleteRecordColumn is configured), passing null for queryableDocIds sets _queryableDocIds = null on ImmutableSegmentImpl. This violates the invariant held everywhere else in upsert: when queryable tracking is enabled, the bitmap must be non-null (empty is fine, null is not).

@deepthi912 deepthi912 added upsert Related to upsert functionality bug Something is not working as expected labels May 18, 2026
@deepthi912 deepthi912 requested a review from Jackie-Jiang May 18, 2026 23:26
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.75%. Comparing base (2910445) to head (66fddc2).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #18527   +/-   ##
=========================================
  Coverage     63.75%   63.75%           
  Complexity     1932     1932           
=========================================
  Files          3292     3292           
  Lines        201470   201471    +1     
  Branches      31316    31317    +1     
=========================================
+ Hits         128442   128447    +5     
- Misses        62735    62736    +1     
+ Partials      10293    10288    -5     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-21 63.75% <100.00%> (+<0.01%) ⬆️
temurin 63.75% <100.00%> (+<0.01%) ⬆️
unittests 63.75% <100.00%> (+<0.01%) ⬆️
unittests1 55.79% <0.00%> (-0.01%) ⬇️
unittests2 35.26% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xiangfu0 xiangfu0 merged commit a986489 into apache:master May 19, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is not working as expected upsert Related to upsert functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants