Skip to content

Honor replacedSegmentsRetentionPeriod for all table types#18583

Open
krishan1390 wants to merge 1 commit into
apache:masterfrom
krishan1390:pr/replaced-segments-retention-all-types
Open

Honor replacedSegmentsRetentionPeriod for all table types#18583
krishan1390 wants to merge 1 commit into
apache:masterfrom
krishan1390:pr/replaced-segments-retention-all-types

Conversation

@krishan1390
Copy link
Copy Markdown
Contributor

@krishan1390 krishan1390 commented May 26, 2026

Summary

DefaultLineageManager#shouldDeleteReplacedSegments previously short-circuited on non-REFRESH tables and deleted replaced source segments immediately, ignoring replacedSegmentsRetentionPeriod. This drops that gate so APPEND tables (and any other replacement protocol that writes a COMPLETED lineage entry) get the same configurable grace window before their source segments are dropped.

This was originally added in #7995 without any real justification for why its not safe for APPEND tables. #18282 made it configurable.

In this PR we are reusing the same config for APPEND tables too (essentially for all tables)

The renamed test testAppendTableHonorsReplacedSegmentsRetentionPeriod pins both sides of the boundary — a recent lineage entry is retained, an old one is deleted — using a single lineage with two entries.

⚠️ Backward-compat note

This is a default-changing behavior for APPEND tables on rolling upgrade:

  • Before: APPEND tables deleted replaced source segments immediately, regardless of replacedSegmentsRetentionPeriod.
  • After: APPEND tables retain replaced source segments for the configured period (default: 1 day, from REPLACED_SEGMENTS_RETENTION_IN_MILLIS).

Operators who relied on the old "delete immediately" behavior — typically those on tight storage budgets — can restore it explicitly by setting replacedSegmentsRetentionPeriod: "0d" on the table.

Worth a release-notes mention and the backward-incompat label.

Test plan

  • ./mvnw -pl pinot-controller -am test -Dtest=DefaultLineageManagerTest
  • ./mvnw spotless:apply checkstyle:check license:check -pl pinot-controller
  • Manual: confirm REFRESH-table replacement behavior is unchanged (existing tests cover this).

🤖 Generated with Claude Code

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.75%. Comparing base (0a8ac02) to head (7febd96).

❗ There is a different number of reports uploaded between BASE (0a8ac02) and HEAD (7febd96). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (0a8ac02) HEAD (7febd96)
java-21 5 4
unittests 2 1
temurin 5 4
unittests2 1 0
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18583      +/-   ##
============================================
- Coverage     64.27%   56.75%   -7.52%     
+ Complexity     1137        7    -1130     
============================================
  Files          3335     2567     -768     
  Lines        205898   148958   -56940     
  Branches      32129    24099    -8030     
============================================
- Hits         132333    84547   -47786     
+ Misses        62931    57219    -5712     
+ Partials      10634     7192    -3442     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-21 56.75% <ø> (-7.52%) ⬇️
temurin 56.75% <ø> (-7.52%) ⬇️
unittests 56.75% <ø> (-7.52%) ⬇️
unittests1 56.75% <ø> (-0.01%) ⬇️
unittests2 ?

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.

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.

2 participants