Skip to content

change to check tenant limit validation only for some targets #6880

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

Merged

Conversation

SungJin1212
Copy link
Member

@SungJin1212 SungJin1212 commented Jul 14, 2025

This PR changes to check tenant limit validation when loading runtime config only for all, distributor, querier, and ruler targets. Without this, the other components could fail when the -distributor.shard-by-all-labels is false.

Which issue(s) this PR fixes:
Fixes #6741

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

if err := ul.Validate(l.cfg.Distributor.ShardByAllLabels, l.cfg.Ingester.ActiveSeriesMetricsEnabled); err != nil {
return nil, err
targetStr := l.cfg.Target.String()
if strings.Contains(targetStr, All) || strings.Contains(targetStr, Distributor) || strings.Contains(targetStr, Querier) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SungJin1212 Is querier here because it also use the shardByLabes to get user shard and query? Should we add ruler as well as it does the same?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielblando
This is due to docs. The user only enables -distributor.shard-by-all-labels to the distributor and the querier. Then the other components would fail.

Copy link
Contributor

@yeya24 yeya24 Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is required in querier for

if !d.cfg.ShardByAllLabels && len(matchers) > 0 {
.

As @danielblando mentioned we need to also include Ruler as Ruler is basically distributor + querier. We should also update the doc to mention that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielblando @yeya24
I updated both PR and Docs. Thanks for the comments!

@SungJin1212 SungJin1212 force-pushed the Skip-runtime-config-load-validation branch 2 times, most recently from 9e127cb to 03f8e2a Compare July 15, 2025 04:53
@SungJin1212 SungJin1212 force-pushed the Skip-runtime-config-load-validation branch from 03f8e2a to f7dcba4 Compare July 15, 2025 06:54
Copy link
Contributor

@danielblando danielblando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@yeya24 yeya24 merged commit 69ac3d1 into cortexproject:master Jul 23, 2025
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1.19.0] While upgrading, --distributor.shard-by-all-labels is now required on non-related components.
3 participants