1use std::time::Duration;
13
14use mz_dyncfg::{Config, ConfigSet};
15
16pub const ENABLE_MZ_JOIN_CORE: Config<bool> = Config::new(
18 "enable_mz_join_core",
19 true,
20 "Whether compute should use `mz_join_core` rather than DD's `JoinCore::join_core` to render \
21 linear joins.",
22);
23
24pub const ENABLE_CORRECTION_V2: Config<bool> = Config::new(
26 "enable_compute_correction_v2",
27 false,
28 "Whether compute should use the new MV sink correction buffer implementation.",
29);
30
31pub const ENABLE_MV_APPEND_SMEARING: Config<bool> = Config::new(
33 "enable_compute_mv_append_smearing",
34 true,
35 "Whether the MV sink should distribute appends among workers.",
36);
37
38pub const LINEAR_JOIN_YIELDING: Config<&str> = Config::new(
40 "linear_join_yielding",
41 "work:1000000,time:100",
42 "The yielding behavior compute rendering should apply for linear join operators. Either \
43 'work:<amount>' or 'time:<milliseconds>' or 'work:<amount>,time:<milliseconds>'. Note \
44 that omitting one of 'work' or 'time' will entirely disable join yielding by time or \
45 work, respectively, rather than falling back to some default.",
46);
47
48pub const ENABLE_LGALLOC: Config<bool> = Config::new("enable_lgalloc", true, "Enable lgalloc.");
50
51pub const ENABLE_LGALLOC_EAGER_RECLAMATION: Config<bool> = Config::new(
53 "enable_lgalloc_eager_reclamation",
54 true,
55 "Enable lgalloc's eager return behavior.",
56);
57
58pub const LGALLOC_BACKGROUND_INTERVAL: Config<Duration> = Config::new(
60 "lgalloc_background_interval",
61 Duration::from_secs(1),
62 "Scheduling interval for lgalloc's background worker.",
63);
64
65pub const LGALLOC_FILE_GROWTH_DAMPENER: Config<usize> = Config::new(
67 "lgalloc_file_growth_dampener",
68 0,
69 "Lgalloc's file growth dampener parameter.",
70);
71
72pub const LGALLOC_LOCAL_BUFFER_BYTES: Config<usize> = Config::new(
74 "lgalloc_local_buffer_bytes",
75 32 << 20,
76 "Lgalloc's local buffer bytes parameter.",
77);
78
79pub const LGALLOC_SLOW_CLEAR_BYTES: Config<usize> = Config::new(
81 "lgalloc_slow_clear_bytes",
82 32 << 20,
83 "Clear byte size per size class for every invocation",
84);
85
86pub const ENABLE_COLUMNATION_LGALLOC: Config<bool> = Config::new(
88 "enable_columnation_lgalloc",
89 true,
90 "Enable allocating regions from lgalloc.",
91);
92
93pub const ENABLE_COLUMNAR_LGALLOC: Config<bool> = Config::new(
95 "enable_columnar_lgalloc",
96 true,
97 "Enable allocating aligned regions in columnar from lgalloc.",
98);
99
100pub const COMPUTE_SERVER_MAINTENANCE_INTERVAL: Config<Duration> = Config::new(
102 "compute_server_maintenance_interval",
103 Duration::from_millis(10),
104 "The interval at which the compute server performs maintenance tasks. Zero enables maintenance on every iteration.",
105);
106
107pub const DATAFLOW_MAX_INFLIGHT_BYTES: Config<Option<usize>> = Config::new(
109 "compute_dataflow_max_inflight_bytes",
110 None,
111 "The maximum number of in-flight bytes emitted by persist_sources feeding \
112 compute dataflows in non-cc clusters.",
113);
114
115pub const DATAFLOW_MAX_INFLIGHT_BYTES_CC: Config<Option<usize>> = Config::new(
120 "compute_dataflow_max_inflight_bytes_cc",
121 None,
122 "The maximum number of in-flight bytes emitted by persist_sources feeding \
123 compute dataflows in cc clusters.",
124);
125
126pub const CONSOLIDATING_VEC_GROWTH_DAMPENER: Config<usize> = Config::new(
129 "consolidating_vec_growth_dampener",
130 0,
131 "Dampener in growth rate for consolidating vector size",
132);
133
134pub const HYDRATION_CONCURRENCY: Config<usize> = Config::new(
136 "compute_hydration_concurrency",
137 4,
138 "Controls how many compute dataflows may hydrate concurrently.",
139);
140
141pub const COPY_TO_S3_PARQUET_ROW_GROUP_FILE_RATIO: Config<usize> = Config::new(
143 "copy_to_s3_parquet_row_group_file_ratio",
144 20,
145 "The ratio (defined as a percentage) of row-group size to max-file-size. \
146 Must be <= 100.",
147);
148
149pub const COPY_TO_S3_ARROW_BUILDER_BUFFER_RATIO: Config<usize> = Config::new(
151 "copy_to_s3_arrow_builder_buffer_ratio",
152 150,
153 "The ratio (defined as a percentage) of arrow-builder size to row-group size. \
154 Must be >= 100.",
155);
156
157pub const COPY_TO_S3_MULTIPART_PART_SIZE_BYTES: Config<usize> = Config::new(
159 "copy_to_s3_multipart_part_size_bytes",
160 1024 * 1024 * 8,
161 "The size of each part in a multipart upload to S3.",
162);
163
164pub const ENABLE_COMPUTE_REPLICA_EXPIRATION: Config<bool> = Config::new(
168 "enable_compute_replica_expiration",
169 true,
170 "Main switch to disable replica expiration.",
171);
172
173pub const COMPUTE_REPLICA_EXPIRATION_OFFSET: Config<Duration> = Config::new(
179 "compute_replica_expiration_offset",
180 Duration::ZERO,
181 "The expiration time offset for replicas. Zero disables expiration.",
182);
183
184pub const COMPUTE_APPLY_COLUMN_DEMANDS: Config<bool> = Config::new(
188 "compute_apply_column_demands",
189 true,
190 "When enabled, passes applys column demands to the RelationDesc used to read out of Persist.",
191);
192
193pub const ENABLE_COMPUTE_RENDER_FUELED_AS_SPECIFIC_COLLECTION: Config<bool> = Config::new(
195 "enable_compute_render_fueled_as_specific_collection",
196 true,
197 "When enabled, renders `as_specific_collection` using a fueled flat-map operator.",
198);
199
200pub const ENABLE_COMPUTE_LOGICAL_BACKPRESSURE: Config<bool> = Config::new(
202 "enable_compute_logical_backpressure",
203 false,
204 "When enabled, compute dataflows will apply logical backpressure.",
205);
206
207pub const COMPUTE_LOGICAL_BACKPRESSURE_MAX_RETAINED_CAPABILITIES: Config<Option<usize>> =
216 Config::new(
217 "compute_logical_backpressure_max_retained_capabilities",
218 Some(30 * 24 * 60),
219 "The maximum number of capabilities retained by the logical backpressure operator.",
220 );
221
222pub const COMPUTE_LOGICAL_BACKPRESSURE_INFLIGHT_SLACK: Config<Duration> = Config::new(
227 "compute_logical_backpressure_inflight_slack",
228 Duration::from_secs(1),
229 "Round observed timestamps to slack.",
230);
231
232pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet {
234 configs
235 .add(&ENABLE_MZ_JOIN_CORE)
236 .add(&ENABLE_CORRECTION_V2)
237 .add(&ENABLE_MV_APPEND_SMEARING)
238 .add(&LINEAR_JOIN_YIELDING)
239 .add(&ENABLE_LGALLOC)
240 .add(&LGALLOC_BACKGROUND_INTERVAL)
241 .add(&LGALLOC_FILE_GROWTH_DAMPENER)
242 .add(&LGALLOC_LOCAL_BUFFER_BYTES)
243 .add(&LGALLOC_SLOW_CLEAR_BYTES)
244 .add(&ENABLE_LGALLOC_EAGER_RECLAMATION)
245 .add(&ENABLE_COLUMNATION_LGALLOC)
246 .add(&ENABLE_COLUMNAR_LGALLOC)
247 .add(&COMPUTE_SERVER_MAINTENANCE_INTERVAL)
248 .add(&DATAFLOW_MAX_INFLIGHT_BYTES)
249 .add(&DATAFLOW_MAX_INFLIGHT_BYTES_CC)
250 .add(&HYDRATION_CONCURRENCY)
251 .add(©_TO_S3_PARQUET_ROW_GROUP_FILE_RATIO)
252 .add(©_TO_S3_ARROW_BUILDER_BUFFER_RATIO)
253 .add(©_TO_S3_MULTIPART_PART_SIZE_BYTES)
254 .add(&ENABLE_COMPUTE_REPLICA_EXPIRATION)
255 .add(&COMPUTE_REPLICA_EXPIRATION_OFFSET)
256 .add(&COMPUTE_APPLY_COLUMN_DEMANDS)
257 .add(&CONSOLIDATING_VEC_GROWTH_DAMPENER)
258 .add(&ENABLE_COMPUTE_RENDER_FUELED_AS_SPECIFIC_COLLECTION)
259 .add(&ENABLE_COMPUTE_LOGICAL_BACKPRESSURE)
260 .add(&COMPUTE_LOGICAL_BACKPRESSURE_MAX_RETAINED_CAPABILITIES)
261 .add(&COMPUTE_LOGICAL_BACKPRESSURE_INFLIGHT_SLACK)
262}