Adds Redis stream trimming by time(stream ID)#3710
Merged
Conversation
Signed-off-by: Elena Kolevska <[email protected]>
7 tasks
Contributor
|
We should use a TTL time duration value as part of the component field, not a timestamp- the timestamp should be computed at runtime. Component field values should be evergreen. |
Contributor
Author
Absolutely! That was my initial idea when i started doing this, I don't remember how it changed by the time I implemented it. I was just looking into it last week. I'll update the pr. |
Signed-off-by: Elena Kolevska <[email protected]>
Contributor
Author
|
Updated |
antontroshin
reviewed
May 1, 2025
Comment on lines
+135
to
+137
| if s.StreamTTL == 0 { | ||
| return "" | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| if s.StreamTTL == 0 { | |
| return "" | |
| } | |
| if s.StreamTTL <= 0 { | |
| return "" | |
| } |
Contributor
Author
There was a problem hiding this comment.
I think we shouldn't fail silently, and it would be too late to return the error here (we use this on message send). We should probably catch it on init.
nelson-parente
approved these changes
May 5, 2025
jjcollinge
pushed a commit
to jjcollinge/components-contrib
that referenced
this pull request
May 12, 2025
Signed-off-by: Elena Kolevska <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: Nelson Parente <[email protected]> Co-authored-by: Yaron Schneider <[email protected]> Co-authored-by: Bernd Verst <[email protected]>
passuied
pushed a commit
to passuied/components-contrib
that referenced
this pull request
Feb 14, 2026
Signed-off-by: Elena Kolevska <[email protected]> Co-authored-by: Cassie Coyle <[email protected]> Co-authored-by: Nelson Parente <[email protected]> Co-authored-by: Yaron Schneider <[email protected]> Co-authored-by: Bernd Verst <[email protected]>
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.
Description
Adding the option to trim Redis streams based on timestamp. When
minIDApproxis specified in the component file entries with IDs smaller than the specified threshold are evicted, keeping the stream trimmed to only contain entries with IDs greater than or equal to this value.This can be used for time-based eviction since Redis stream IDs are in the format {timestamp-sequence}, where timestamp is in milliseconds since epoch.
Issue reference
#3664
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: