Skip to content

Conversation

@apoorvmittal10
Copy link
Contributor

@apoorvmittal10 apoorvmittal10 commented Oct 21, 2025

The PR fixes couple of issues which are related to the batch alignment:

  1. Base offset not found for some acquisition lock timeouts.
  2. Gaps reported by client when the topic cannot have any gaps.

The root cause was the misaligned batches when cache is full but the
fetch happens in middle of cached offsets i.e. some records are released
because of acquisition lock time out or expilicitly. As the subsequent
fetch can have lesser bytes of data but the method
lastOffsetAndMaxRecordsToAcquire aligned the lastOffsetToAcquire to
endOffset hence incorrect batches were created. The PR fixes that by
adding a min comparison.

Reviewers: Andrew Schofield aschofield@confluent.io, Abhinav Dixit
adixit@confluent.io

@github-actions github-actions bot added triage PRs from the community core Kafka Broker KIP-932 Queues for Kafka labels Oct 21, 2025
@apoorvmittal10 apoorvmittal10 added ci-approved and removed triage PRs from the community labels Oct 21, 2025
Copy link
Contributor

@adixitconfluent adixitconfluent left a comment

Choose a reason for hiding this comment

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

LGTM.

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.

lgtm

@apoorvmittal10 apoorvmittal10 merged commit 25aae99 into apache:trunk Oct 21, 2025
24 checks passed
eduwercamacaro pushed a commit to littlehorse-enterprises/kafka that referenced this pull request Nov 12, 2025
…ty (apache#20738)

The PR fixes couple of issues which are related to the batch alignment:

1. Base offset not found for some acquisition lock timeouts.
2. Gaps reported by client when the topic cannot have any gaps.

The root cause was the misaligned batches when cache is full but the
fetch happens in middle of cached offsets i.e. some records are released
because of acquisition lock time out or expilicitly. As the subsequent
fetch can have lesser bytes of data but the method
`lastOffsetAndMaxRecordsToAcquire` aligned the lastOffsetToAcquire to
`endOffset` hence incorrect batches were created. The PR fixes that by
adding a `min` comparison.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Abhinav Dixit
 <adixit@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.

3 participants