Skip to content
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

Merged
merged 1 commit into from
Dec 17, 2018

Conversation

benbjohnson
Copy link
Contributor

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.

@benbjohnson benbjohnson self-assigned this Dec 4, 2018
@benbjohnson benbjohnson requested a review from e-dard December 4, 2018 23:59
@ghost ghost added the review label Dec 4, 2018
@benbjohnson benbjohnson added this to the Future Point Release milestone Dec 5, 2018
@@ -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)
Copy link
Contributor

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.

@e-dard
Copy link
Contributor

e-dard commented Dec 5, 2018

@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 c.forceFull = true wouldn't we?

We don't want a forced full compaction to result in not all the TSM files being compacted down.

@benbjohnson benbjohnson force-pushed the bj-limit-full-compaction branch from 2e88d03 to 168a020 Compare December 5, 2018 16:16
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.
@benbjohnson benbjohnson force-pushed the bj-limit-full-compaction branch from 168a020 to 40db64d Compare December 5, 2018 17:19
@benbjohnson
Copy link
Contributor Author

@e-dard Ready for re-review.

@benbjohnson
Copy link
Contributor Author

@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.

Copy link
Contributor

@e-dard e-dard left a comment

Choose a reason for hiding this comment

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

LGTM 👍

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.

3 participants