-
Notifications
You must be signed in to change notification settings - Fork 419
feat: manual compaction parallelism #7086
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
Merged
v0y4g3r
merged 4 commits into
GreptimeTeam:main
from
v0y4g3r:feat/manual-compaction-parallelism
Oct 16, 2025
Merged
feat: manual compaction parallelism #7086
v0y4g3r
merged 4 commits into
GreptimeTeam:main
from
v0y4g3r:feat/manual-compaction-parallelism
Oct 16, 2025
+309
−42
Conversation
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
fengjiachun
reviewed
Oct 14, 2025
evenyag
approved these changes
Oct 14, 2025
fengjiachun
approved these changes
Oct 14, 2025
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
### Add Parallelism Support to Compaction Requests - **`Cargo.lock` & `Cargo.toml`**: Updated `greptime-proto` dependency to a new revision. - **`flush_compact_table.rs`**: Enhanced `parse_compact_params` to support a new `parallelism` parameter, allowing users to specify the level of parallelism for table compaction. - **`handle_compaction.rs`**: Integrated `parallelism` into the compaction scheduling process, defaulting to 1 if not specified. - **`request.rs` & `region_request.rs`**: Modified `CompactRequest` to include `parallelism`, with logic to handle unspecifie values. - **`requests.rs`**: Updated `CompactTableRequest` structure to include an optional `parallelism` field. Signed-off-by: Lei, HUANG <[email protected]>
### Commit Message Enhance Compaction Request Handling - **`flush_compact_table.rs`**: - Renamed `parse_compact_params` to `parse_compact_request`. - Introduced `DEFAULT_COMPACTION_PARALLELISM` constant. - Updated parsing logic to handle keyword arguments for `strict_window` and `regular` compaction types, including `parallelism` and `window`. - Modified tests to reflect changes in parsing logic and default parallelism handling. - **`request.rs`**: - Updated `parallelism` handling in `RegionRequestBody::Compact` to use the new default value. - **`requests.rs`**: - Changed `CompactTableRequest` to use a non-optional `parallelism` field with a default value of 1. Signed-off-by: Lei, HUANG <[email protected]>
### Update `flush_compact_table.rs` Parameter Validation - Modified parameter validation in `flush_compact_table.rs` to restrict the maximum number of parameters from 4 to 3 in the `parse_compact_request` function. Signed-off-by: Lei, HUANG <[email protected]>
Update `greptime-proto` dependency - Updated the `greptime-proto` dependency to a new revision in both `Cargo.lock` and `Cargo.toml`. Signed-off-by: Lei, HUANG <[email protected]>
6b8e136
to
dfb4ae8
Compare
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.
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?
Add Parallelism Support to Compaction Requests
Support specifying parallelism when manually trigger compaction, now the syntax looks like:
admin compact_table("table")
: regular compaction, default parallelism(1)admin compact_table("table", "regular", "parallelism=2")
: regular compaction, parallelism=2admin compact_table("table", "swcs")
: swcs compaction, default parallelism(1), default time windowadmin compact_table("table", "swcs", "window=1800")
: swcs compaction, time window=1800sadmin compact_table("table", "swcs", "parallelism=2")
: swcs compaction, default time window, parallelism=2admin compact_table("table", "swcs", "window=1800,parallelism=2")
: swcs compaction, time window=1800s, parallelism=2Details
Cargo.lock
&Cargo.toml
: Updatedgreptime-proto
dependency to a new revision.flush_compact_table.rs
: Enhancedparse_compact_params
to support a newparallelism
parameter, allowing users to specify the level of parallelism for table compaction.handle_compaction.rs
: Integratedparallelism
into the compaction scheduling process, defaulting to 1 if not specified.request.rs
®ion_request.rs
: ModifiedCompactRequest
to includeparallelism
, with logic to handle unspecifie values.requests.rs
: UpdatedCompactTableRequest
structure to include an optionalparallelism
field.PR Checklist
Please convert it to a draft if some of the following conditions are not met.