Skip to content

Commit 8bedb3c

Browse files
Eric Fugithub-actions[bot]
Eric Fu
andauthored
feat: generate example.toml from default config (risingwavelabs#8735)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 2493fc1 commit 8bedb3c

File tree

4 files changed

+101
-23
lines changed

4 files changed

+101
-23
lines changed

Makefile.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,3 +1070,14 @@ set -e
10701070
10711071
cp -a .risingwave/rw-docker/* docker
10721072
'''
1073+
1074+
[tasks.generate-example-config]
1075+
category = "misc"
1076+
description = "Generate default config and write to src/config/example.toml"
1077+
script = '''
1078+
cat << EOF > src/config/example.toml
1079+
# This file is generated by ./risedev generate-example-config
1080+
# Check detailed comments in src/common/src/config.rs
1081+
EOF
1082+
cargo run --bin example-config >> src/config/example.toml
1083+
'''

src/common/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,7 @@ harness = false
115115
[[bench]]
116116
name = "bench_hash_key_encoding"
117117
harness = false
118+
119+
[[bin]]
120+
name = "example-config"
121+
path = "src/bin/default_config.rs"

src/common/src/bin/default_config.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2023 RisingWave Labs
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
use risingwave_common::config::RwConfig;
16+
17+
fn main() {
18+
let config = RwConfig::default();
19+
let toml = toml::to_string(&config).unwrap();
20+
print!("{}", &toml);
21+
}

src/config/example.toml

Lines changed: 65 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,87 @@
1+
# This file is generated by ./risedev generate-example-config
2+
# Check detailed comments in src/common/src/config.rs
13
[server]
24
heartbeat_interval_ms = 1000
35
max_heartbeat_interval_secs = 600
46
connection_pool_size = 16
7+
metrics_level = 0
8+
telemetry_enabled = true
59

610
[meta]
11+
min_sst_retention_time_sec = 604800
12+
collect_gc_watermark_spin_interval_sec = 5
13+
periodic_compaction_interval_sec = 60
14+
vacuum_interval_sec = 30
15+
max_heartbeat_interval_secs = 300
16+
disable_recovery = false
17+
meta_leader_lease_secs = 10
18+
enable_compaction_deterministic = false
19+
enable_committed_sst_sanity_check = false
20+
node_num_monitor_interval_sec = 10
21+
backend = "Mem"
22+
periodic_space_reclaim_compaction_interval_sec = 3600
23+
periodic_ttl_reclaim_compaction_interval_sec = 1800
24+
max_compactor_task_multiplier = 2
725

8-
[batch]
26+
[batch.developer]
27+
batch_output_channel_size = 64
28+
batch_chunk_size = 1024
29+
stream_enable_executor_row_count = false
30+
stream_connector_message_buffer_size = 16
31+
unsafe_stream_extreme_cache_size = 1024
32+
stream_chunk_size = 1024
33+
stream_exchange_initial_permits = 8192
34+
stream_exchange_batched_permits = 1024
935

1036
[streaming]
11-
barrier_interval_ms = 1000
12-
in_flight_barrier_nums = 10
13-
checkpoint_frequency = 10
37+
in_flight_barrier_nums = 10000
38+
enable_jaeger_tracing = false
39+
async_stack_trace = "On"
40+
unique_user_stream_errors = 10
41+
42+
[streaming.developer]
43+
batch_output_channel_size = 64
44+
batch_chunk_size = 1024
45+
stream_enable_executor_row_count = false
46+
stream_connector_message_buffer_size = 16
47+
unsafe_stream_extreme_cache_size = 1024
48+
stream_chunk_size = 1024
49+
stream_exchange_initial_permits = 8192
50+
stream_exchange_batched_permits = 1024
1451

1552
[storage]
16-
shared_buffer_capacity_mb = 4096
17-
block_cache_capacity_mb = 4096
18-
meta_cache_capacity_mb = 1024
19-
compactor_memory_limit_mb = 5120
53+
share_buffers_sync_parallelism = 1
54+
share_buffer_compaction_worker_threads_number = 4
55+
shared_buffer_capacity_mb = 1024
56+
write_conflict_detection_enabled = true
57+
block_cache_capacity_mb = 512
58+
meta_cache_capacity_mb = 128
59+
disable_remote_compactor = false
60+
enable_local_spill = true
61+
local_object_store = "tempdisk"
62+
share_buffer_upload_concurrency = 8
63+
compactor_memory_limit_mb = 512
64+
sstable_id_remote_fetch_number = 10
65+
min_sst_size_for_streaming_upload = 33554432
66+
max_sub_compaction = 4
67+
max_concurrent_compaction_task_number = 16
2068

2169
[storage.file_cache]
70+
dir = ""
2271
capacity_mb = 1024
2372
total_buffer_capacity_mb = 128
2473
cache_file_fallocate_unit_mb = 512
2574
cache_meta_fallocate_unit_mb = 16
2675
cache_file_max_write_size_mb = 4
2776

28-
#The configurable parameters in [XXX.developer] subsection are for developers.
29-
#Users are not encouraged to tune or depend on the following parameters.
30-
#Some configurable parameters exist only temporarily.
31-
[batch.developer]
32-
batch_output_channel_size = 64
33-
batch_chunk_size = 1024
34-
35-
[streaming.developer]
36-
stream_enable_executor_row_count = false
37-
stream_connector_message_buffer_size = 16
38-
unsafe_stream_extreme_cache_size = 1024
39-
stream_chunk_size = 1024
40-
4177
[system]
78+
barrier_interval_ms = 1000
79+
checkpoint_frequency = 10
4280
sstable_size_mb = 256
43-
block_size_kb = 1024
81+
block_size_kb = 64
4482
bloom_false_positive = 0.001
45-
data_directory = "hummock_001"
83+
state_store = ""
84+
data_directory = "hummock_001"
85+
backup_storage_url = "memory"
86+
backup_storage_directory = "backup"
87+
telemetry_enabled = true

0 commit comments

Comments
 (0)