Skip to content

fix: prevent level regression when compacting mixed-level TSM files#27233

Merged
davidby-influx merged 1 commit into1.12from
DSB/max_seq_fix_1.12
Feb 19, 2026
Merged

fix: prevent level regression when compacting mixed-level TSM files#27233
davidby-influx merged 1 commit into1.12from
DSB/max_seq_fix_1.12

Conversation

@davidby-influx
Copy link
Copy Markdown
Contributor

@davidby-influx davidby-influx commented Feb 19, 2026

compact() derives the output filename from maxGeneration and maxSequence+1, but maxSequence was scoped to the max generation only. When cold or forced compaction groups L1 files (high gen, seq=1) with L4 files (low gen, seq>=4), the output gets seq=2 — regressing L4 data to L2.

Track the minimum sequence per generation to determine each generation's true level, then bump maxSequence so the output level never regresses below the highest input level. Per-generation max sequence is preserved for collision avoidance, and min-sequence level detection avoids inflating the output when a generation has split files from the 2GB size limit.

(cherry picked from commit 142fcaa)

Fixes #27230


Co-authored-by: Geoffrey Wossum gwossum@influxdata.com
(cherry picked from commit 381fd2d)

Fixes #27232

compact() derives the output filename from maxGeneration and
maxSequence+1, but maxSequence was scoped to the max generation only.
When cold or forced compaction groups L1 files (high gen, seq=1) with
L4 files (low gen, seq>=4), the output gets seq=2 — regressing L4
data to L2.

Track the minimum sequence per generation to determine each
generation's true level, then bump maxSequence so the output level
never regresses below the highest input level. Per-generation max
sequence is preserved for collision avoidance, and min-sequence level
detection avoids inflating the output when a generation has split
files from the 2GB size limit.

(cherry picked from commit 142fcaa)

Fixes #27230
---------

Co-authored-by: Geoffrey Wossum <gwossum@influxdata.com>
(cherry picked from commit 381fd2d)

Fixes #27232
Copy link
Copy Markdown
Member

@gwossum gwossum left a comment

Choose a reason for hiding this comment

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

LGTM

@davidby-influx davidby-influx merged commit 5e9d85c into 1.12 Feb 19, 2026
7 of 8 checks passed
@davidby-influx davidby-influx deleted the DSB/max_seq_fix_1.12 branch February 19, 2026 21:58
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.

compact() regresses L4 files to L2 when compacting mixed-level groups [port to 1.12]

2 participants