Skip to content

KAFKA-16342: fix getOffsetByMaxTimestamp for compressed records #15542

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

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

showuon
Copy link
Member

@showuon showuon commented Mar 15, 2024

Backported #15474 to v3.6 branch. Since there is more code diff, I'd like to make sure the backport doesn't break any tests.

Fix getOffsetByMaxTimestamp for compressed records.

This PR adds:

  1. For inPlaceAssignment case, compute the correct offset for maxTimestamp when traversing the batch records, and set to ValidationResult in the end, instead of setting to last offset always.
    2. For not inPlaceAssignment, set the offsetOfMaxTimestamp for the log create time, like non-compressed, and inPlaceAssignment cases, instead of setting to last offset always.
    3. Add tests to verify the fix.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

LGTM if the failed tests are unrelated :)

@showuon showuon merged commit 8aa3986 into apache:3.6 Mar 16, 2024
omkreddy added a commit that referenced this pull request Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants