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

compaction: Extend max_collectible_offset check to adjacent compaction #6487

Merged
merged 4 commits into from
Sep 22, 2022

Conversation

bharathv
Copy link
Contributor

Cover letter

Makes sure adjacent compaction honors max_collectible_offset check added in #5318. This is critical for transactions as we do not want to compact beyond LSO.

Fixes #6335

Backport Required

  • not a bug fix
  • issue does not exist in previous branches
  • papercut/not impactful enough to backport
  • v22.2.x
  • v22.1.x
  • v21.11.x

UX changes

  • none

Release notes

  • none

Features

  • none

Improvements

  • none

Add unit test coverage that checks if adjacent compaction
honors max_collectible_offset. The test fails at the
current commit but should be fixed by the next one.
When selecting candidate pairs for adjacent compaction, makes sure all
the participating segments pass the collectible offset check. This
guarantees that the concatenated segment passes the same check.
Skips self compaction on a segment if the max collectible offset
check fails. This serves as an additional guard rail in the actual
compaction method even though callers themselves do similar checks.
@bharathv bharathv marked this pull request as ready for review September 21, 2022 17:53
Copy link
Member

@dotnwat dotnwat left a comment

Choose a reason for hiding this comment

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

code lgtm. should probably get another reviewer too

Copy link
Contributor

@abhijat abhijat left a comment

Choose a reason for hiding this comment

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

lgtm

@bharathv bharathv merged commit 2e80ac8 into redpanda-data:dev Sep 22, 2022
@bharathv bharathv deleted the 6335 branch September 22, 2022 15:09
This pull request was closed.
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.

Prevent adjacent segment compaction below max collectible offset
4 participants