Skip to content

[v26.1.x] compaction: fix min.compaction.lag.ms comparision for future timestamps - #31459

Merged
WillemKauf merged 2 commits into
redpanda-data:v26.1.xfrom
vbotbuildovich:backport-pr-31442-v26.1.x-399
Aug 6, 2026
Merged

[v26.1.x] compaction: fix min.compaction.lag.ms comparision for future timestamps#31459
WillemKauf merged 2 commits into
redpanda-data:v26.1.xfrom
vbotbuildovich:backport-pr-31442-v26.1.x-399

Conversation

@vbotbuildovich

Copy link
Copy Markdown
Collaborator

Backport of PR #31442

A segment's retention timestamp may be ahead of the local clock, which
compares unfavourably against a min_lag_ms of 0, leaving the segment
uncompactible until the clock catches up on a topic that never
configured a lag at all.

Kafka skips the timestamp check entirely when the lag is unset (see
`LogCleanerManager::cleanableOffsets`), so do the same here.

(cherry picked from commit 9645653)
The same defect as the preceding commit, in the L1 compaction source.

Skip the timestamp check entirely when the lag is unset, as Kafka does.
A negative lag is treated as unset too, mirroring Kafka's
`Math.max(compactionLagMs, 0)`.

(cherry picked from commit 551cc75)
@vbotbuildovich vbotbuildovich added this to the v26.1.x-next milestone Aug 6, 2026
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Aug 6, 2026
@WillemKauf
WillemKauf merged commit 2faf042 into redpanda-data:v26.1.x Aug 6, 2026
18 checks passed
@tyson-redpanda tyson-redpanda modified the milestones: v26.1.x-next, v26.1.15 Aug 6, 2026
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