fix: move the check for duplicate series up the call stack to fix an issue when retention is enabled - #17663
Merged
Merged
Conversation
… when retention is enabled
paul1r
approved these changes
May 12, 2025
paul1r
left a comment
Collaborator
There was a problem hiding this comment.
lgtm, we should probably add a test case for this longer term, for validation of this behavior.
This was referenced Jul 21, 2025
This was referenced Aug 5, 2025
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.
What this PR does / why we need it:
Deletion supports saving the progress of a series to be able to skip series which are already been processed. However, it requires all the chunks for a series to be sent at once to make it easier to save the progress.
Since both retention and deletion implement the same interfaces, the table iterator asks them to decide whether a series should be skipped. So, if retention is enabled and it says no to skipping the series while deletion has already processed it, we have to iterate through the chunks in that series again. While deletion still efficiently handles it, at the end, we again try to mark the series as processed, which then triggers the check for duplicate series and fails the operation.
This PR fixes the issue by moving the code to see a series only once in a table up the stack without persisting it. We just want a single series to be seen only once with all its chunks instead of a partial stream seen multiple times.