-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix: skip streams over limits in dry-run mode #17114
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
fix: skip streams over limits in dry-run mode #17114
Conversation
pkg/distributor/distributor.go
Outdated
// TODO(grobinson): This will be removed, as we only want to fail the request | ||
// when specific limits are exceeded. | ||
return nil, httpgrpc.Error(http.StatusBadRequest, "request exceeded limits") | ||
if _, ok := status.FromError(err); ok { |
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.
This tells us if it is an httpgrpc error or not.
b5073b2
to
f4ddd20
Compare
3e92b42
to
1a62b64
Compare
047978b
to
cba8c04
Compare
cba8c04
to
a897f0d
Compare
f8b91ed
to
df10a75
Compare
df10a75
to
3ebdc2f
Compare
metadata := mockKafkaClient.recordsPerTopic[".metadata"] | ||
require.Equal(t, test.expectedMetadataRecords, len(metadata)) |
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.
nit. Do we need to save the mock records in the mock producer for other tests? I guess a counter would be sufficient right?
f0d5942
to
894d03e
Compare
Contains backports of these commits: ``` 2cde9b1 fix: skip streams over limits in dry-run mode (#17114) 805125c fix: fix a bug where limits were incorrect after #16937 (#17224) d106042 fix: fix bug where expectedStreamUsageRequest was not used (#17223) 69aeda1 feat: add tests for enforcing limits in distributors (#17124) ```
What this PR does / why we need it:
This pull request fixes a bug when distributors were running with
IngestLimitsDryRunEnabled
where streams that were over the max stream limits would still be written to the metadata topic, meaning those streams would be included in the existing streams rather than outside the max stream limit.This is stacked on top of #17124.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
deprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR