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 querying end offset of an empty log #17789

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

mmaslankaprv
Copy link
Member

@mmaslankaprv mmaslankaprv commented Apr 11, 2024

When querying offset translator we are relying on the property of the end offset or high watermark being exclusive. Changed the behavior of log end offset to increment offset in Raft offset space and then translate to achieve correct behavior when log is ended with a batch subjected to offset translation.

Fixes: #16612

Credits for @ztlpn for pointing me in the right direction.

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

Release Notes

Bug Fixes

  • fixes small inconsistency between Kafka and Redpanda when trying to query end_offset of an empty log

When querying offset translator we are relying on the property of the
end offset or high watermark being exclusive. Changed the behavior of
log end offset to increment offset in Raft offset space and then
translate to achieve correct behavior when log is ended with a batch
subjected to offset translation.

Fixes: redpanda-data#16612

Signed-off-by: Michał Maślanka <michal@redpanda.com>
@vbotbuildovich
Copy link
Collaborator

vbotbuildovich commented Apr 11, 2024

@mmaslankaprv mmaslankaprv merged commit a265243 into redpanda-data:dev Apr 11, 2024
20 checks passed
@mmaslankaprv mmaslankaprv deleted the fix-16612 branch April 11, 2024 15:04
@vbotbuildovich
Copy link
Collaborator

/backport v23.3.x

@vbotbuildovich
Copy link
Collaborator

/backport v23.2.x

@vbotbuildovich
Copy link
Collaborator

Failed to create a backport PR to v23.3.x branch. I tried:

git remote add upstream https://github.com/redpanda-data/redpanda.git
git fetch --all
git checkout -b backport-pr-17789-v23.3.x-273 remotes/upstream/v23.3.x
git cherry-pick -x fd04fd72c8f0d37e1e480c6f3a32b6ad53ae270f

Workflow run logs.

@vbotbuildovich
Copy link
Collaborator

Failed to create a backport PR to v23.2.x branch. I tried:

git remote add upstream https://github.com/redpanda-data/redpanda.git
git fetch --all
git checkout -b backport-pr-17789-v23.2.x-492 remotes/upstream/v23.2.x
git cherry-pick -x fd04fd72c8f0d37e1e480c6f3a32b6ad53ae270f

Workflow run logs.

@TomaszGaweda
Copy link

Hey :) Is it possible to backport this fix to 23.1. line or it's completely unsupported at this point?

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.

Incorrect seek() handling in 23.1.20
4 participants