Honor replacedSegmentsRetentionPeriod for all table types#18583
Open
krishan1390 wants to merge 1 commit into
Open
Honor replacedSegmentsRetentionPeriod for all table types#18583krishan1390 wants to merge 1 commit into
krishan1390 wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DefaultLineageManager#shouldDeleteReplacedSegmentspreviously short-circuited on non-REFRESH tables and deleted replaced source segments immediately, ignoringreplacedSegmentsRetentionPeriod. This drops that gate so APPEND tables (and any other replacement protocol that writes aCOMPLETEDlineage 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
testAppendTableHonorsReplacedSegmentsRetentionPeriodpins both sides of the boundary — a recent lineage entry is retained, an old one is deleted — using a single lineage with two entries.This is a default-changing behavior for APPEND tables on rolling upgrade:
replacedSegmentsRetentionPeriod.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-incompatlabel.Test plan
./mvnw -pl pinot-controller -am test -Dtest=DefaultLineageManagerTest./mvnw spotless:apply checkstyle:check license:check -pl pinot-controller🤖 Generated with Claude Code