feat: Adds property based testing framework for compaction (#26783)#26865
Merged
feat: Adds property based testing framework for compaction (#26783)#26865
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds property based testing framework for our compaction testings. Current we support checking for "gaps" within adjacent compaction groups.
For example:
Would be invalid and cause our validator to fail due to the file
"000017095-000000005.tsm"inlevel5Groups.(cherry picked from commit 3f1f4a0)