Parquet: Skip parquet conversion for blocks with too many labels#7524
Open
siddarth2810 wants to merge 9 commits into
Open
Parquet: Skip parquet conversion for blocks with too many labels#7524siddarth2810 wants to merge 9 commits into
siddarth2810 wants to merge 9 commits into
Conversation
Signed-off-by: Siddarth Gundu <siddarthg0910@gmail.com>
- Add max-block-label-names limit, blocks exceeding it get a no-convert marker instead of being converted. Signed-off-by: Siddarth Gundu <siddarthg0910@gmail.com>
Signed-off-by: Siddarth Gundu <siddarthg0910@gmail.com>
Signed-off-by: Siddarth Gundu <siddarthg0910@gmail.com>
Signed-off-by: Siddarth Gundu <siddarthg0910@gmail.com>
…correctly Signed-off-by: Siddarth Gundu <siddarthg0910@gmail.com>
…test Signed-off-by: Siddarth Gundu <siddarthg0910@gmail.com>
friedrichg
requested changes
May 19, 2026
Member
friedrichg
left a comment
There was a problem hiding this comment.
if it is experimental, we need to update docs/configuration/v1-guarantees.md too
| } | ||
| continue | ||
| } | ||
| level.Info(logger).Log("msg", "skipping parquet conversion for block with too many label names", "block", b.ULID.String(), "label_names", labelNamesCount, "limit", maxBlockLabelNames) |
Member
There was a problem hiding this comment.
Make this a debug log.
and pair it with a metric for skipped blocks like
c.metrics.skippedBlocks.WithLabelValues(userID, "too_many_labels").Inc()
Contributor
Author
There was a problem hiding this comment.
I see. I'll add a new metric for keeping track of skipped blocks. Thanks a lot :)
| func WriteNoConvertMark(ctx context.Context, id ulid.ULID, userBkt objstore.Bucket, labelNamesCount int, maxBlockLabelNames int) error { | ||
| noConvertMarker := NoConvertMark{ | ||
| Version: CurrentNoConvertMarkVersion, | ||
| Reason: "too_many_labels", |
Member
There was a problem hiding this comment.
Make "too_many_labels" a constant that you use everywhere. You have a couple places
Contributor
Author
There was a problem hiding this comment.
Got it. I'll change this
- Add a new cortex_parquet_converter_blocks_skipped_total counter with user and reason labels - Extract "too_many_labels" to a constant to avoid string duplication Signed-off-by: Siddarth Gundu <siddarthg0910@gmail.com>
Signed-off-by: Siddarth Gundu <siddarthg0910@gmail.com>
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:
If a TSDB block exceeds a configurable threshold of distinct label names, the converter writes a
parquet-no-convert-mark.jsonmarker and skips the block.paruqet-converter.max-block-label-nameslimitWhich issue(s) this PR fixes:
Fixes #7195
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]docs/configuration/v1-guarantees.mdupdated if this PR introduces experimental flags