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

kafka: fix timequery when local log is empty #21312

Merged

Conversation

nvartolomei
Copy link
Contributor

Before querying local log we bump the timequery_config::min_offset. This offset is inclusive. When local log is empty, the min_offset points one unit above the end of the log. In this PR, we add a check to return early when this is the case.

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
  • v24.1.x
  • v23.3.x
  • v23.2.x

Release Notes

Bug Fixes

  • Fix timequery failing when requested timestamp is in the future and local log is empty.

Before querying local log we bump the `timequery_config::min_offset`.
This offset is inclusive. When local log is empty, the min_offset points
one unit above the end of the log. In this PR, we add a check to return
early when this is the case.
@nvartolomei nvartolomei requested a review from andrwng July 9, 2024 19:40
@nvartolomei nvartolomei requested a review from Lazin July 9, 2024 19:40
Comment on lines +648 to +652
# Restart the cluster to force segment roll. The newly created segment
# will have no user data which is what we want to test.
self.redpanda.restart_nodes(self.redpanda.nodes)
wait_until(lambda: len(list(rpk.describe_topic(topic.name))) > 0,
30,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: mentioned in slack, you can also trigger leadership changes and that should also force a roll

@nvartolomei nvartolomei merged commit 449e319 into redpanda-data:dev Jul 10, 2024
20 checks passed
@nvartolomei nvartolomei deleted the nv/timequery-empty-local-log branch July 10, 2024 10:36
@vbotbuildovich
Copy link
Collaborator

/backport v24.1.x

@vbotbuildovich
Copy link
Collaborator

/backport v23.3.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.

3 participants