Skip to content

Conversation

@walterddr
Copy link
Contributor

@walterddr walterddr commented Jan 27, 2022

Description

We would like to add a table level delete retention config that overwrites cluster level retention config.

This table-level retention before delete in deep store is honored as long as the table exists and wasn't deleted. Once table is deleted. We will return to use the cluster-level retention for removing residual segments.

see discussion in #8072 for more details.

@walterddr walterddr force-pushed the segment_retention_for_table branch from c96dae6 to b0c5b99 Compare January 28, 2022 17:48
@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2022

Codecov Report

Merging #8078 (4b16ccb) into master (ea2f0aa) will decrease coverage by 40.75%.
The diff coverage is 34.48%.

Impacted file tree graph

@@              Coverage Diff              @@
##             master    #8078       +/-   ##
=============================================
- Coverage     71.35%   30.60%   -40.76%     
=============================================
  Files          1617     1613        -4     
  Lines         83896    83822       -74     
  Branches      12543    12562       +19     
=============================================
- Hits          59866    25650    -34216     
- Misses        19944    55879    +35935     
+ Partials       4086     2293     -1793     
Flag Coverage Δ
integration1 28.82% <34.48%> (-0.13%) ⬇️
integration2 27.58% <12.06%> (-0.09%) ⬇️
unittests1 ?
unittests2 ?

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

Impacted Files Coverage Δ
...ig/table/SegmentsValidationAndRetentionConfig.java 0.00% <0.00%> (-95.84%) ⬇️
...he/pinot/spi/utils/builder/TableConfigBuilder.java 0.00% <0.00%> (-82.64%) ⬇️
.../controller/helix/core/SegmentDeletionManager.java 48.05% <33.33%> (-25.44%) ⬇️
...ntroller/helix/core/PinotHelixResourceManager.java 42.99% <100.00%> (-22.89%) ⬇️
...troller/helix/core/retention/RetentionManager.java 43.54% <100.00%> (-39.79%) ⬇️
.../java/org/apache/pinot/spi/utils/BooleanUtils.java 0.00% <0.00%> (-100.00%) ⬇️
...ava/org/apache/pinot/spi/config/table/FSTType.java 0.00% <0.00%> (-100.00%) ⬇️
...ava/org/apache/pinot/spi/data/MetricFieldSpec.java 0.00% <0.00%> (-100.00%) ⬇️
...va/org/apache/pinot/spi/utils/BigDecimalUtils.java 0.00% <0.00%> (-100.00%) ⬇️
...java/org/apache/pinot/common/tier/TierFactory.java 0.00% <0.00%> (-100.00%) ⬇️
... and 1123 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea2f0aa...4b16ccb. Read the comment docs.

@walterddr walterddr force-pushed the segment_retention_for_table branch from b0c5b99 to 0b1757a Compare January 28, 2022 20:50
@walterddr walterddr marked this pull request as ready for review January 28, 2022 20:50
@walterddr walterddr force-pushed the segment_retention_for_table branch from 0b1757a to 188e7d6 Compare January 30, 2022 17:01
Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work if the retention from table config is not 0. the SegmentDeletionManager.removeAgedDeletedSegments() does not take the config from the table config

@walterddr
Copy link
Contributor Author

This does not work if the retention from table config is not 0. the SegmentDeletionManager.removeAgedDeletedSegments() does not take the config from the table config

Ahh. GOOD POINT! Didn't really thought of that. let me fix this.

@walterddr walterddr force-pushed the segment_retention_for_table branch 3 times, most recently from 3f0837f to 61dfc07 Compare February 2, 2022 16:07
Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need to do postprocess() to remove the orphan deleted segments. E.g. User deletes a table, the table config won't exist in the next run, so removeAgedDeletedSegments() won't be called.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just pass in the tableConfig to this method. Calling _segmentDeletionManager.getRetentionFromTableConfig(tableConfig) then passing it in is slightly confusing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO passing in tableConfig will be more confusing because, it is possible to use a retentionMs that is not coming from tableConfig; and also there's no point passing in table name separately either.

Let's not restrict the API to only work on tableConfig. segmentDeletionManager only needs a zkpath and deep store path to work IMO.

noted that once table is deleted, we no longer honor the overwrite from table config because the table has been deleted
@walterddr walterddr force-pushed the segment_retention_for_table branch from 4b16ccb to 1832cd0 Compare February 4, 2022 17:44
_retentionTimeValue = retentionTimeValue;
}

public String getDeletedSegmentRetentionTimeUnit() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not introduce a time unit config here. Retention can be specified in time period like "2d" or "3h"
We can use TimeUtils.convertPeriodToMillis() to translate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also change the existed retentionTimeUnit/retentionTimeValue too? I felt like we should make them consistent

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In an installation-free world, that will be a nice thing to do. But many of us are running live installations of Pinot now. So, let us not change existing configurations casually. We can migrate the existing configrations to a new method, but this i s not the PR to do it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. plz kindly take another look.

@walterddr
Copy link
Contributor Author

discussed with @Jackie-Jiang offline and we decided to change how we store the "retention period" overwrite by appending it to the DELETED segment filename during the move operation. will close this one and create a new PR to do so

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.

4 participants