-
Notifications
You must be signed in to change notification settings - Fork 812
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
Prevent failed ingestion from affecting rate limiting in distributor. #3825
Conversation
79ec0c6
to
d38b122
Compare
Fixed a couple of typos in comments, and added issue number to changelog. |
35f5a4f
to
76570af
Compare
Rebase, change issue number to PR number. |
Change the handling of the rate limiting in the distributor such that when the ingestion fails, the reservation in the rate limiter is canceled, returning the tokens for future use in the proceeding requests. Signed-off-by: Steve Simpson <[email protected]>
76570af
to
0869be7
Compare
Fix lint |
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.
Good job! I left a comment, but overall LGTM!
Signed-off-by: Steve Simpson <[email protected]>
6cf0c29
to
29f0177
Compare
Signed-off-by: Steve Simpson <[email protected]>
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.
Good job, thanks! LGTM (modulo a couple of nits)
Signed-off-by: Steve Simpson <[email protected]>
Signed-off-by: Steve Simpson <[email protected]>
65c1abd
to
a42432c
Compare
Signed-off-by: Steve Simpson <[email protected]>
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!
What happens in the case that some samples succeed and some fail? |
…ributor. (cortexproject#3825)" This reverts commit 9ba848b. Signed-off-by: Marco Pracucci <[email protected]>
…ributor. (#3825)" (#3948) This reverts commit 9ba848b. Signed-off-by: Marco Pracucci <[email protected]>
…ributor. (cortexproject#3825)" (cortexproject#3948) This reverts commit 9ba848b. Signed-off-by: Marco Pracucci <[email protected]> (cherry picked from commit 6aa2a69)
* Revert "Prevent failed ingestion from affecting rate limiting in distributor. (#3825)" (#3948) This reverts commit 9ba848b. Signed-off-by: Marco Pracucci <[email protected]> (cherry picked from commit 6aa2a69) * Update VERSION Signed-off-by: Peter Štibraný <[email protected]> Co-authored-by: Marco Pracucci <[email protected]>
What this PR does:
Change the handling of the rate limiting in the distributor such that when the ingestion fails, the reservation in the rate limiter is canceled, returning the tokens for future use in the proceeding requests.
In the process, a change was made to the
util/limiter
package to useReserveN
. To match the semantics ofApplyN
, we have to check theDelay()
on the returnedrate.Reservation
is zero. I also chose to only expose a limited subset of the rate.Reservation struct (to useCancelAt
), following from how the existing code does not expose thex/time/rate
package.Unit tests added to
rate_limiter_test.go
anddistributor_test.go
to check the cancel behaviour.Which issue(s) this PR fixes:
Fixes #3804
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]