Skip to content
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

[v24.1.x] CORE-2752 - Fix Kafka quota throttling delay enforcement #18568

Merged

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #18218

While exempt clients are already excluded from their traffic being
recorded, they are still being throttled if the token bucket is in a
negative state because of other clients. To avoid this, exempt clients
should have a 0 throttling delay to be excluded from throttling
altogether.

(cherry picked from commit cea3a29)
Quota enforcement is currently done in a complicated and
not-Kafka-compatible way in Redpanda, and this commit intends to fix
that.

In Kafka >=2.0, client throttling is implemented in a simple way.
Brokers are meant to return how long the client is supposed to be
throttled when there is a quota violation. Then, the Kafka client is
supposed to wait until this throttling time passed, or else the broker
applies the throttle on its side.

However, currently in Redpanda the delay is enforced differently. For
produce, we enforce the throttle we would send in the response if there
was a throttle in the last response (regardless of whether the client
obeyed that throttle or not). For fetch, we always enforce the current
throttle. For ingress/egress quotas we correctly track how long the
client was supposed to be throttled, but we only do that for
ingress/egress throttling.

This commit fixes the throttling behaviour by tracking how long the
client is supposed to have waited and applying that throttle on the next
request if the client did not.

(cherry picked from commit aec585d)
@vbotbuildovich vbotbuildovich added this to the v24.1.x-next milestone May 17, 2024
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label May 17, 2024
@pgellert pgellert merged commit 9f43985 into redpanda-data:v24.1.x May 20, 2024
19 checks passed
@piyushredpanda piyushredpanda modified the milestones: v24.1.x-next, v24.1.3 May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants