mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-24 00:40:40 +00:00
feat: manual compaction parallelism (#7086)
* feat/manual-compaction-parallelism: ### 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 <mrsatangel@gmail.com> * feat/manual-compaction-parallelism: ### 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 <mrsatangel@gmail.com> * feat/manual-compaction-parallelism: ### 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 <mrsatangel@gmail.com> * feat/manual-compaction-parallelism: 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 <mrsatangel@gmail.com> --------- Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
This commit is contained in:
@@ -109,6 +109,7 @@ impl Requester {
|
||||
.map(|partition| {
|
||||
RegionRequestBody::Compact(CompactRequest {
|
||||
region_id: partition.id.into(),
|
||||
parallelism: request.parallelism,
|
||||
options: Some(request.compact_options),
|
||||
})
|
||||
})
|
||||
@@ -146,6 +147,7 @@ impl Requester {
|
||||
) -> Result<AffectedRows> {
|
||||
let request = RegionRequestBody::Compact(CompactRequest {
|
||||
region_id: region_id.into(),
|
||||
parallelism: 1,
|
||||
options: None, // todo(hl): maybe also support parameters in region compaction.
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user