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

[v22.3.x] cloud_storage: fix kafka::offset lookup in partition_manifest #8126

Merged

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #8110
Fixes #8125,

This is helpful for debugging issues with segment selection on the fetch
path.

(cherry picked from commit 0161370)
When serving a fetch request by a kafka::offset, we previously used the
`partition_manifest` to perform a segment lookup by
`kafka::offset_cast(ko)` first in order to traverse the segments forward
to find the actual segment that contained `ko`.

This doesn't work when the manifest has been truncated, e.g. if the
casted offset falls before the start of the manifest, we would
previously return that no segment exists for the fetch. This could
result in segments erronesouly not being returned, and fetches
erroneously being met with no data when some existed.

This commit fixes the behavior to no longer use the casted segment
lookup and adds some test coverage for kafka::offset lookups.

Fixes redpanda-data#7708

(cherry picked from commit 10f87c1)
@vbotbuildovich vbotbuildovich added this to the v22.3.x-next milestone Jan 9, 2023
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Jan 9, 2023
@andrwng andrwng marked this pull request as ready for review January 13, 2023 07:46
@andrwng andrwng merged commit 3cbd8ef into redpanda-data:v22.3.x Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants