-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Limit force-full and cold compaction size. #10536
Conversation
tsdb/engine/tsm1/compact.go
Outdated
@@ -453,11 +453,11 @@ func (c *DefaultPlanner) Plan(lastWrite time.Time) []CompactionGroup { | |||
return nil | |||
} | |||
|
|||
group := []CompactionGroup{tsmFiles} | |||
if !c.acquire(group) { | |||
groups := splitCompactionGroups(tsmFiles, 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make 4
a constant somewhere up top? I wonder if 4
is also too low.
@benbjohnson iIf we're doing as forced full compaction and we don't compact all the files in the shard then I think we would need to keep the We don't want a forced full compaction to result in not all the TSM files being compacted down. |
2e88d03
to
168a020
Compare
This commit limits the number of files that can be compacted in a single group when forcing a full compaction or when a shard becomes cold. This is to prevent too many files being compacted at the same time.
168a020
to
40db64d
Compare
@e-dard Ready for re-review. |
@e-dard I verified that the cold compaction eventually processes all the files (in groups of 8) and compacts them down to a single file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
This pull request limits the number of files that can be compacted in a single group when forcing a full compaction or when a shard becomes cold. This is to prevent too many files being compacted at the same time.