use std::time::Duration;
use mz_dyncfg::{Config, ConfigSet};
pub const ALLOW_USER_SESSIONS: Config<bool> = Config::new(
"allow_user_sessions",
true,
"Whether to allow user roles to create new sessions. When false, only system roles will be permitted to create new sessions.",
);
pub const ENABLE_0DT_DEPLOYMENT: Config<bool> = Config::new(
"enable_0dt_deployment",
false,
"Whether to enable zero-downtime deployments (experimental).",
);
pub const WITH_0DT_DEPLOYMENT_MAX_WAIT: Config<Duration> = Config::new(
"with_0dt_deployment_max_wait",
Duration::from_secs(5 * 60),
"How long to wait at most for clusters to be hydrated, when doing a zero-downtime deployment.",
);
pub const WITH_0DT_DEPLOYMENT_HYDRATION_CHECK_INTERVAL: Config<Duration> = Config::new(
"0dt_deployment_hydration_check_interval",
Duration::from_secs(10),
"Interval at which to check cluster hydration status, when doing zero-downtime deployment.",
);
pub const ENABLE_0DT_CAUGHT_UP_CHECK: Config<bool> = Config::new(
"enable_0dt_caught_up_check",
true,
"Whether to determine rehydration using a more complicated method that compares collection write frontiers against an allowed lag behind wall-clock time.",
);
pub const WITH_0DT_CAUGHT_UP_CHECK_ALLOWED_LAG: Config<Duration> = Config::new(
"with_0dt_caught_up_check_allowed_lag",
Duration::from_secs(60),
"Maximum allowed lag when determining whether collections are caught up for 0dt deployments.",
);
pub const ENABLE_STATEMENT_LIFECYCLE_LOGGING: Config<bool> = Config::new(
"enable_statement_lifecycle_logging",
false,
"Enable logging of statement lifecycle events in mz_internal.mz_statement_lifecycle_history.",
);
pub const ENABLE_INTROSPECTION_SUBSCRIBES: Config<bool> = Config::new(
"enable_introspection_subscribes",
true,
"Enable installation of introspection subscribes.",
);
pub const PLAN_INSIGHTS_NOTICE_FAST_PATH_CLUSTERS_OPTIMIZE_DURATION: Config<Duration> = Config::new(
"plan_insights_notice fast_path_clusters_optimize_duration",
Duration::from_millis(10),
"Enable plan insights fast path clusters calculation if the optimize step took less than this duration.",
);
pub const DEFAULT_SINK_PARTITION_STRATEGY: Config<&str> = Config::new(
"default_sink_partition_strategy",
"v0",
"The default sink partitioning strategy for an environment. It defaults to 'v0'.",
);
pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet {
configs
.add(&ALLOW_USER_SESSIONS)
.add(&ENABLE_0DT_DEPLOYMENT)
.add(&WITH_0DT_DEPLOYMENT_MAX_WAIT)
.add(&WITH_0DT_DEPLOYMENT_HYDRATION_CHECK_INTERVAL)
.add(&ENABLE_0DT_CAUGHT_UP_CHECK)
.add(&WITH_0DT_CAUGHT_UP_CHECK_ALLOWED_LAG)
.add(&ENABLE_STATEMENT_LIFECYCLE_LOGGING)
.add(&ENABLE_INTROSPECTION_SUBSCRIBES)
.add(&PLAN_INSIGHTS_NOTICE_FAST_PATH_CLUSTERS_OPTIMIZE_DURATION)
.add(&DEFAULT_SINK_PARTITION_STRATEGY)
}