-
Notifications
You must be signed in to change notification settings - Fork 315
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
feat(mito): limit compaction output file size #4754
feat(mito): limit compaction output file size #4754
Conversation
Clarify documentation for CompactionOutput struct Updated the documentation for the `CompactionOutput` struct to specify that the output time range is only relevant for windowed compaction.
- Introduced `max_output_file_size` to `TwcsPicker` struct and its logic to enforce output file size limits during compaction. - Updated `TwcsOptions` to include `max_output_file_size` and adjusted related tests. - Modified `new_picker` function to initialize `TwcsPicker` with the new `max_output_file_size` field.
Refactor compaction picker and TWCS to support append mode and improve options handling - Update compaction picker to accept a reference to options and append mode flag - Modify TWCS picker logic to consider append mode when filtering deleted rows - Remove VersionControl usage in compactor and simplify return type - Adjust enforce_max_output_size logic in TWCS picker to handle max output file size - Add append mode flag to TwcsPicker struct - Fix incorrect condition in TWCS picker for enforcing max output size - Update region options tests to reflect new max output file size format (1GB and 7MB) - Simplify InvalidTableOptionSnafu error handling in create_parser - Add `compaction.twcs.max_output_file_size` to mito engine option keys
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4754 +/- ##
==========================================
- Coverage 84.67% 84.28% -0.39%
==========================================
Files 1118 1117 -1
Lines 202454 202759 +305
==========================================
- Hits 171429 170900 -529
- Misses 31025 31859 +834 |
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.
what happens if those params are in conflict and cannot all be met?
We should allow a compaction task to generate multiple files to avoid outputting a huge file. So the task can finish writing the current output file and start a new output file. But this requires the compaction task itself to generate file ids. |
|
This will not be included in this PR since it involves refactoring both |
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.
It might also be beneficial to group small size inputs into a larger one while still keeping the total size under the threshold. But this PR looks fine to merge and we can do this in follow-up changes.
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
What's changed and what's your intention?
This PR adds a limit to the compaction output file size so that compaction will not generate a huge file which may slow down queries.
Now we can create tables with explicit output file limit:
SST files distribution under TSBS workload (with max_output_file_size=128MB):
Caveats
Currently this policy only applies when either append mode is enabled or compacted inputs does not overlap with other inputs (so that we can reasobably estimate the ouput file size). For those overlapping files, we may need to examine row groups' statistic data to further calculate the output file size. But this is not oncluded in this patch.
Checklist