Skip to content

Commit

Permalink
fix configure
Browse files Browse the repository at this point in the history
Signed-off-by: Little-Wallace <[email protected]>
  • Loading branch information
Little-Wallace committed May 17, 2024
1 parent 3fb569c commit dfc200a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
14 changes: 14 additions & 0 deletions src/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ pub struct MetaConfig {

#[serde(default = "default::meta::hybird_partition_vnode_count")]
pub hybird_partition_vnode_count: u32,

#[serde(default = "default::meta::hybrid_few_partition_threshold")]
pub hybrid_few_partition_threshold: u64,
#[serde(default = "default::meta::hybrid_more_partition_threshold")]
pub hybrid_more_partition_threshold: u64,

#[serde(default = "default::meta::event_log_enabled")]
pub event_log_enabled: bool,
/// Keeps the latest N events per channel.
Expand Down Expand Up @@ -1194,6 +1200,14 @@ pub mod default {
4
}

pub fn hybrid_few_partition_threshold() -> u64 {
128 * 1024 * 1024 // 128MB
}

pub fn hybrid_more_partition_threshold() -> u64 {
512 * 1024 * 1024 // 512MB
}

pub fn event_log_enabled() -> bool {
true
}
Expand Down
2 changes: 2 additions & 0 deletions src/config/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ This page is automatically generated by `./risedev generate-example-config`
| full_gc_interval_sec | Interval of automatic hummock full GC. | 86400 |
| hummock_version_checkpoint_interval_sec | Interval of hummock version checkpoint. | 30 |
| hybird_partition_vnode_count | | 4 |
| hybrid_few_partition_threshold | | 134217728 |
| hybrid_more_partition_threshold | | 536870912 |
| max_heartbeat_interval_secs | Maximum allowed heartbeat interval in seconds. | 60 |
| meta_leader_lease_secs | | 30 |
| min_delta_log_num_for_hummock_version_checkpoint | The minimum delta log number a new checkpoint should compact, otherwise the checkpoint attempt is rejected. | 10 |
Expand Down
2 changes: 2 additions & 0 deletions src/config/example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ min_table_split_write_throughput = 4194304
compaction_task_max_heartbeat_interval_secs = 30
compaction_task_max_progress_interval_secs = 600
hybird_partition_vnode_count = 4
hybrid_few_partition_threshold = 134217728
hybrid_more_partition_threshold = 536870912
event_log_enabled = true
event_log_channel_max_size = 10
enable_dropped_column_reclaim = false
Expand Down
4 changes: 3 additions & 1 deletion src/meta/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ pub fn start(opts: MetaNodeOpts) -> Pin<Box<dyn Future<Output = ()> + Send>> {
table_write_throughput_threshold: config.meta.table_write_throughput_threshold,
min_table_split_write_throughput: config.meta.min_table_split_write_throughput,
partition_vnode_count: config.meta.partition_vnode_count,
hybrid_few_partition_threshold: config.meta.hybrid_few_partition_threshold,
hybrid_more_partition_threshold: config.meta.hybrid_more_partition_threshold,
do_not_config_object_storage_lifecycle: config
.meta
.do_not_config_object_storage_lifecycle,
Expand All @@ -347,7 +349,7 @@ pub fn start(opts: MetaNodeOpts) -> Pin<Box<dyn Future<Output = ()> + Send>> {
compaction_task_max_progress_interval_secs,
compaction_config: Some(config.meta.compaction_config),
cut_table_size_limit: config.meta.cut_table_size_limit,
hybird_partition_vnode_count: config.meta.hybird_partition_vnode_count,
hybrid_partition_node_count: config.meta.hybird_partition_vnode_count,
event_log_enabled: config.meta.event_log_enabled,
event_log_channel_max_size: config.meta.event_log_channel_max_size,
advertise_addr: opts.advertise_addr,
Expand Down
8 changes: 3 additions & 5 deletions src/meta/src/hummock/manager/compaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,11 @@ impl HummockManager {
.existing_table_ids
.retain(|table_id| existing_table_ids.contains(table_id));

let hybrid_vnode_count = self.env.opts.hybird_partition_vnode_count;
let hybrid_vnode_count = self.env.opts.hybrid_partition_node_count;
let default_partition_count = self.env.opts.partition_vnode_count;
// We must ensure the partition threshold large enough to avoid too many small files.
let less_partition_threshold =
(hybrid_vnode_count as u64) * compaction_config.target_file_size_base;
let several_partition_threshold =
(default_partition_count as u64) * compaction_config.target_file_size_base;
let less_partition_threshold = self.env.opts.hybrid_few_partition_threshold;
let several_partition_threshold = self.env.opts.hybrid_more_partition_threshold;
let params = self.env.system_params_reader().await;
let barrier_interval_ms = params.barrier_interval_ms() as u64;
let checkpoint_secs = std::cmp::max(
Expand Down
7 changes: 5 additions & 2 deletions src/meta/src/manager/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ pub struct MetaOpts {
/// - Tables with high write throughput will be split at vnode granularity
/// - Tables with high size tables will be split by table granularity
/// When `hybird_partition_vnode_count` = 0,no longer be special alignment operations for the hybird compaction group
pub hybird_partition_vnode_count: u32,
pub hybrid_partition_node_count: u32,

pub event_log_enabled: bool,
pub event_log_channel_max_size: u32,
Expand All @@ -277,6 +277,9 @@ pub struct MetaOpts {

/// The maximum number of times to probe for PullTaskEvent
pub max_get_task_probe_times: usize,

pub hybrid_few_partition_threshold: u64,
pub hybrid_more_partition_threshold: u64,
}

impl MetaOpts {
Expand Down Expand Up @@ -323,7 +326,7 @@ impl MetaOpts {
compaction_task_max_progress_interval_secs: 1,
compaction_config: None,
cut_table_size_limit: 1024 * 1024 * 1024,
hybird_partition_vnode_count: 4,
hybrid_partition_node_count: 4,
event_log_enabled: false,
event_log_channel_max_size: 1,
advertise_addr: "".to_string(),
Expand Down

0 comments on commit dfc200a

Please sign in to comment.