Skip to content

Conversation

@apoorvmittal10
Copy link
Contributor

@apoorvmittal10 apoorvmittal10 commented Dec 2, 2025

Merges contiguous AcquiredRecords with the same delivery count into
single records.

The PR accumulates multiple offsets in a single batch only if the
offsets are part of same in-flight batch i.e. if cache has 0-4, and 5-9
and the records acquired are 3,4,5,6, with same delivery count, then
output shall be [3-4],[5-6]. This has been done to make sure that
offsets accumulation is not past the batch size in request. The
in-flight batches originally formed on the broker are created as per
the batch size from the client hence accumulating from single batch
is safe.

However, if in a same share group multiple clients request with
different batch sizes then there would be discrepancy. Having said that,
the similar problem might occur with complete batch acquisition in this
case hence that should be fixed separately, if needed.

Reviewers: Andrew Schofield aschofield@confluent.io

@github-actions github-actions bot added triage PRs from the community core Kafka Broker KIP-932 Queues for Kafka labels Dec 2, 2025
@apoorvmittal10 apoorvmittal10 added ci-approved and removed triage PRs from the community labels Dec 2, 2025
@AndrewJSchofield AndrewJSchofield self-requested a review December 2, 2025 22:19
Copy link
Member

@AndrewJSchofield AndrewJSchofield left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Looks good to me.

@apoorvmittal10 apoorvmittal10 merged commit 43062a0 into apache:trunk Dec 3, 2025
28 checks passed
apoorvmittal10 added a commit to apoorvmittal10/kafka that referenced this pull request Dec 3, 2025
Merges contiguous AcquiredRecords with the same delivery count into
single records.

The PR accumulates multiple offsets in a single batch only if the
offsets are part of same in-flight batch i.e. if cache has 0-4, and 5-9
and the records acquired are 3,4,5,6, with same delivery count, then
output shall be [3-4],[5-6].  This has been done to make sure that
offsets accumulation is not past  the `batch size` in request. The
in-flight batches originally formed on  the broker are created as per
the `batch size` from the client hence  accumulating from single batch
is safe.

However, if in a same share group multiple clients request with
different batch sizes then there would be discrepancy. Having said that,
the similar problem might occur with complete batch acquisition in this
case hence  that should be fixed separately, if needed.

Reviewers: Andrew Schofield <aschofield@confluent.io>
apoorvmittal10 added a commit that referenced this pull request Dec 3, 2025
Merges contiguous AcquiredRecords with the same delivery count into
single records.

The PR accumulates multiple offsets in a single batch only if the
offsets are part of same in-flight batch i.e. if cache has 0-4, and 5-9
and the records acquired are 3,4,5,6, with same delivery count, then
output shall be [3-4],[5-6].  This has been done to make sure that
offsets accumulation is not past  the `batch size` in request. The
in-flight batches originally formed on  the broker are created as per
the `batch size` from the client hence  accumulating from single batch
is safe.

However, if in a same share group multiple clients request with
different batch sizes then there would be discrepancy. Having said that,
the similar problem might occur with complete batch acquisition in this
case hence  that should be fixed separately, if needed.

Reviewers: Andrew Schofield <aschofield@confluent.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved core Kafka Broker KIP-932 Queues for Kafka

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants