This repository was archived by the owner on Aug 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 107
calculate TTL relative to now when inserting into cassandra #1448
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5904a9a
when inserting we want to adjust the ttl to make it relative to now
replay a4a9675
determine chunk span to calculate its ttl on insert
replay 3f3486d
saving one allocation
replay aca9ef7
removing unused error to save another allocation
replay b28f095
Rename method SpanOfChunk to ExtractChunkSpan
replay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern with using MaxChunkSpan is that it makes the minimum ttl of data at MaxChunkSpan. eg, if you want raw data stored for 1h, but also have rollups being stored for longer and those rollups use a chunkSpan of 6h, then the raw data will be stored for a lot longer then intended.
This is not a concern for any of our use cases, but might cause problems for other users and perhaps end2end tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a valid concern, but I'm not sure how to improve that. There are basically two possibilities:
I'm leaning towards 1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've given
1)
a tryThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran another test with the latest version. I've started MT with an empty cassandra instance and this schema:
Then I fed it with 72h of data for one metric. It created two tables for the two different TTLs
metric_1
/metric_32
. All the TTLs in these two tables look like what we want. In each table the TTLs are nicely adjusted to the span: