-
Notifications
You must be signed in to change notification settings - Fork 823
Fixed max global series per user/metric limit when shuffle sharding is enabled #3369
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
Fixed max global series per user/metric limit when shuffle sharding is enabled #3369
Conversation
|
de8185a
to
604ba5b
Compare
|
||
- `max_series_per_query` / `-ingester.max-series-per-query` | ||
- `max_samples_per_query` / `-ingester.max-samples-per-query` | ||
|
||
Limits on the number of timeseries and samples returns by a single ingester during a query. | ||
|
||
- `max_metadata_per_user` / `-ingester.max-metadata-per-user` |
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.
Metadata limits were not documented, do I've added it.
} | ||
|
||
func (f *flushTransferer) Flush() {} | ||
func (f *flushTransferer) TransferOut(ctx context.Context) error { |
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.
Unless I'm missing anything, the logic of this flushTransferer
was not used, so I've removed it in favour of the tiny nopFlushTransferer
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.
LGTM, thanks for the fast turnaround.
if numIngesters > 0 { | ||
return int((float64(globalLimit) / float64(numIngesters)) * float64(l.replicationFactor)) | ||
if numIngesters == 0 { | ||
return 0 |
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.
So now local limit is 0 if num healthy ingesters is zero, right? I think that's probably okay, but the comment above is confusing now, since that's not what "ignore the global limit" makes me think.
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.
0 means unlimited.
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 see, thanks.
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.
Let me also outline the logic hasn't changed. If the ring client doesn't see any ingester (0), the global rate limit was temporarily disabled even before.
@@ -17,65 +18,124 @@ func TestSeriesLimit_maxSeriesPerMetric(t *testing.T) { | |||
maxLocalSeriesPerMetric int | |||
maxGlobalSeriesPerMetric int | |||
ringReplicationFactor int | |||
ringZoneAwarenessEnabled bool |
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.
Would it be possible to refactor limiter code to avoid the same repeated tests? (In a follow-up PR, if at all).
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 think could be possible. Added to my TODO list for a separate PR.
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.
LGTM, good job!
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.
Thanks for the fix, and also for updating the docs for max_metadata_per_user and max_metadata_per_metric.
…s enabled Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
43c3a84
to
5df9485
Compare
What this PR does:
The max global series per user/metric limit doesn't work correctly when shuffle sharding and shard-by-all-labels are both enabled because it considers series to be distributed across all ingesters, while actually series are only distributed across a subset of ingesters (the shard size).
Which issue(s) this PR fixes:
Fixes #3367
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]