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

k/replicated_partition: fixed fetch offset validation for follower fetching #16146

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

mmaslankaprv
Copy link
Member

@mmaslankaprv mmaslankaprv commented Jan 18, 2024

When consumer is requesting a fetch from the broker being a follower for given replica the fetch offset validation logic changes comparing to the validation on a leader. The out of range error should only be returned if an offset is not available locally and it is not known to be committed. That was not the case with the current code. The current code returned out of range error every time the offset was not committed on leader. This lead to many not necessary errors returned and resulted in consumer offsets being reset.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x
  • v23.1.x

Release Notes

Bug Fixes

  • fixed incorrect fetch offset validation

@piyushredpanda
Copy link
Contributor

Which all branches should this backport to @mmaslankaprv ?

ztlpn
ztlpn previously approved these changes Jan 18, 2024
src/v/kafka/server/replicated_partition.cc Outdated Show resolved Hide resolved
…tching

When consumer is requesting a fetch from the broker being a follower for
given replica the fetch offset validation logic changes comparing to the
validation on a leader. The out of range error should only be returned
if an offset is not available locally and it is not known to be
committed. That was not the case with the current code. The current code
returned out of range error every time the offset was not committed on
leader. This lead to many not necessary errors returned and resulted in
consumer offsets being reset.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
@redpanda-data redpanda-data deleted a comment from vbotbuildovich Jan 19, 2024
@mmaslankaprv mmaslankaprv merged commit 1a27dc3 into redpanda-data:dev Jan 19, 2024
17 checks passed
@mmaslankaprv mmaslankaprv deleted the fix-offset-validation branch January 19, 2024 12:40
@vbotbuildovich
Copy link
Collaborator

/backport v23.3.x

@vbotbuildovich
Copy link
Collaborator

/backport v23.2.x

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

Successfully merging this pull request may close these issues.

None yet

4 participants