Skip to content

Fix NullPointerException when offloading a consuming upsert segment with metadataTTL - #20385

Open
Indian-boult wants to merge 1 commit into
apache:masterfrom
Indian-boult:fix/upsert-ttl-offload-consuming-segment
Open

Indian-boult wants to merge 1 commit into
apache:masterfrom
Indian-boult:fix/upsert-ttl-offload-consuming-segment

Conversation

@Indian-boult

Copy link
Copy Markdown
Contributor

Fixes #20384

isOutOfMetadataTTL now returns false for a MutableSegment. A consuming segment has no column metadata to read its max comparison value from, and it holds the newest records of its partition, so it is always within TTL. Offloading it now removes its primary keys like any other segment that is within TTL.

ConcurrentMapPartitionUpsertMetadataManagerTest.testOffloadConsumingSegmentWithMetadataTTL builds a real MutableSegmentImpl with metadataTTL 30, indexes three rows and offloads it. On master it throws the NullPointerException from the issue. With the change it passes, and so do the 87 tests in the upsert metadata manager test classes. Spotless, checkstyle and license checks pass on pinot-segment-local.

removeSegment asks isOutOfMetadataTTL whether to keep the metadata of
the segment, and isOutOfMetadataTTL reads the max comparison value from
the column metadata. A consuming segment has no column metadata, so
offloading it from a table with metadataTTL threw a
NullPointerException and the CONSUMING to OFFLINE or DROPPED
transition failed. A consuming segment holds the latest records of the
partition, so it is now always treated as within TTL and its primary
keys are removed.

Fixes apache#20384
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 31.49%. Comparing base (4b27e22) to head (7733fa4).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...cal/upsert/BasePartitionUpsertMetadataManager.java 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (4b27e22) and HEAD (7733fa4). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (4b27e22) HEAD (7733fa4)
unittests1 2 1
unittests 2 1
java-25 2 1
temurin 2 1
Additional details and impacted files
@@              Coverage Diff              @@
##             master   #20385       +/-   ##
=============================================
- Coverage     61.23%   31.49%   -29.75%     
  Complexity        1        1               
=============================================
  Files          2793     2793               
  Lines        180530   180536        +6     
  Branches      30232    30234        +2     
=============================================
- Hits         110556    56853    -53703     
- Misses        60642   118424    +57782     
+ Partials       9332     5259     -4073     
Flag Coverage Δ
java-25 31.49% <0.00%> (-29.75%) ⬇️
temurin 31.49% <0.00%> (-29.75%) ⬇️
unittests 31.49% <0.00%> (-29.75%) ⬇️
unittests1 31.49% <0.00%> (-29.75%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offloading a consuming segment of an upsert table with metadataTTL throws a NullPointerException

2 participants