Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

KAFKA-20019: Fetch responses can exceed maxBytes when mixing local and tiered storage partitions #21211

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

Open
nandini12396 wants to merge 1 commit into apache:trunk
base: trunk
Choose a base branch
Loading
from nandini12396:KAFKA-20019

Conversation

@nandini12396
Copy link
Contributor

@nandini12396 nandini12396 commented Dec 24, 2025

When a fetch request spans multiple partitions with a mix of local and remote (tiered storage) data, the broker can return more than fetch.max.bytes in a single response. For example, with fetch.max.bytes=1MB:

  • If partition 1 returns 1 MB from local storage
  • And partition 2 returns 1 MB from tiered storage
  • The total response can be 2 MB, exceeding the configured limit

This can cause consumer-side issues if consumers aren't configured to accept payloads this large.

...d tiered storage partitions
When a fetch request spans multiple partitions with a mix of local and remote (tiered storage) data, the broker can return more than `fetch.max.bytes` in a single response. For example, with `fetch.max.bytes=1MB`:
- If partition 1 returns 1 MB from local storage
- And partition 2 returns 1 MB from tiered storage
- The total response can be 2 MB, exceeding the configured limit
This can cause consumer-side issues if consumers aren't configured to accept payloads this large.
@github-actions github-actions bot added triage PRs from the community core Kafka Broker small Small PRs labels Dec 24, 2025
@apoorvmittal10 apoorvmittal10 added ci-approved and removed triage PRs from the community labels Dec 24, 2025
Copy link
Contributor

Though I haven't read the implementation yet but fetch.max.bytes is a soft limit which can anywways be exceeded when a single log batch is of higher size than fetch.max.bytes. However, it would be good to fix in other cases where batches are smaller. I think the latter is intended in the current PR, correct?

Copy link
Contributor Author

nandini12396 commented Dec 26, 2025
edited
Loading

Thanks for your comment! Yes, correct - this fixes the aggregate size accounting issue when combining multiple smaller fetches across local and tiered storage partitions, not the single-large-batch case.

Though I haven't read the implementation yet but fetch.max.bytes is a soft limit which can anywways be exceeded when a single log batch is of higher size than fetch.max.bytes. However, it would be good to fix in other cases where batches are smaller. I think the latter is intended in the current PR, correct?

Copy link
Contributor Author

@showuon @kamalcph please can I get a review for this one? Thanks!

Copy link
Contributor

@nandini12396

Thanks for the patch! I couldn't understand the issue and patch. Could you write a unit / integration test to show the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

ci-approved core Kafka Broker small Small PRs

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /