mz_adapter_types/
dyncfgs.rs1use std::time::Duration;
13
14use mz_dyncfg::{Config, ConfigSet};
15
16use crate::timestamp_selection::ConstraintBasedTimestampSelection;
17
18pub const ALLOW_USER_SESSIONS: Config<bool> = Config::new(
19 "allow_user_sessions",
20 true,
21 "Whether to allow user roles to create new sessions. When false, only system roles will be permitted to create new sessions.",
22);
23
24pub const WITH_0DT_DEPLOYMENT_MAX_WAIT: Config<Duration> = Config::new(
26 "with_0dt_deployment_max_wait",
27 Duration::from_secs(60 * 60 * 72),
28 "How long to wait at most for clusters to be hydrated, when doing a zero-downtime deployment.",
29);
30
31pub const WITH_0DT_DEPLOYMENT_DDL_CHECK_INTERVAL: Config<Duration> = Config::new(
32 "with_0dt_deployment_ddl_check_interval",
33 Duration::from_secs(5 * 60),
34 "How often to check for DDL changes during zero-downtime deployment.",
35);
36
37pub const ENABLE_0DT_DEPLOYMENT_PANIC_AFTER_TIMEOUT: Config<bool> = Config::new(
38 "enable_0dt_deployment_panic_after_timeout",
39 false,
40 "Whether to panic if the maximum wait time is reached but preflight checks have not succeeded.",
41);
42
43pub const WITH_0DT_DEPLOYMENT_CAUGHT_UP_CHECK_INTERVAL: Config<Duration> = Config::new(
44 "0dt_deployment_hydration_check_interval",
46 Duration::from_secs(10),
47 "Interval at which to check whether clusters are caught up, when doing zero-downtime deployment.",
48);
49
50pub const WITH_0DT_CAUGHT_UP_CHECK_ALLOWED_LAG: Config<Duration> = Config::new(
51 "with_0dt_caught_up_check_allowed_lag",
52 Duration::from_secs(60),
53 "Maximum allowed lag when determining whether collections are caught up for 0dt deployments.",
54);
55
56pub const WITH_0DT_CAUGHT_UP_CHECK_CUTOFF: Config<Duration> = Config::new(
57 "with_0dt_caught_up_check_cutoff",
58 Duration::from_secs(2 * 60 * 60), "Collections whose write frontier is behind 'now' by more than the cutoff are ignored when doing caught-up checks for 0dt deployments.",
60);
61
62pub const ENABLE_0DT_CAUGHT_UP_REPLICA_STATUS_CHECK: Config<bool> = Config::new(
63 "enable_0dt_caught_up_replica_status_check",
64 true,
65 "Enable checking for crash/OOM-looping replicas during 0dt caught-up checks. Emergency break-glass flag to disable this feature if needed.",
66);
67
68pub const ENABLE_STATEMENT_LIFECYCLE_LOGGING: Config<bool> = Config::new(
70 "enable_statement_lifecycle_logging",
71 true,
72 "Enable logging of statement lifecycle events in mz_internal.mz_statement_lifecycle_history.",
73);
74
75pub const ENABLE_INTROSPECTION_SUBSCRIBES: Config<bool> = Config::new(
77 "enable_introspection_subscribes",
78 true,
79 "Enable installation of introspection subscribes.",
80);
81
82pub const PLAN_INSIGHTS_NOTICE_FAST_PATH_CLUSTERS_OPTIMIZE_DURATION: Config<Duration> = Config::new(
84 "plan_insights_notice_fast_path_clusters_optimize_duration",
85 Duration::from_millis(10),
91 "Enable plan insights fast path clusters calculation if the optimize step took less than this duration.",
92);
93
94pub const ENABLE_CONTINUAL_TASK_BUILTINS: Config<bool> = Config::new(
96 "enable_continual_task_builtins",
97 false,
98 "Create system builtin continual tasks on boot.",
99);
100
101pub const ENABLE_EXPRESSION_CACHE: Config<bool> = Config::new(
103 "enable_expression_cache",
104 true,
105 "Use a cache to store optimized expressions to help speed up start times.",
106);
107
108pub const ENABLE_MULTI_REPLICA_SOURCES: Config<bool> = Config::new(
110 "enable_multi_replica_sources",
111 true,
112 "Enable multi-replica sources.",
113);
114
115pub const ENABLE_PASSWORD_AUTH: Config<bool> = Config::new(
117 "enable_password_auth",
118 false,
119 "Enable password authentication.",
120);
121
122pub const OIDC_ISSUER: Config<Option<&'static str>> =
124 Config::new("oidc_issuer", None, "OIDC issuer URL.");
125
126pub const OIDC_AUDIENCE: Config<Option<&'static str>> = Config::new(
133 "oidc_audience",
134 None,
135 "OIDC audience (client ID). When empty, audience validation is skipped.",
136);
137
138pub const CONSTRAINT_BASED_TIMESTAMP_SELECTION: Config<&'static str> = Config::new(
139 "constraint_based_timestamp_selection",
140 ConstraintBasedTimestampSelection::const_default().as_str(),
141 "Whether to use the constraint-based timestamp selection, one of: enabled, disabled, verify",
142);
143
144pub const PERSIST_FAST_PATH_ORDER: Config<bool> = Config::new(
145 "persist_fast_path_order",
146 false,
147 "If set, send queries with a compatible literal constraint or ordering clause down the Persist fast path.",
148);
149
150pub const ENABLE_S3_TABLES_REGION_CHECK: Config<bool> = Config::new(
153 "enable_s3_tables_region_check",
154 false,
155 "Whether to enforce that S3 Tables connections are in the same region as the environment.",
156);
157
158pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet {
160 configs
161 .add(&ALLOW_USER_SESSIONS)
162 .add(&WITH_0DT_DEPLOYMENT_MAX_WAIT)
163 .add(&WITH_0DT_DEPLOYMENT_DDL_CHECK_INTERVAL)
164 .add(&ENABLE_0DT_DEPLOYMENT_PANIC_AFTER_TIMEOUT)
165 .add(&WITH_0DT_DEPLOYMENT_CAUGHT_UP_CHECK_INTERVAL)
166 .add(&WITH_0DT_CAUGHT_UP_CHECK_ALLOWED_LAG)
167 .add(&WITH_0DT_CAUGHT_UP_CHECK_CUTOFF)
168 .add(&ENABLE_0DT_CAUGHT_UP_REPLICA_STATUS_CHECK)
169 .add(&ENABLE_STATEMENT_LIFECYCLE_LOGGING)
170 .add(&ENABLE_INTROSPECTION_SUBSCRIBES)
171 .add(&PLAN_INSIGHTS_NOTICE_FAST_PATH_CLUSTERS_OPTIMIZE_DURATION)
172 .add(&ENABLE_CONTINUAL_TASK_BUILTINS)
173 .add(&ENABLE_EXPRESSION_CACHE)
174 .add(&ENABLE_MULTI_REPLICA_SOURCES)
175 .add(&ENABLE_PASSWORD_AUTH)
176 .add(&OIDC_ISSUER)
177 .add(&OIDC_AUDIENCE)
178 .add(&CONSTRAINT_BASED_TIMESTAMP_SELECTION)
179 .add(&PERSIST_FAST_PATH_ORDER)
180 .add(&ENABLE_S3_TABLES_REGION_CHECK)
181}