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

[LI-HOTFIX] Return valid data during throttling #514

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

CCisGG
Copy link

@CCisGG CCisGG commented Jun 6, 2024

BUGS=LIKAFKA-59133

Description

In KIP-219, people decided to changed the throttling behavior from "wait for throttleTimeMs before sending back response" to "return immediately with empty response and mute the channel by throttleTimeMs". While it is reasonable in terms of it strictly limit the Fetch Bytes Rate to below the quota value, it introduces a new problem that the request already takes the broker system resource but the consumer does not get any useful data. As a result, the broker could be busy with handling throttled requests and keep throttle incoming request, while none of the request has data and consumers get stuck.

To mitigate it, we propose to actually return the data in the throttled response. By doing it, the consumer can still slowly proceed even though all the requests are throttled.

Summary of testing strategy

We likely need to add some tests in our certification process. To force throttling happens, we need to set a low quota. During the throttling, we need to assert:

  1. The requests got throttled actually contains valid message and the consumer can proceed
  2. The throttled client are backed off by throttleTimeMs.

Copy link

@groelofs groelofs left a comment

Choose a reason for hiding this comment

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

This seems straightforward as a fix (and much simpler than I was expecting), but approval is conditional on demonstrating that it actually does fix the "stuck consumers" issue while not completely bypassing quota-enforcement. IOW, we'll want to test this carefully.

Copy link

@Yellow-Rice Yellow-Rice left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for the patch!

@CCisGG CCisGG merged commit d4f6f91 into 3.0-li Jun 6, 2024
25 checks passed
@CCisGG CCisGG deleted the 20240605_fill_data_when_throttling branch June 6, 2024 21:38
CCisGG pushed a commit that referenced this pull request Jun 11, 2024
CCisGG added a commit that referenced this pull request Jun 11, 2024
This reverts commit d4f6f91.

For the "consumer get stuck during throttling" issue, we realized there is a safer solution than the above commit. The alternative solution is to increase the maxThrottleTime by increase the quota window size, which should effectively reduce the overall throughput. We will go with that path first. If the issue is still not mitigated, we can fallback to this solution and re-apply this patch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants