Skip to content

feat: Adds property based testing framework for compaction #27186

Merged
devanbenz merged 2 commits intomain-2.xfrom
db/cherrypick-3f1f4a0dde1
Feb 4, 2026
Merged

feat: Adds property based testing framework for compaction #27186
devanbenz merged 2 commits intomain-2.xfrom
db/cherrypick-3f1f4a0dde1

Conversation

@devanbenz
Copy link
Copy Markdown

(cherry picked from commit 3f1f4a0)

Adds property based testing framework for our compaction testings.
Current we support checking for "gaps" within adjacent compaction groups.

For example:
```
			expectedResult: func() TestLevelResults {
				return TestLevelResults{
					// Our rogue level 2 file should be picked up in the full compaction
					level4Groups: []tsm1.PlannedCompactionGroup{
						{
							tsm1.CompactionGroup{
								"000016844-000000002.tsm",
								"000016948-000000004.tsm",
								"000016948-000000005.tsm",
								"000017076-000000004.tsm",
								"000017094-000000004.tsm",
							},
							tsdb.DefaultMaxPointsPerBlock,
						},
					},
					// Other files should get picked up by optimize compaction
					level5Groups: []tsm1.PlannedCompactionGroup{
						{
							tsm1.CompactionGroup{
								"000016684-000000007.tsm",
								"000016684-000000008.tsm",
								"000016684-000000009.tsm",
								"000016684-000000010.tsm",
								"000016812-000000004.tsm",
								"000016812-000000005.tsm",
								"000017095-000000005.tsm",
							},
							tsdb.DefaultMaxPointsPerBlock,
						},
					},
				}
			},
		},
```

Would be invalid and cause our validator to fail due to the file `"000017095-000000005.tsm"` in `level5Groups`.

(cherry picked from commit 3f1f4a0)
Copy link
Copy Markdown
Contributor

@davidby-influx davidby-influx left a comment

Choose a reason for hiding this comment

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

LGTM

@devanbenz devanbenz merged commit 6453347 into main-2.x Feb 4, 2026
25 checks passed
@devanbenz devanbenz deleted the db/cherrypick-3f1f4a0dde1 branch February 4, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants