Skip to main content

mz_adapter_dyncfgs/
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 adapter layer.
11
12use std::time::Duration;
13
14use mz_dyncfg::{Config, ConfigSet, ParameterScope};
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    ParameterScope::Environment,
21);
22
23// Slightly awkward with the WITH prefix, but we can't start with a 0..
24pub const WITH_0DT_DEPLOYMENT_MAX_WAIT: Config<Duration> = Config::new(
25    "with_0dt_deployment_max_wait",
26    // One year, which in practice makes it so we never cut over when not
27    // hydrated. To prevent cutting over unilaterally when there is an issue.
28    Duration::from_hours(365 * 24),
29    "How long to wait at most for clusters to be hydrated, when doing a zero-downtime deployment.",
30    ParameterScope::Environment,
31);
32
33pub const WITH_0DT_DEPLOYMENT_DDL_CHECK_INTERVAL: Config<Duration> = Config::new(
34    "with_0dt_deployment_ddl_check_interval",
35    Duration::from_secs(5 * 60),
36    "How often to check for DDL changes during zero-downtime deployment.",
37    ParameterScope::Environment,
38);
39
40pub const ENABLE_0DT_DEPLOYMENT_PANIC_AFTER_TIMEOUT: Config<bool> = Config::new(
41    "enable_0dt_deployment_panic_after_timeout",
42    false,
43    "Whether to panic if the maximum wait time is reached but preflight checks have not succeeded.",
44    ParameterScope::Environment,
45);
46
47pub const WITH_0DT_DEPLOYMENT_CAUGHT_UP_CHECK_INTERVAL: Config<Duration> = Config::new(
48    // The feature flag name is historical.
49    "0dt_deployment_hydration_check_interval",
50    Duration::from_secs(10),
51    "Interval at which to check whether clusters are caught up, when doing zero-downtime deployment.",
52    ParameterScope::Environment,
53);
54
55pub const WITH_0DT_CAUGHT_UP_CHECK_ALLOWED_LAG: Config<Duration> = Config::new(
56    "with_0dt_caught_up_check_allowed_lag",
57    Duration::from_secs(60),
58    "Maximum allowed lag when determining whether collections are caught up for 0dt deployments.",
59    ParameterScope::Environment,
60);
61
62pub const WITH_0DT_CAUGHT_UP_CHECK_CUTOFF: Config<Duration> = Config::new(
63    "with_0dt_caught_up_check_cutoff",
64    Duration::from_secs(2 * 60 * 60), // 2 hours
65    "Collections whose write frontier is behind 'now' by more than the cutoff are ignored when doing caught-up checks for 0dt deployments.",
66    ParameterScope::Environment,
67);
68
69pub const ENABLE_0DT_CAUGHT_UP_REPLICA_STATUS_CHECK: Config<bool> = Config::new(
70    "enable_0dt_caught_up_replica_status_check",
71    true,
72    "Enable checking for crash/OOM-looping replicas during 0dt caught-up checks. Emergency break-glass flag to disable this feature if needed.",
73    ParameterScope::Environment,
74);
75
76// TODO(aljoscha): Remove this break-glass flag after a couple of releases, once
77// the sustained-health gate has proven itself in production. It only exists as a
78// fleet-wide automatic revert to the prior "caught-up implies ready" behavior.
79pub const ENABLE_0DT_CAUGHT_UP_STABILITY_CHECK: Config<bool> = Config::new(
80    "enable_0dt_caught_up_stability_check",
81    true,
82    "Require clusters to stay caught-up and healthy for a stability period before being considered ready during 0dt deployments. Emergency break-glass flag: disabling reverts to treating a caught-up cluster as ready with no replica-health requirement, which differs from setting the stability period to zero (a zero period still requires all replicas to be healthy).",
83    ParameterScope::Environment,
84);
85
86pub const WITH_0DT_CAUGHT_UP_CHECK_STABILITY_PERIOD: Config<Duration> = Config::new(
87    "with_0dt_caught_up_check_stability_period",
88    Duration::from_secs(10 * 60), // 10 minutes
89    "Required continuous hydration before a caught-up cluster is ready for 0dt cutover. Each non-exempt replica's period is capped at its catalog creation age when it hydrated. Missing creation evidence retains the full period.",
90    ParameterScope::Environment,
91);
92
93pub const ENABLE_0DT_HYDRATE_MIGRATED_BUILTIN_MVS: Config<bool> = Config::new(
94    "enable_0dt_hydrate_migrated_builtin_mvs",
95    true,
96    "Write-enable replacement-migrated and new builtin materialized views while read-only during \
97     a 0dt deployment, so they hydrate before cut-over and gate promotion. Emergency break-glass \
98     flag: disabling excludes these MVs and every other new builtin (and their dependents) from \
99     the caught-up check, so promotion proceeds with them unhydrated. Not an exact revert: a \
100     collection with no live leader frontier must be hydrated either way, and new builtin tables \
101     and sources are written either way. Only takes effect when the leader is new enough for the \
102     write to make progress, and is read once at startup, so changing it means setting it on the \
103     leader and restarting the new deployment.",
104    ParameterScope::Environment,
105);
106
107/// Enable logging of statement lifecycle events in mz_internal.mz_statement_lifecycle_history.
108pub const ENABLE_STATEMENT_LIFECYCLE_LOGGING: Config<bool> = Config::new(
109    "enable_statement_lifecycle_logging",
110    true,
111    "Enable logging of statement lifecycle events in mz_internal.mz_statement_lifecycle_history.",
112    ParameterScope::Environment,
113);
114
115/// Enable installation of introspection subscribes.
116pub const ENABLE_INTROSPECTION_SUBSCRIBES: Config<bool> = Config::new(
117    "enable_introspection_subscribes",
118    true,
119    "Enable installation of introspection subscribes.",
120    ParameterScope::Environment,
121);
122
123/// The plan insights notice will not investigate fast path clusters if plan optimization took longer than this.
124pub const PLAN_INSIGHTS_NOTICE_FAST_PATH_CLUSTERS_OPTIMIZE_DURATION: Config<Duration> = Config::new(
125    "plan_insights_notice_fast_path_clusters_optimize_duration",
126    // Looking at production values of the mz_optimizer_e2e_optimization_time_seconds metric, most
127    // optimizations run faster than 10ms, so this should still work well for most queries. We want
128    // to avoid the case where an optimization took just under this value and there are lots of
129    // clusters, so the extra delay to produce the plan insights notice will take the optimization
130    // time * the number of clusters longer.
131    Duration::from_millis(10),
132    "Enable plan insights fast path clusters calculation if the optimize step took less than this duration.",
133    ParameterScope::Environment,
134);
135
136/// Whether to use an expression cache on boot.
137pub const ENABLE_EXPRESSION_CACHE: Config<bool> = Config::new(
138    "enable_expression_cache",
139    true,
140    "Use a cache to store optimized expressions to help speed up start times. \
141     Read at startup, so changing it takes effect on the next restart.",
142    ParameterScope::Environment,
143);
144
145/// Whether to enable password authentication.
146pub const ENABLE_PASSWORD_AUTH: Config<bool> = Config::new(
147    "enable_password_auth",
148    false,
149    "Enable password authentication.",
150    ParameterScope::Environment,
151);
152
153/// Upper bound on the number of transitive dependencies validated for a
154/// read-then-write statement (e.g. `DELETE ... WHERE ... IN (SELECT ...)`).
155/// Validation walks the read set's dependency graph, which is user controlled
156/// and can be arbitrarily large. The bound rejects pathological graphs with a
157/// clean error instead of consuming unbounded time and memory.
158pub const READ_THEN_WRITE_MAX_DEPENDENCIES: Config<usize> = Config::new(
159    "read_then_write_max_dependencies",
160    100_000,
161    "Maximum number of transitive dependencies validated for a read-then-write \
162     statement before it is rejected.",
163    ParameterScope::Environment,
164);
165
166/// OIDC issuer URL.
167pub const OIDC_ISSUER: Config<Option<&'static str>> = Config::new(
168    "oidc_issuer",
169    None,
170    "OIDC issuer URL.",
171    ParameterScope::Environment,
172);
173
174/// OIDC audience (client IDs). When empty, audience validation is skipped.
175/// Validates that the JWT's `aud` claim contains at least one of these values.
176/// It is insecure to skip validation because it is the only
177/// mechanism preventing attackers from authenticating using a JWT
178/// issued by a dummy application, but from the same identity provider.
179pub const OIDC_AUDIENCE: Config<fn() -> serde_json::Value> = Config::new(
180    "oidc_audience",
181    || serde_json::json!([]),
182    "OIDC audience (client IDs). A JSON array of strings. When empty, audience validation is skipped.",
183    ParameterScope::Environment,
184);
185
186/// OIDC authentication claim to use as username
187pub const OIDC_AUTHENTICATION_CLAIM: Config<&'static str> = Config::new(
188    "oidc_authentication_claim",
189    "sub",
190    "OIDC authentication claim to use as username.",
191    ParameterScope::Environment,
192);
193
194/// Whether OIDC group-to-role sync is enabled.
195/// When true, JWT group claims are used to sync role memberships on login.
196pub const OIDC_GROUP_ROLE_SYNC_ENABLED: Config<bool> = Config::new(
197    "oidc_group_role_sync_enabled",
198    false,
199    "Enable OIDC JWT group-to-role membership sync on login.",
200    ParameterScope::Environment,
201);
202
203/// The JWT claim path that contains group memberships. May be a bare claim
204/// name (e.g. `groups`) or a dot-separated path into nested objects (e.g.
205/// `customClaims.groups`).
206pub const OIDC_GROUP_CLAIM: Config<&'static str> = Config::new(
207    "oidc_group_claim",
208    "groups",
209    "JWT claim path containing group memberships for role sync. Supports dot-separated paths into nested objects (e.g. customClaims.groups).",
210    ParameterScope::Environment,
211);
212
213/// Whether to reject login when group sync fails (strict/fail-closed mode).
214/// When false (default), sync failures are logged but login proceeds (fail-open).
215pub const OIDC_GROUP_ROLE_SYNC_STRICT: Config<bool> = Config::new(
216    "oidc_group_role_sync_strict",
217    false,
218    "When true, reject login if OIDC group-to-role sync fails (fail-closed).",
219    ParameterScope::Environment,
220);
221
222pub const PERSIST_FAST_PATH_ORDER: Config<bool> = Config::new(
223    "persist_fast_path_order",
224    true,
225    "If set, send queries with a compatible literal constraint or ordering clause down the Persist fast path.",
226    ParameterScope::Environment,
227);
228
229/// Whether to enforce that S3 Tables connections are in the same region as the Materialize
230/// environment.
231pub const ENABLE_S3_TABLES_REGION_CHECK: Config<bool> = Config::new(
232    "enable_s3_tables_region_check",
233    false,
234    "Whether to enforce that S3 Tables connections are in the same region as the environment.",
235    ParameterScope::Environment,
236);
237
238/// Whether the MCP agent endpoint is enabled.
239pub const ENABLE_MCP_AGENT: Config<bool> = Config::new(
240    "enable_mcp_agent",
241    true,
242    "Whether the MCP agent HTTP endpoint is enabled. When false, requests to /api/mcp/agent return 503 Service Unavailable.",
243    ParameterScope::Environment,
244);
245
246/// Whether the MCP agent query tool is enabled.
247/// When false, the `query` tool is hidden from tools/list and calls to it return an error.
248/// Agents can still use `get_data_products` and `get_data_product_details`.
249pub const ENABLE_MCP_AGENT_QUERY_TOOL: Config<bool> = Config::new(
250    "enable_mcp_agent_query_tool",
251    true,
252    "Whether the MCP agent query tool is enabled. When false, the query tool is not advertised and calls to it are rejected. Agents can still discover and inspect data products.",
253    ParameterScope::Environment,
254);
255
256/// Whether the MCP agent read_data_product tool is enabled.
257/// When false, the `read_data_product` tool is hidden from tools/list and calls to it return an error.
258/// The `query` tool is the general-purpose alternative for reading data products.
259pub const ENABLE_MCP_AGENT_READ_DATA_PRODUCT_TOOL: Config<bool> = Config::new(
260    "enable_mcp_agent_read_data_product_tool",
261    true,
262    "Whether the MCP agent read_data_product tool is enabled. When false, the read_data_product tool is not advertised and calls to it are rejected. Agents can use the query tool to read data products.",
263    ParameterScope::Environment,
264);
265
266/// Whether the MCP developer endpoint is enabled.
267pub const ENABLE_MCP_DEVELOPER: Config<bool> = Config::new(
268    "enable_mcp_developer",
269    true,
270    "Whether the MCP developer HTTP endpoint is enabled. When false, requests to /api/mcp/developer return 503 Service Unavailable.",
271    ParameterScope::Environment,
272);
273
274/// Whether the MCP developer query tool is enabled.
275/// When false, the `query` tool is hidden from tools/list and calls to it return an error.
276/// Developers can still use `query_system_catalog`.
277pub const ENABLE_MCP_DEVELOPER_QUERY_TOOL: Config<bool> = Config::new(
278    "enable_mcp_developer_query_tool",
279    true,
280    "Whether the MCP developer query tool is enabled. When false, the query tool is not advertised and calls to it are rejected. Developers can still use query_system_catalog.",
281    ParameterScope::Environment,
282);
283
284/// Whether the unified MCP endpoint at `/api/mcp` is enabled. Separate from the
285/// `/api/mcp/agent` and `/api/mcp/developer` flags, so each route rolls out on
286/// its own.
287pub const ENABLE_MCP_UNIFIED: Config<bool> = Config::new(
288    "enable_mcp_unified",
289    false,
290    "Whether the unified MCP HTTP endpoint is enabled. When false, requests to /api/mcp return 503 Service Unavailable.",
291    ParameterScope::Environment,
292);
293
294/// Whether the external metrics endpoint on environmentd is enabled.
295pub const ENABLE_PUBLIC_METRICS_ENDPOINT: Config<bool> = Config::new(
296    "enable_public_metrics_endpoint",
297    true,
298    "Whether the external metrics endpoint on environmentd is enabled. When false, requests return 503.",
299    ParameterScope::Environment,
300);
301
302/// Maximum size (in bytes) of MCP tool response content after JSON serialization.
303/// Responses exceeding this limit are rejected with a clear error telling the
304/// agent to narrow its query. Keeps responses within LLM context window limits.
305pub const MCP_MAX_RESPONSE_SIZE: Config<usize> = Config::new(
306    "mcp_max_response_size",
307    1_000_000,
308    "Maximum size in bytes of MCP tool response content. Responses exceeding this limit are rejected with an error telling the agent to narrow its query.",
309    ParameterScope::Environment,
310);
311
312/// Maximum time an MCP request may run before it is aborted and a timeout
313/// error is returned to the client.
314pub const MCP_REQUEST_TIMEOUT: Config<Duration> = Config::new(
315    "mcp_request_timeout",
316    Duration::from_secs(60),
317    "Maximum time an MCP request may run before it is aborted with a timeout error.",
318    ParameterScope::Environment,
319);
320
321/// Maximum size (in bytes) of a webhook request body, measured after
322/// decompression. Requests whose body exceeds this limit are rejected with
323/// HTTP 413. Applies only to the webhook route; other HTTP routes use a
324/// separate static limit.
325pub const WEBHOOK_MAX_REQUEST_SIZE_BYTES: Config<usize> = Config::new(
326    "webhook_max_request_size_bytes",
327    // Matches `MAX_REQUEST_SIZE`, the static limit the other environmentd HTTP routes use.
328    5 * 1024 * 1024,
329    "The maximum size in bytes of a webhook request body, measured after decompression.",
330    ParameterScope::Environment,
331);
332
333/// Maximum temporary storage a webhook `CHECK` expression may allocate while
334/// validating one request. A `CHECK` that exceeds it fails the request with HTTP
335/// 400 rather than holding the memory.
336///
337/// A `CHECK` can allocate a multiple of the request body, and `environmentd`
338/// evaluates one per in-flight request. Without a bound proportionate to the
339/// request, bounded network input becomes unbounded heap on a process shared by
340/// every connection. The default is 4x `WEBHOOK_MAX_REQUEST_SIZE_BYTES`, well
341/// above what a realistic `CHECK` (an HMAC, a `decode`, a `concat` with a
342/// secret) needs and well below the 100 MiB per-call ceiling used in a cluster.
343///
344/// NOTE: this is runtime-reconfigurable, so it must only bound a single webhook
345/// validation. Do not feed it (or any mutable budget) to a `RowArena` used in a
346/// compute dataflow (see `mz_repr::RowArena::with_budget`).
347pub const WEBHOOK_VALIDATION_MEMORY_BUDGET_BYTES: Config<usize> = Config::new(
348    "webhook_validation_memory_budget_bytes",
349    20 * 1024 * 1024,
350    "The maximum bytes of temporary storage a webhook CHECK expression may allocate while validating one request.",
351    ParameterScope::Environment,
352);
353
354/// Budget for the backlog a `SUBSCRIBE` (or `COPY (SUBSCRIBE ...) TO STDOUT`)
355/// may accumulate in environmentd while waiting for a slow client to read.
356///
357/// The subscribe producer runs on the non-blockable coordinator loop, so it
358/// cannot apply backpressure to a slow client. Instead the coordinator retires
359/// the subscribe once its buffered backlog exceeds this budget, bounding the
360/// memory a slow client can make the shared process hold.
361///
362/// The backlog excludes the message the client is currently draining, so this
363/// bounds the accumulation of messages, not the size of any single one.
364/// `max_result_size` is what bounds an individual message. A client that keeps
365/// up holds at most one message at a time, so it stays at a zero backlog and a
366/// large snapshot batch is delivered rather than retired.
367pub const SUBSCRIBE_MAX_BUFFERED_BYTES: Config<usize> = Config::new(
368    "subscribe_max_buffered_bytes",
369    128 * 1024 * 1024,
370    "Maximum bytes a SUBSCRIBE may buffer in environmentd for a slow client before it is retired with an error.",
371    ParameterScope::Environment,
372);
373
374/// Number of user IDs to pre-allocate in a batch. Pre-allocating IDs avoids
375/// a persist write + oracle call per DDL statement.
376pub const USER_ID_POOL_BATCH_SIZE: Config<u32> = Config::new(
377    "user_id_pool_batch_size",
378    512,
379    "Number of user IDs to pre-allocate in a batch for DDL operations.",
380    ParameterScope::Environment,
381);
382
383/// Maximum number of txns-shard write attempts before rebuilding `environmentd`.
384///
385/// The effective minimum is one attempt.
386pub const GROUP_COMMIT_MAX_ATTEMPTS: Config<usize> = Config::new(
387    "group_commit_max_attempts",
388    100,
389    "Maximum number of txns-shard write attempts before rebuilding environmentd. Values below 1 are treated as 1.",
390    ParameterScope::Environment,
391);
392
393/// OIDC client ID for the web console.
394pub const CONSOLE_OIDC_CLIENT_ID: Config<&'static str> = Config::new(
395    "console_oidc_client_id",
396    "",
397    "OIDC client ID for the web console.",
398    ParameterScope::Environment,
399);
400
401/// Space-separated OIDC scopes requested by the web console.
402pub const CONSOLE_OIDC_SCOPES: Config<&'static str> = Config::new(
403    "console_oidc_scopes",
404    "",
405    "Space-separated OIDC scopes requested by the web console.",
406    ParameterScope::Environment,
407);
408
409/// Interval at which to collect per-object arrangement size snapshots for the history table.
410pub const ARRANGEMENT_SIZE_HISTORY_COLLECTION_INTERVAL: Config<Duration> = Config::new(
411    "arrangement_size_history_collection_interval",
412    // Disabled by default until https://github.com/MaterializeInc/materialize/pull/37455 lands.
413    Duration::ZERO,
414    "Interval at which to collect and snapshot per-object arrangement sizes \
415     into mz_internal.mz_object_arrangement_size_history.",
416    ParameterScope::Environment,
417);
418
419/// How long to retain per-object arrangement size history.
420pub const ARRANGEMENT_SIZE_HISTORY_RETENTION_PERIOD: Config<Duration> = Config::new(
421    "arrangement_size_history_retention_period",
422    Duration::from_hours(7 * 24),
423    "How long to retain rows in mz_internal.mz_object_arrangement_size_history.",
424    ParameterScope::Environment,
425);
426
427/// How often to sweep replicas for completed object and replica hydration episodes.
428pub const HYDRATION_HISTORY_COLLECTION_INTERVAL: Config<Duration> = Config::new(
429    "hydration_history_collection_interval",
430    Duration::from_secs(60),
431    "How often to record completed object and replica hydration episodes. A zero duration prevents new collection and retention sweeps.",
432    ParameterScope::Environment,
433);
434
435/// How long to retain completed object hydration episodes.
436pub const HYDRATION_HISTORY_RETENTION_PERIOD: Config<Duration> = Config::new(
437    "hydration_history_retention_period",
438    Duration::from_hours(30 * 24),
439    "How long to retain rows in mz_internal.mz_object_hydration_history.",
440    ParameterScope::Environment,
441);
442
443/// How long to retain completed replica hydration episodes for capacity planning.
444pub const REPLICA_HYDRATION_HISTORY_RETENTION_PERIOD: Config<Duration> = Config::new(
445    "replica_hydration_history_retention_period",
446    Duration::from_hours(120 * 24),
447    "How long to retain rows in mz_internal.mz_replica_hydration_history.",
448    ParameterScope::Environment,
449);
450
451/// How frequently the catalog `*_info` metrics (`mz_object_info`,
452/// `mz_cluster_info`, …) are reconciled with the catalog. A zero duration
453/// disables reconciliation.
454pub const CATALOG_INFO_METRICS_RECONCILE_INTERVAL: Config<Duration> = Config::new(
455    "catalog_info_metrics_reconcile_interval",
456    Duration::from_secs(30),
457    "How frequently to reconcile the catalog `*_info` metrics with the catalog. A zero duration disables reconciliation.",
458    ParameterScope::Environment,
459);
460
461/// Server-side `statement_timeout` to set on Postgres/CRDB connections used by
462/// the Postgres/CRDB timestamp oracle. A zero value leaves the statement
463/// timeout unset.
464pub const PG_TIMESTAMP_ORACLE_STATEMENT_TIMEOUT: Config<Duration> = Config::new(
465    "pg_timestamp_oracle_statement_timeout",
466    crate::timestamp_oracle::DEFAULT_PG_TIMESTAMP_ORACLE_STATEMENT_TIMEOUT,
467    "The server-side statement timeout to set on Postgres/CRDB connections used by the \
468    Postgres/CRDB timestamp oracle. A value of zero leaves the statement timeout unset.",
469    ParameterScope::Environment,
470);
471
472/// Cadence of the cluster controller's reconcile tick.
473pub const CLUSTER_CONTROLLER_TICK_INTERVAL: Config<Duration> = Config::new(
474    "cluster_controller_tick_interval",
475    Duration::from_secs(5),
476    "How often the cluster controller runs a reconcile tick.",
477    ParameterScope::Environment,
478);
479
480/// Whether replacement compute must catch up before graceful cut-over or
481/// automatic hydration-burst retirement.
482///
483/// Enabled by default.
484pub const ENABLE_CLUSTER_RECONFIGURATION_LAG_GATE: Config<bool> = Config::new(
485    "enable_cluster_reconfiguration_lag_gate",
486    true,
487    "Whether graceful reconfiguration and hydration-burst retirement require surviving replicas \
488    to be within cluster_reconfiguration_allowed_lag of the retiring replicas, on top of being hydrated.",
489    ParameterScope::Environment,
490);
491
492/// Allowed compute lag for graceful reconfiguration and hydration-burst retirement.
493pub const CLUSTER_RECONFIGURATION_ALLOWED_LAG: Config<Duration> = Config::new(
494    "cluster_reconfiguration_allowed_lag",
495    Duration::from_secs(60),
496    "Maximum allowed lag when determining whether surviving compute replicas \
497    have caught up with replicas retired by graceful reconfiguration or hydration burst.",
498    ParameterScope::Environment,
499);
500
501/// Whether a config-shape `ALTER CLUSTER` returns immediately, with the
502/// controller converging in the background, or blocks the session on a
503/// wait-shim until the reconfiguration completes or its deadline passes.
504///
505/// Defaults on. This is the break-glass switch back to the blocking wait-shim
506/// if returning immediately causes trouble.
507pub const ENABLE_BACKGROUND_ALTER_CLUSTER: Config<bool> = Config::new(
508    "enable_background_alter_cluster",
509    true,
510    "Whether a config-shape ALTER CLUSTER returns immediately (true) or the session blocks on a wait-shim over the durable reconfiguration record (false).",
511    ParameterScope::Environment,
512);
513
514/// The reconfiguration deadline written when a config-shape `ALTER CLUSTER`
515/// omits `WITH (WAIT ...)`. What happens when the deadline passes un-hydrated is
516/// the record's `on_timeout` action.
517pub const DEFAULT_CLUSTER_RECONFIGURATION_TIMEOUT: Config<Duration> = Config::new(
518    "default_cluster_reconfiguration_timeout",
519    Duration::from_secs(60 * 60 * 24),
520    "The reconfiguration deadline written when a config-shape ALTER CLUSTER omits WITH (WAIT ...).",
521    ParameterScope::Environment,
522);
523
524/// Break-glass for the hydration-burst strategy: when off the controller never
525/// runs a burst replica; graceful reconfiguration and `ON REFRESH` scheduling
526/// are unaffected.
527///
528/// A cluster can only carry an `AUTO SCALING STRATEGY` while its SQL acceptance
529/// feature flag is on, so this is the second of the two gates burst sits
530/// behind.
531pub const ENABLE_HYDRATION_BURST: Config<bool> = Config::new(
532    "enable_hydration_burst",
533    true,
534    "Whether the cluster controller's hydration-burst strategy may run a burst replica (break-glass; leaves graceful reconfiguration and ON REFRESH untouched).",
535    ParameterScope::Environment,
536);
537
538/// The burst-replica linger duration written into a new `burst` record when the
539/// cluster's `AUTO SCALING STRATEGY` omits `LINGER DURATION`. The burst replica
540/// stays up this long after the steady-state replicas first hydrate.
541pub const DEFAULT_HYDRATION_BURST_LINGER: Config<Duration> = Config::new(
542    "default_hydration_burst_linger",
543    Duration::from_secs(0),
544    "The burst-replica linger duration written when an AUTO SCALING STRATEGY omits LINGER DURATION.",
545    ParameterScope::Environment,
546);
547
548/// Adds the full set of all adapter `Config`s.
549pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet {
550    configs
551        .add(&ALLOW_USER_SESSIONS)
552        .add(&CLUSTER_CONTROLLER_TICK_INTERVAL)
553        .add(&ENABLE_CLUSTER_RECONFIGURATION_LAG_GATE)
554        .add(&CLUSTER_RECONFIGURATION_ALLOWED_LAG)
555        .add(&ENABLE_BACKGROUND_ALTER_CLUSTER)
556        .add(&DEFAULT_CLUSTER_RECONFIGURATION_TIMEOUT)
557        .add(&ENABLE_HYDRATION_BURST)
558        .add(&DEFAULT_HYDRATION_BURST_LINGER)
559        .add(&WITH_0DT_DEPLOYMENT_MAX_WAIT)
560        .add(&WITH_0DT_DEPLOYMENT_DDL_CHECK_INTERVAL)
561        .add(&ENABLE_0DT_DEPLOYMENT_PANIC_AFTER_TIMEOUT)
562        .add(&WITH_0DT_DEPLOYMENT_CAUGHT_UP_CHECK_INTERVAL)
563        .add(&WITH_0DT_CAUGHT_UP_CHECK_ALLOWED_LAG)
564        .add(&WITH_0DT_CAUGHT_UP_CHECK_CUTOFF)
565        .add(&ENABLE_0DT_CAUGHT_UP_REPLICA_STATUS_CHECK)
566        .add(&ENABLE_0DT_CAUGHT_UP_STABILITY_CHECK)
567        .add(&WITH_0DT_CAUGHT_UP_CHECK_STABILITY_PERIOD)
568        .add(&ENABLE_0DT_HYDRATE_MIGRATED_BUILTIN_MVS)
569        .add(&ENABLE_STATEMENT_LIFECYCLE_LOGGING)
570        .add(&ENABLE_INTROSPECTION_SUBSCRIBES)
571        .add(&PLAN_INSIGHTS_NOTICE_FAST_PATH_CLUSTERS_OPTIMIZE_DURATION)
572        .add(&ENABLE_EXPRESSION_CACHE)
573        .add(&ENABLE_PASSWORD_AUTH)
574        .add(&READ_THEN_WRITE_MAX_DEPENDENCIES)
575        .add(&OIDC_ISSUER)
576        .add(&OIDC_AUDIENCE)
577        .add(&OIDC_AUTHENTICATION_CLAIM)
578        .add(&OIDC_GROUP_ROLE_SYNC_ENABLED)
579        .add(&OIDC_GROUP_CLAIM)
580        .add(&OIDC_GROUP_ROLE_SYNC_STRICT)
581        .add(&PERSIST_FAST_PATH_ORDER)
582        .add(&ENABLE_S3_TABLES_REGION_CHECK)
583        .add(&ENABLE_MCP_AGENT)
584        .add(&ENABLE_MCP_AGENT_QUERY_TOOL)
585        .add(&ENABLE_MCP_AGENT_READ_DATA_PRODUCT_TOOL)
586        .add(&ENABLE_MCP_DEVELOPER)
587        .add(&ENABLE_MCP_DEVELOPER_QUERY_TOOL)
588        .add(&ENABLE_MCP_UNIFIED)
589        .add(&ENABLE_PUBLIC_METRICS_ENDPOINT)
590        .add(&MCP_MAX_RESPONSE_SIZE)
591        .add(&MCP_REQUEST_TIMEOUT)
592        .add(&WEBHOOK_MAX_REQUEST_SIZE_BYTES)
593        .add(&WEBHOOK_VALIDATION_MEMORY_BUDGET_BYTES)
594        .add(&SUBSCRIBE_MAX_BUFFERED_BYTES)
595        .add(&USER_ID_POOL_BATCH_SIZE)
596        .add(&GROUP_COMMIT_MAX_ATTEMPTS)
597        .add(&CONSOLE_OIDC_CLIENT_ID)
598        .add(&CONSOLE_OIDC_SCOPES)
599        .add(&ARRANGEMENT_SIZE_HISTORY_COLLECTION_INTERVAL)
600        .add(&ARRANGEMENT_SIZE_HISTORY_RETENTION_PERIOD)
601        .add(&HYDRATION_HISTORY_COLLECTION_INTERVAL)
602        .add(&HYDRATION_HISTORY_RETENTION_PERIOD)
603        .add(&REPLICA_HYDRATION_HISTORY_RETENTION_PERIOD)
604        .add(&CATALOG_INFO_METRICS_RECONCILE_INTERVAL)
605        .add(&PG_TIMESTAMP_ORACLE_STATEMENT_TIMEOUT)
606}