mz_controller_types/
dyncfgs.rs

1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10//! Dyncfgs used by the controller.
11
12use std::time::Duration;
13
14use mz_dyncfg::{Config, ConfigSet};
15
16/// The interval at which to retry cleaning replicas from past generatinos.
17pub const CONTROLLER_PAST_GENERATION_REPLICA_CLEANUP_RETRY_INTERVAL: Config<Duration> = Config::new(
18    "controller_past_generation_replica_cleanup_retry_interval",
19    Duration::from_secs(300),
20    "The interval at which to attempt to retry cleaning up replicas from past generations.",
21);
22
23pub const ENABLE_0DT_DEPLOYMENT_SOURCES: Config<bool> = Config::new(
24    "enable_0dt_deployment_sources",
25    true,
26    "Whether to enable zero-downtime deployments for sources that support it (experimental).",
27);
28
29pub const WALLCLOCK_LAG_RECORDING_INTERVAL: Config<Duration> = Config::new(
30    "wallclock_lag_recording_interval",
31    Duration::from_secs(60),
32    "The interval at which to record `WallclockLagHistory` introspection.",
33);
34
35pub const ENABLE_WALLCLOCK_LAG_HISTOGRAM_COLLECTION: Config<bool> = Config::new(
36    "enable_wallclock_lag_histogram_collection",
37    true,
38    "Whether to record `WallclockLagHistogram` introspection.",
39);
40
41pub const WALLCLOCK_LAG_HISTOGRAM_PERIOD_INTERVAL: Config<Duration> = Config::new(
42    "wallclock_lag_histogram_period_interval",
43    Duration::from_secs(24 * 60 * 60),
44    "The period interval of histograms in `WallclockLagHistogram` introspection.",
45);
46
47pub const ENABLE_TIMELY_ZERO_COPY: Config<bool> = Config::new(
48    "enable_timely_zero_copy",
49    false,
50    "Enable the zero copy allocator (timely dataflow).",
51);
52
53pub const ENABLE_TIMELY_ZERO_COPY_LGALLOC: Config<bool> = Config::new(
54    "enable_timely_zero_copy_lgalloc",
55    false,
56    "Enable backing the zero copy allocator with lgalloc (timely dataflow).",
57);
58
59pub const TIMELY_ZERO_COPY_LIMIT: Config<Option<usize>> = Config::new(
60    "timely_zero_copy_limit",
61    None,
62    "Optional limit of the zero copy allocator in allocations (timely dataflow).",
63);
64
65pub const ARRANGEMENT_EXERT_PROPORTIONALITY: Config<u32> = Config::new(
66    "arrangement_exert_proportionality",
67    16,
68    "Value that controls how much merge effort to exert on arrangements.",
69);
70
71pub const ENABLE_CTP_CLUSTER_PROTOCOLS: Config<bool> = Config::new(
72    "enable_ctp_cluster_protocols",
73    true,
74    "Enable CTP (instead of gRPC) for the compute and storage cluster protocols.",
75);
76
77pub const ENABLE_PAUSED_CLUSTER_READHOLD_DOWNGRADE: Config<bool> = Config::new(
78    "enable_paused_cluster_readhold_downgrade",
79    true,
80    "Aggressively downgrade input read holds for indexes on zero-replica clusters.",
81);
82
83/// Adds the full set of all controller `Config`s.
84pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet {
85    configs
86        .add(&CONTROLLER_PAST_GENERATION_REPLICA_CLEANUP_RETRY_INTERVAL)
87        .add(&ENABLE_0DT_DEPLOYMENT_SOURCES)
88        .add(&WALLCLOCK_LAG_RECORDING_INTERVAL)
89        .add(&ENABLE_WALLCLOCK_LAG_HISTOGRAM_COLLECTION)
90        .add(&WALLCLOCK_LAG_HISTOGRAM_PERIOD_INTERVAL)
91        .add(&ENABLE_TIMELY_ZERO_COPY)
92        .add(&ENABLE_TIMELY_ZERO_COPY_LGALLOC)
93        .add(&TIMELY_ZERO_COPY_LIMIT)
94        .add(&ARRANGEMENT_EXERT_PROPORTIONALITY)
95        .add(&ENABLE_CTP_CLUSTER_PROTOCOLS)
96        .add(&ENABLE_PAUSED_CLUSTER_READHOLD_DOWNGRADE)
97}