-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark posting group lazy if it has a lot of keys #7961
Merged
yeya24
merged 8 commits into
thanos-io:main
from
yeya24:skip-posting-group-too-many-keys
Dec 10, 2024
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8b1df7e
mark posting group lazy if it has a lot of add keys
yeya24 c0310c8
update docs
yeya24 980f8de
rename labels
yeya24 530a833
changelog
yeya24 61beef9
change to use max key series ratio
yeya24 49c7427
update docs
yeya24 ed47432
mention metrics
yeya24 088763f
update docs
yeya24 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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
How could the user know what the appropriate number here should be? Could we calculate & use some pre-defined threshold?
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 good question... For us, we actually added some additional logs in our fork to log cardinalities for those queries that triggered lazy posting optimization. So that we have insights about the size. But logging those information in Thanos might be too expensive.
Do you think it would help if we introduce a native histogram to track posting group total posting sizes and number of keys?
I thought about making it a percentage value based on your block size. For example, 1% of your number of series, or 10% of your total label pairs but I couldn't find a good way to define that. Percentage will make the threshold very small for small blocks even though they don't cause any impact.
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.
@GiedriusS One idea we had is to mark lazy if number of keys is much larger than the max possible series for the query (or smallest cardinality posting group).
For a query, if the matcher with the smallest posting could match 1000 series. Then it can have at most 1000 different values for a single label. If the current posting group matches 100K keys it means we match at most 1K values and throw away 99K keys. Do you think this is a good metric? We can start with threshold like 100 and tune it accordingly