mz_adapter_types/
dyncfgs.rs1use std::time::Duration;
13
14use mz_dyncfg::{Config, ConfigSet};
15
16pub const ALLOW_USER_SESSIONS: Config<bool> = Config::new(
17 "allow_user_sessions",
18 true,
19 "Whether to allow user roles to create new sessions. When false, only system roles will be permitted to create new sessions.",
20);
21
22pub const WITH_0DT_DEPLOYMENT_MAX_WAIT: Config<Duration> = Config::new(
24 "with_0dt_deployment_max_wait",
25 Duration::from_secs(60 * 60 * 72),
26 "How long to wait at most for clusters to be hydrated, when doing a zero-downtime deployment.",
27);
28
29pub const WITH_0DT_DEPLOYMENT_DDL_CHECK_INTERVAL: Config<Duration> = Config::new(
30 "with_0dt_deployment_ddl_check_interval",
31 Duration::from_secs(5 * 60),
32 "How often to check for DDL changes during zero-downtime deployment.",
33);
34
35pub const ENABLE_0DT_DEPLOYMENT_PANIC_AFTER_TIMEOUT: Config<bool> = Config::new(
36 "enable_0dt_deployment_panic_after_timeout",
37 false,
38 "Whether to panic if the maximum wait time is reached but preflight checks have not succeeded.",
39);
40
41pub const WITH_0DT_DEPLOYMENT_CAUGHT_UP_CHECK_INTERVAL: Config<Duration> = Config::new(
42 "0dt_deployment_hydration_check_interval",
44 Duration::from_secs(10),
45 "Interval at which to check whether clusters are caught up, when doing zero-downtime deployment.",
46);
47
48pub const WITH_0DT_CAUGHT_UP_CHECK_ALLOWED_LAG: Config<Duration> = Config::new(
49 "with_0dt_caught_up_check_allowed_lag",
50 Duration::from_secs(60),
51 "Maximum allowed lag when determining whether collections are caught up for 0dt deployments.",
52);
53
54pub const WITH_0DT_CAUGHT_UP_CHECK_CUTOFF: Config<Duration> = Config::new(
55 "with_0dt_caught_up_check_cutoff",
56 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.",
58);
59
60pub const ENABLE_0DT_CAUGHT_UP_REPLICA_STATUS_CHECK: Config<bool> = Config::new(
61 "enable_0dt_caught_up_replica_status_check",
62 true,
63 "Enable checking for crash/OOM-looping replicas during 0dt caught-up checks. Emergency break-glass flag to disable this feature if needed.",
64);
65
66pub const ENABLE_STATEMENT_LIFECYCLE_LOGGING: Config<bool> = Config::new(
68 "enable_statement_lifecycle_logging",
69 true,
70 "Enable logging of statement lifecycle events in mz_internal.mz_statement_lifecycle_history.",
71);
72
73pub const ENABLE_INTROSPECTION_SUBSCRIBES: Config<bool> = Config::new(
75 "enable_introspection_subscribes",
76 true,
77 "Enable installation of introspection subscribes.",
78);
79
80pub const PLAN_INSIGHTS_NOTICE_FAST_PATH_CLUSTERS_OPTIMIZE_DURATION: Config<Duration> = Config::new(
82 "plan_insights_notice_fast_path_clusters_optimize_duration",
83 Duration::from_millis(10),
89 "Enable plan insights fast path clusters calculation if the optimize step took less than this duration.",
90);
91
92pub const ENABLE_CONTINUAL_TASK_BUILTINS: Config<bool> = Config::new(
94 "enable_continual_task_builtins",
95 false,
96 "Create system builtin continual tasks on boot.",
97);
98
99pub const ENABLE_EXPRESSION_CACHE: Config<bool> = Config::new(
101 "enable_expression_cache",
102 true,
103 "Use a cache to store optimized expressions to help speed up start times.",
104);
105
106pub const ENABLE_MULTI_REPLICA_SOURCES: Config<bool> = Config::new(
108 "enable_multi_replica_sources",
109 true,
110 "Enable multi-replica sources.",
111);
112
113pub const ENABLE_PASSWORD_AUTH: Config<bool> = Config::new(
115 "enable_password_auth",
116 false,
117 "Enable password authentication.",
118);
119
120pub const OIDC_ISSUER: Config<Option<&'static str>> =
122 Config::new("oidc_issuer", None, "OIDC issuer URL.");
123
124pub const OIDC_AUDIENCE: Config<fn() -> serde_json::Value> = Config::new(
130 "oidc_audience",
131 || serde_json::json!([]),
132 "OIDC audience (client IDs). A JSON array of strings. When empty, audience validation is skipped.",
133);
134
135pub const OIDC_AUTHENTICATION_CLAIM: Config<&'static str> = Config::new(
137 "oidc_authentication_claim",
138 "sub",
139 "OIDC authentication claim to use as username.",
140);
141
142pub const PERSIST_FAST_PATH_ORDER: Config<bool> = Config::new(
143 "persist_fast_path_order",
144 false,
145 "If set, send queries with a compatible literal constraint or ordering clause down the Persist fast path.",
146);
147
148pub const ENABLE_S3_TABLES_REGION_CHECK: Config<bool> = Config::new(
151 "enable_s3_tables_region_check",
152 false,
153 "Whether to enforce that S3 Tables connections are in the same region as the environment.",
154);
155
156pub const ENABLE_MCP_AGENTS: Config<bool> = Config::new(
158 "enable_mcp_agents",
159 true,
160 "Whether the MCP agents HTTP endpoint is enabled. When false, requests to /api/mcp/agents return 503 Service Unavailable.",
161);
162
163pub const ENABLE_MCP_OBSERVATORY: Config<bool> = Config::new(
165 "enable_mcp_observatory",
166 true,
167 "Whether the MCP observatory HTTP endpoint is enabled. When false, requests to /api/mcp/observatory return 503 Service Unavailable.",
168);
169
170pub const USER_ID_POOL_BATCH_SIZE: Config<u32> = Config::new(
173 "user_id_pool_batch_size",
174 512,
175 "Number of user IDs to pre-allocate in a batch for DDL operations.",
176);
177
178pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet {
180 configs
181 .add(&ALLOW_USER_SESSIONS)
182 .add(&WITH_0DT_DEPLOYMENT_MAX_WAIT)
183 .add(&WITH_0DT_DEPLOYMENT_DDL_CHECK_INTERVAL)
184 .add(&ENABLE_0DT_DEPLOYMENT_PANIC_AFTER_TIMEOUT)
185 .add(&WITH_0DT_DEPLOYMENT_CAUGHT_UP_CHECK_INTERVAL)
186 .add(&WITH_0DT_CAUGHT_UP_CHECK_ALLOWED_LAG)
187 .add(&WITH_0DT_CAUGHT_UP_CHECK_CUTOFF)
188 .add(&ENABLE_0DT_CAUGHT_UP_REPLICA_STATUS_CHECK)
189 .add(&ENABLE_STATEMENT_LIFECYCLE_LOGGING)
190 .add(&ENABLE_INTROSPECTION_SUBSCRIBES)
191 .add(&PLAN_INSIGHTS_NOTICE_FAST_PATH_CLUSTERS_OPTIMIZE_DURATION)
192 .add(&ENABLE_CONTINUAL_TASK_BUILTINS)
193 .add(&ENABLE_EXPRESSION_CACHE)
194 .add(&ENABLE_MULTI_REPLICA_SOURCES)
195 .add(&ENABLE_PASSWORD_AUTH)
196 .add(&OIDC_ISSUER)
197 .add(&OIDC_AUDIENCE)
198 .add(&OIDC_AUTHENTICATION_CLAIM)
199 .add(&PERSIST_FAST_PATH_ORDER)
200 .add(&ENABLE_S3_TABLES_REGION_CHECK)
201 .add(&ENABLE_MCP_AGENTS)
202 .add(&ENABLE_MCP_OBSERVATORY)
203 .add(&USER_ID_POOL_BATCH_SIZE)
204}