Skip to main content

risingwave_common/config/
meta.rs

1// Copyright 2025 RisingWave Labs
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use risingwave_common_proc_macro::serde_prefix_all;
16use serde::de::Error as _;
17
18use super::*;
19
20#[derive(Copy, Clone, Debug, Default, ValueEnum, Serialize, Deserialize)]
21pub enum MetaBackend {
22    #[default]
23    Mem,
24    Sql, // any database url
25    Sqlite,
26    Postgres,
27    Mysql,
28}
29
30/// Compression algorithm for hummock version checkpoint serialization.
31#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
32#[serde(rename_all = "lowercase")]
33#[repr(i32)]
34pub enum CheckpointCompression {
35    /// No compression.
36    ///
37    /// NOTE: The numeric values are aligned with protobuf `CheckpointCompressionAlgorithm`.
38    None = 0,
39    /// Zstd compression (default, good balance between ratio and speed).
40    #[default]
41    Zstd = 1,
42    /// Lz4 compression (faster but lower ratio).
43    Lz4 = 2,
44}
45
46#[cfg(test)]
47mod tests {
48    use risingwave_pb::hummock::CheckpointCompressionAlgorithm;
49
50    use super::CheckpointCompression;
51
52    #[test]
53    fn checkpoint_compression_numeric_values_align_with_pb() {
54        assert_eq!(
55            CheckpointCompression::None as i32,
56            CheckpointCompressionAlgorithm::CheckpointCompressionUnspecified as i32
57        );
58        assert_eq!(
59            CheckpointCompression::Zstd as i32,
60            CheckpointCompressionAlgorithm::CheckpointCompressionZstd as i32
61        );
62        assert_eq!(
63            CheckpointCompression::Lz4 as i32,
64            CheckpointCompressionAlgorithm::CheckpointCompressionLz4 as i32
65        );
66    }
67}
68
69#[derive(Copy, Clone, Debug, Default)]
70pub enum DefaultParallelism {
71    #[default]
72    Full,
73    Default(NonZeroUsize),
74}
75
76impl Serialize for DefaultParallelism {
77    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
78    where
79        S: Serializer,
80    {
81        #[derive(Debug, Serialize, Deserialize)]
82        #[serde(untagged)]
83        enum Parallelism {
84            Str(String),
85            Int(usize),
86        }
87        match self {
88            DefaultParallelism::Full => Parallelism::Str("Full".to_owned()).serialize(serializer),
89            DefaultParallelism::Default(val) => {
90                Parallelism::Int(val.get() as _).serialize(serializer)
91            }
92        }
93    }
94}
95
96impl<'de> Deserialize<'de> for DefaultParallelism {
97    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
98    where
99        D: serde::Deserializer<'de>,
100    {
101        #[derive(Debug, Deserialize)]
102        #[serde(untagged)]
103        enum Parallelism {
104            Str(String),
105            Int(usize),
106        }
107        let p = Parallelism::deserialize(deserializer)?;
108        match p {
109            Parallelism::Str(s) => {
110                if s.trim().eq_ignore_ascii_case("full") {
111                    Ok(DefaultParallelism::Full)
112                } else {
113                    Err(serde::de::Error::custom(format!(
114                        "invalid default parallelism: {}",
115                        s
116                    )))
117                }
118            }
119            Parallelism::Int(i) => Ok(DefaultParallelism::Default(
120                // Note: we won't check whether this exceeds the maximum parallelism (i.e., vnode count)
121                // here because it requires extra context. The check will be done when scheduling jobs.
122                NonZeroUsize::new(i).ok_or_else(|| {
123                    serde::de::Error::custom("default parallelism should not be 0")
124                })?,
125            )),
126        }
127    }
128}
129
130/// The section `[meta]` in `risingwave.toml`.
131#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
132#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde, ConfigDoc)]
133pub struct MetaConfig {
134    /// Objects within `min_sst_retention_time_sec` won't be deleted by hummock full GC, even they
135    /// are dangling.
136    #[serde(default = "default::meta::min_sst_retention_time_sec")]
137    pub min_sst_retention_time_sec: u64,
138
139    /// Interval of automatic hummock full GC.
140    #[serde(default = "default::meta::full_gc_interval_sec")]
141    pub full_gc_interval_sec: u64,
142
143    /// Max number of object per full GC job can fetch.
144    #[serde(default = "default::meta::full_gc_object_limit")]
145    pub full_gc_object_limit: u64,
146
147    /// Duration in seconds to retain garbage collection history data.
148    #[serde(default = "default::meta::gc_history_retention_time_sec")]
149    pub gc_history_retention_time_sec: u64,
150
151    /// Max number of inflight time travel query.
152    #[serde(default = "default::meta::max_inflight_time_travel_query")]
153    pub max_inflight_time_travel_query: u64,
154
155    /// Schedule `Dynamic` compaction for all compaction groups with this interval.
156    /// Groups in cooldown (recently found to have no compaction work) are skipped.
157    #[serde(default = "default::meta::periodic_compaction_interval_sec")]
158    pub periodic_compaction_interval_sec: u64,
159
160    /// Interval of invoking a vacuum job, to remove stale metadata from meta store and objects
161    /// from object store.
162    #[serde(default = "default::meta::vacuum_interval_sec")]
163    pub vacuum_interval_sec: u64,
164
165    /// The spin interval inside a vacuum job. It avoids the vacuum job monopolizing resources of
166    /// meta node.
167    #[serde(default = "default::meta::vacuum_spin_interval_ms")]
168    pub vacuum_spin_interval_ms: u64,
169
170    /// Interval of invoking iceberg garbage collection, to expire old snapshots.
171    #[serde(default = "default::meta::iceberg_gc_interval_sec")]
172    pub iceberg_gc_interval_sec: u64,
173
174    /// Maximum time to wait for an iceberg compaction task report before the lease expires.
175    #[serde(default = "default::meta::iceberg_compaction_report_timeout_sec")]
176    pub iceberg_compaction_report_timeout_sec: u64,
177
178    /// Maximum time to reuse cached iceberg compaction schedule config before refreshing it from
179    /// meta catalog.
180    #[serde(default = "default::meta::iceberg_compaction_config_refresh_interval_sec")]
181    pub iceberg_compaction_config_refresh_interval_sec: u64,
182
183    /// Interval of hummock version checkpoint.
184    #[serde(default = "default::meta::hummock_version_checkpoint_interval_sec")]
185    pub hummock_version_checkpoint_interval_sec: u64,
186
187    /// Compression algorithm for hummock version checkpoint.
188    #[serde(default)]
189    pub checkpoint_compression_algorithm: CheckpointCompression,
190
191    /// Chunk size in bytes for reading large checkpoints.
192    /// Large checkpoints are read in parallel chunks to avoid single-request timeout issues.
193    /// Default: 128MB
194    #[serde(default = "default::meta::checkpoint_read_chunk_size")]
195    pub checkpoint_read_chunk_size: usize,
196
197    /// Maximum number of concurrent chunk reads when reading large checkpoints.
198    /// Higher values may improve read throughput but increase memory usage.
199    /// Memory usage = `checkpoint_read_chunk_size` * `checkpoint_read_max_in_flight_chunks`
200    /// Default: 4
201    #[serde(default = "default::meta::checkpoint_read_max_in_flight_chunks")]
202    pub checkpoint_read_max_in_flight_chunks: usize,
203
204    /// If enabled, `SSTable` object file and version delta will be retained.
205    ///
206    /// `SSTable` object file need to be deleted via full GC.
207    ///
208    /// version delta need to be manually deleted.
209    #[serde(default = "default::meta::enable_hummock_data_archive")]
210    pub enable_hummock_data_archive: bool,
211
212    /// The interval at which a Hummock version snapshot is taken for time travel.
213    ///
214    /// Larger value indicates less storage overhead but worse query performance.
215    #[serde(default = "default::meta::hummock_time_travel_snapshot_interval")]
216    pub hummock_time_travel_snapshot_interval: u64,
217
218    /// The minimum delta log number a new checkpoint should compact, otherwise the checkpoint
219    /// attempt is rejected.
220    #[serde(default = "default::meta::min_delta_log_num_for_hummock_version_checkpoint")]
221    pub min_delta_log_num_for_hummock_version_checkpoint: u64,
222
223    /// Maximum allowed heartbeat interval in seconds.
224    #[serde(default = "default::meta::max_heartbeat_interval_sec")]
225    pub max_heartbeat_interval_secs: u32,
226
227    /// Whether to enable fail-on-recovery. Should only be used in e2e tests.
228    #[serde(default)]
229    pub disable_recovery: bool,
230
231    /// Whether to clean up all foreground creating streaming jobs during recovery.
232    ///
233    /// This preserves the legacy recovery behavior. When disabled, only creating jobs whose
234    /// creation progress cannot be recovered are cleaned up.
235    #[serde(default)]
236    pub clean_all_foreground_jobs_on_recovery: bool,
237
238    /// Whether meta should request pausing all data sources on the next bootstrap.
239    /// This allows us to pause the cluster on next bootstrap in an offline way.
240    /// It's important for standalone or single node deployments.
241    /// In those cases, meta node, frontend and compute may all be co-located.
242    /// If the compute node enters an inconsistent state, and continuously crashloops,
243    /// we may not be able to connect to the cluster to run `alter system set pause_on_next_bootstrap = true;`.
244    /// By providing it in the static config, we can have an offline way to trigger the pause on bootstrap.
245    #[serde(default = "default::meta::pause_on_next_bootstrap_offline")]
246    pub pause_on_next_bootstrap_offline: bool,
247
248    /// Whether to disable adaptive-scaling feature.
249    #[serde(default)]
250    pub disable_automatic_parallelism_control: bool,
251
252    /// The number of streaming jobs per scaling operation.
253    #[serde(default = "default::meta::parallelism_control_batch_size")]
254    pub parallelism_control_batch_size: usize,
255
256    /// The period of parallelism control trigger.
257    #[serde(default = "default::meta::parallelism_control_trigger_period_sec")]
258    pub parallelism_control_trigger_period_sec: u64,
259
260    /// The first delay of parallelism control.
261    #[serde(default = "default::meta::parallelism_control_trigger_first_delay_sec")]
262    pub parallelism_control_trigger_first_delay_sec: u64,
263
264    #[serde(default = "default::meta::meta_leader_lease_secs")]
265    pub meta_leader_lease_secs: u64,
266
267    /// After specified seconds of idle (no mview or flush), the process will be exited.
268    /// It is mainly useful for playgrounds.
269    #[serde(default)]
270    pub dangerous_max_idle_secs: Option<u64>,
271
272    /// The default global parallelism for all streaming jobs, if user doesn't specify the
273    /// parallelism, this value will be used. `FULL` means use all available parallelism units,
274    /// otherwise it's a number.
275    #[serde(default = "default::meta::default_parallelism")]
276    pub default_parallelism: DefaultParallelism,
277
278    /// Whether to enable deterministic compaction scheduling, which
279    /// will disable all auto scheduling of compaction tasks.
280    /// Should only be used in e2e tests.
281    #[serde(default)]
282    pub enable_compaction_deterministic: bool,
283
284    /// Enable sanity check when SSTs are committed.
285    #[serde(default)]
286    pub enable_committed_sst_sanity_check: bool,
287
288    #[serde(default = "default::meta::node_num_monitor_interval_sec")]
289    pub node_num_monitor_interval_sec: u64,
290
291    #[serde(default = "default::meta::backend")]
292    pub backend: MetaBackend,
293
294    /// Schedule `space_reclaim` compaction for all compaction groups with this interval.
295    #[serde(default = "default::meta::periodic_space_reclaim_compaction_interval_sec")]
296    pub periodic_space_reclaim_compaction_interval_sec: u64,
297
298    /// Schedule `ttl_reclaim` compaction for all compaction groups with this interval.
299    #[serde(default = "default::meta::periodic_ttl_reclaim_compaction_interval_sec")]
300    pub periodic_ttl_reclaim_compaction_interval_sec: u64,
301
302    #[serde(default = "default::meta::periodic_tombstone_reclaim_compaction_interval_sec")]
303    pub periodic_tombstone_reclaim_compaction_interval_sec: u64,
304
305    #[serde(default = "default::meta::move_table_size_limit")]
306    #[deprecated]
307    pub move_table_size_limit: u64,
308
309    #[serde(default = "default::meta::split_group_size_limit")]
310    #[deprecated]
311    pub split_group_size_limit: u64,
312
313    #[serde(default = "default::meta::cut_table_size_limit")]
314    #[deprecated]
315    pub cut_table_size_limit: u64,
316
317    #[serde(default, flatten)]
318    #[config_doc(omitted)]
319    pub unrecognized: Unrecognized<Self>,
320
321    /// Whether config object storage bucket lifecycle to purge stale data.
322    #[serde(default)]
323    pub do_not_config_object_storage_lifecycle: bool,
324
325    /// Count of partition in split group. Meta will assign this value to every new group when it splits from default-group by automatically.
326    /// Each partition contains aligned data of `vnode_count / partition_vnode_count` consecutive virtual-nodes of one state table.
327    #[serde(default = "default::meta::partition_vnode_count")]
328    pub partition_vnode_count: u32,
329
330    /// The threshold of write throughput to trigger a group split.
331    #[serde(
332        default = "default::meta::table_high_write_throughput_threshold",
333        alias = "table_write_throughput_threshold"
334    )]
335    pub table_high_write_throughput_threshold: u64,
336
337    #[serde(
338        default = "default::meta::table_low_write_throughput_threshold",
339        alias = "min_table_split_write_throughput"
340    )]
341    /// The threshold of write throughput to trigger a group merge.
342    pub table_low_write_throughput_threshold: u64,
343
344    // If the compaction task does not report heartbeat beyond the
345    // `compaction_task_max_heartbeat_interval_secs` interval, we will cancel the task
346    #[serde(default = "default::meta::compaction_task_max_heartbeat_interval_secs")]
347    pub compaction_task_max_heartbeat_interval_secs: u64,
348
349    // If the compaction task does not change in progress beyond the
350    // `compaction_task_max_heartbeat_interval_secs` interval, we will cancel the task
351    #[serde(default = "default::meta::compaction_task_max_progress_interval_secs")]
352    pub compaction_task_max_progress_interval_secs: u64,
353
354    /// The number of compaction task ids to prefetch from the meta store in one batch.
355    #[serde(default = "default::meta::compaction_task_id_refill_capacity")]
356    pub compaction_task_id_refill_capacity: u32,
357
358    #[serde(default)]
359    #[config_doc(nested)]
360    pub compaction_config: CompactionConfig,
361
362    /// Count of partitions of tables in default group and materialized view group.
363    /// The meta node will decide according to some strategy whether to cut the boundaries of the file according to the vnode alignment.
364    /// Each partition contains aligned data of `vnode_count / hybrid_partition_vnode_count` consecutive virtual-nodes of one state table.
365    /// Set it zero to disable this feature.
366    #[serde(default = "default::meta::hybrid_partition_vnode_count")]
367    pub hybrid_partition_vnode_count: u32,
368
369    #[serde(default = "default::meta::event_log_enabled")]
370    pub event_log_enabled: bool,
371    /// Keeps the latest N events per channel.
372    #[serde(default = "default::meta::event_log_channel_max_size")]
373    pub event_log_channel_max_size: u32,
374
375    #[serde(default)]
376    #[config_doc(nested)]
377    pub developer: MetaDeveloperConfig,
378
379    /// Whether compactor should rewrite row to remove dropped column.
380    #[serde(default = "default::meta::enable_dropped_column_reclaim")]
381    pub enable_dropped_column_reclaim: bool,
382
383    /// Whether to split the compaction group when the size of the group exceeds the `compaction_group_config.max_estimated_group_size() * split_group_size_ratio`.
384    #[serde(default = "default::meta::split_group_size_ratio")]
385    pub split_group_size_ratio: f64,
386
387    // During group scheduling, the configured `*_throughput_ratio` is used to determine if the sample exceeds the threshold.
388    // Use `table_stat_throuput_window_seconds_for_*` to check if the split and merge conditions are met.
389    /// To split the compaction group when the high throughput statistics of the group exceeds the threshold.
390    #[serde(default = "default::meta::table_stat_high_write_throughput_ratio_for_split")]
391    pub table_stat_high_write_throughput_ratio_for_split: f64,
392
393    /// To merge the compaction group when the low throughput statistics of the group exceeds the threshold.
394    #[serde(default = "default::meta::table_stat_low_write_throughput_ratio_for_merge")]
395    pub table_stat_low_write_throughput_ratio_for_merge: f64,
396
397    // Hummock also control the size of samples to be judged during group scheduling by `table_stat_sample_size_for_split` and `table_stat_sample_size_for_merge`.
398    // Will use max(table_stat_throuput_window_seconds_for_split /ckpt, table_stat_throuput_window_seconds_for_merge/ckpt) as the global sample size.
399    // For example, if `table_stat_throuput_window_seconds_for_merge` = 240 and `table_stat_throuput_window_seconds_for_split` = 60, and `ckpt_sec = 1`,
400    //  global sample size will be max(240/1, 60/1), then only the last 60 samples will be considered for split, and so on.
401    /// The window seconds of table throughput statistic history for split compaction group.
402    #[serde(default = "default::meta::table_stat_throuput_window_seconds_for_split")]
403    pub table_stat_throuput_window_seconds_for_split: usize,
404
405    /// The window seconds of table throughput statistic history for merge compaction group.
406    #[serde(default = "default::meta::table_stat_throuput_window_seconds_for_merge")]
407    pub table_stat_throuput_window_seconds_for_merge: usize,
408
409    /// The threshold of table size in one compact task to decide whether to partition one table into `hybrid_partition_vnode_count` parts, which belongs to default group and materialized view group.
410    /// Set it max value of 64-bit number to disable this feature.
411    #[serde(default = "default::meta::compact_task_table_size_partition_threshold_low")]
412    pub compact_task_table_size_partition_threshold_low: u64,
413
414    /// The threshold of table size in one compact task to decide whether to partition one table into `partition_vnode_count` parts, which belongs to default group and materialized view group.
415    /// Set it max value of 64-bit number to disable this feature.
416    #[serde(default = "default::meta::compact_task_table_size_partition_threshold_high")]
417    pub compact_task_table_size_partition_threshold_high: u64,
418
419    /// The interval of the regular periodic compaction group split job.
420    /// This does not disable merge-triggered normalize splits when
421    /// `enable_compaction_group_normalize` is enabled.
422    #[serde(
423        default = "default::meta::periodic_scheduling_compaction_group_split_interval_sec",
424        alias = "periodic_split_compact_group_interval_sec"
425    )]
426    pub periodic_scheduling_compaction_group_split_interval_sec: u64,
427
428    /// Whether to normalize overlapping compaction groups before the regular merge scheduling.
429    #[serde(default = "default::meta::enable_compaction_group_normalize")]
430    pub enable_compaction_group_normalize: bool,
431
432    /// The maximum number of normalize splits in one scheduler round. Must be greater than 0.
433    #[serde(
434        default = "default::meta::max_normalize_splits_per_round",
435        deserialize_with = "deserialize_max_normalize_splits_per_round"
436    )]
437    pub max_normalize_splits_per_round: u64,
438
439    /// The interval of the periodic scheduling compaction group merge job.
440    #[serde(default = "default::meta::periodic_scheduling_compaction_group_merge_interval_sec")]
441    pub periodic_scheduling_compaction_group_merge_interval_sec: u64,
442
443    /// The threshold of each dimension of the compaction group after merging. When the dimension * `compaction_group_merge_dimension_threshold` >= limit, the merging job will be rejected.
444    #[serde(default = "default::meta::compaction_group_merge_dimension_threshold")]
445    pub compaction_group_merge_dimension_threshold: f64,
446
447    /// The interval that the CDC table splits initialization should yield to avoid overloading upstream system.
448    #[serde(default = "default::meta::cdc_table_split_init_sleep_interval_splits")]
449    pub cdc_table_split_init_sleep_interval_splits: u64,
450
451    /// The duration that the CDC table splits initialization should yield to avoid overloading upstream system.
452    #[serde(default = "default::meta::cdc_table_split_init_sleep_duration_millis")]
453    pub cdc_table_split_init_sleep_duration_millis: u64,
454
455    /// The batch size that the CDC table splits initialization should use when persisting to meta store.
456    #[serde(default = "default::meta::cdc_table_split_init_insert_batch_size")]
457    pub cdc_table_split_init_insert_batch_size: u64,
458
459    /// Whether to automatically migrate legacy table fragments when meta starts.
460    #[serde(default = "default::meta::enable_legacy_table_migration")]
461    pub enable_legacy_table_migration: bool,
462
463    #[serde(default)]
464    #[config_doc(nested)]
465    pub meta_store_config: MetaStoreConfig,
466}
467
468/// Note: only applies to meta store backends other than `SQLite`.
469#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
470#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde, ConfigDoc)]
471pub struct MetaStoreConfig {
472    /// Maximum number of connections for the meta store connection pool.
473    #[serde(default = "default::meta_store_config::max_connections")]
474    pub max_connections: u32,
475    /// Minimum number of connections for the meta store connection pool.
476    #[serde(default = "default::meta_store_config::min_connections")]
477    pub min_connections: u32,
478    /// Connection timeout in seconds for a meta store connection.
479    #[serde(default = "default::meta_store_config::connection_timeout_sec")]
480    pub connection_timeout_sec: u64,
481    /// Idle timeout in seconds for a meta store connection.
482    #[serde(default = "default::meta_store_config::idle_timeout_sec")]
483    pub idle_timeout_sec: u64,
484    /// Acquire timeout in seconds for a meta store connection.
485    #[serde(default = "default::meta_store_config::acquire_timeout_sec")]
486    pub acquire_timeout_sec: u64,
487}
488
489fn deserialize_max_normalize_splits_per_round<'de, D>(deserializer: D) -> Result<u64, D::Error>
490where
491    D: serde::Deserializer<'de>,
492{
493    let value = u64::deserialize(deserializer)?;
494    if value == 0 {
495        return Err(D::Error::custom(
496            "meta.max_normalize_splits_per_round must be greater than 0",
497        ));
498    }
499    Ok(value)
500}
501
502/// The subsections `[meta.developer]`.
503///
504/// It is put at [`MetaConfig::developer`].
505#[serde_prefix_all("meta_", mode = "alias")]
506#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
507#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde, ConfigDoc)]
508pub struct MetaDeveloperConfig {
509    /// The number of traces to be cached in-memory by the tracing collector
510    /// embedded in the meta node.
511    #[serde(default = "default::developer::meta_cached_traces_num")]
512    pub cached_traces_num: u32,
513
514    /// The maximum memory usage in bytes for the tracing collector embedded
515    /// in the meta node.
516    #[serde(default = "default::developer::meta_cached_traces_memory_limit_bytes")]
517    pub cached_traces_memory_limit_bytes: usize,
518
519    /// Compaction picker config
520    #[serde(default = "default::developer::enable_trivial_move")]
521    pub enable_trivial_move: bool,
522    #[serde(default = "default::developer::enable_check_task_level_overlap")]
523    pub enable_check_task_level_overlap: bool,
524    #[serde(default = "default::developer::max_trivial_move_task_count_per_loop")]
525    pub max_trivial_move_task_count_per_loop: usize,
526
527    #[serde(default = "default::developer::max_get_task_probe_times")]
528    pub max_get_task_probe_times: usize,
529
530    /// Max number of actor allowed per parallelism (default = 100).
531    /// CREATE MV/Table will be noticed when the number of actors exceeds this limit.
532    #[serde(default = "default::developer::actor_cnt_per_worker_parallelism_soft_limit")]
533    pub actor_cnt_per_worker_parallelism_soft_limit: usize,
534
535    /// Max number of actor allowed per parallelism (default = 400).
536    /// CREATE MV/Table will be rejected when the number of actors exceeds this limit.
537    #[serde(default = "default::developer::actor_cnt_per_worker_parallelism_hard_limit")]
538    pub actor_cnt_per_worker_parallelism_hard_limit: usize,
539
540    /// Max number of SSTs fetched from meta store per SELECT, during time travel Hummock version replay.
541    #[serde(default = "default::developer::hummock_time_travel_sst_info_fetch_batch_size")]
542    pub hummock_time_travel_sst_info_fetch_batch_size: usize,
543
544    /// Max number of SSTs inserted into meta store per INSERT, during time travel metadata writing.
545    #[serde(default = "default::developer::hummock_time_travel_sst_info_insert_batch_size")]
546    pub hummock_time_travel_sst_info_insert_batch_size: usize,
547
548    #[serde(default = "default::developer::time_travel_vacuum_interval_sec")]
549    pub time_travel_vacuum_interval_sec: u64,
550
551    #[serde(default = "default::developer::time_travel_vacuum_max_version_count")]
552    pub time_travel_vacuum_max_version_count: Option<u32>,
553
554    /// Max number of epoch-to-version inserted into meta store per INSERT, during time travel metadata writing.
555    #[serde(default = "default::developer::hummock_time_travel_epoch_version_insert_batch_size")]
556    pub hummock_time_travel_epoch_version_insert_batch_size: usize,
557
558    /// Max number of version deltas fetched from meta store per SELECT, during time travel metadata vacuum.
559    #[serde(default = "default::developer::hummock_time_travel_delta_fetch_batch_size")]
560    pub hummock_time_travel_delta_fetch_batch_size: usize,
561
562    #[serde(default = "default::developer::hummock_gc_history_insert_batch_size")]
563    pub hummock_gc_history_insert_batch_size: usize,
564
565    #[serde(default = "default::developer::hummock_time_travel_filter_out_objects_batch_size")]
566    pub hummock_time_travel_filter_out_objects_batch_size: usize,
567
568    #[serde(default = "default::developer::hummock_time_travel_filter_out_objects_v1")]
569    pub hummock_time_travel_filter_out_objects_v1: bool,
570
571    #[serde(
572        default = "default::developer::hummock_time_travel_filter_out_objects_list_version_batch_size"
573    )]
574    pub hummock_time_travel_filter_out_objects_list_version_batch_size: usize,
575
576    #[serde(
577        default = "default::developer::hummock_time_travel_filter_out_objects_list_delta_batch_size"
578    )]
579    pub hummock_time_travel_filter_out_objects_list_delta_batch_size: usize,
580
581    #[serde(default)]
582    pub compute_client_config: RpcClientConfig,
583
584    #[serde(default)]
585    pub stream_client_config: RpcClientConfig,
586
587    #[serde(default)]
588    pub frontend_client_config: RpcClientConfig,
589
590    #[serde(default = "default::developer::table_change_log_insert_batch_size")]
591    pub table_change_log_insert_batch_size: u64,
592
593    #[serde(default = "default::developer::table_change_log_delete_batch_size")]
594    pub table_change_log_delete_batch_size: u64,
595
596    #[serde(default = "default::developer::table_change_log_truncate_interval_sec")]
597    pub table_change_log_truncate_interval_sec: u64,
598}
599
600#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
601#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde, ConfigDoc)]
602pub struct CompactionConfig {
603    #[serde(default = "default::compaction_config::max_bytes_for_level_base")]
604    pub max_bytes_for_level_base: u64,
605    #[serde(default = "default::compaction_config::max_bytes_for_level_multiplier")]
606    pub max_bytes_for_level_multiplier: u64,
607    #[serde(default = "default::compaction_config::max_compaction_bytes")]
608    pub max_compaction_bytes: u64,
609    #[serde(default = "default::compaction_config::sub_level_max_compaction_bytes")]
610    pub sub_level_max_compaction_bytes: u64,
611    #[serde(default = "default::compaction_config::level0_tier_compact_file_number")]
612    pub level0_tier_compact_file_number: u64,
613    #[serde(default = "default::compaction_config::target_file_size_base")]
614    pub target_file_size_base: u64,
615    #[serde(default = "default::compaction_config::compaction_filter_mask")]
616    pub compaction_filter_mask: u32,
617    #[serde(default = "default::compaction_config::max_sub_compaction")]
618    pub max_sub_compaction: u32,
619    #[serde(default = "default::compaction_config::level0_stop_write_threshold_sub_level_number")]
620    pub level0_stop_write_threshold_sub_level_number: u64,
621    #[serde(default = "default::compaction_config::level0_sub_level_compact_level_count")]
622    pub level0_sub_level_compact_level_count: u32,
623    #[serde(
624        default = "default::compaction_config::level0_overlapping_sub_level_compact_level_count"
625    )]
626    pub level0_overlapping_sub_level_compact_level_count: u32,
627    #[serde(default = "default::compaction_config::max_space_reclaim_bytes")]
628    pub max_space_reclaim_bytes: u64,
629    #[serde(default = "default::compaction_config::level0_max_compact_file_number")]
630    pub level0_max_compact_file_number: u64,
631    #[serde(default = "default::compaction_config::tombstone_reclaim_ratio")]
632    pub tombstone_reclaim_ratio: u32,
633    #[serde(default = "default::compaction_config::enable_emergency_picker")]
634    pub enable_emergency_picker: bool,
635    #[serde(default = "default::compaction_config::max_level")]
636    pub max_level: u32,
637    #[serde(default = "default::compaction_config::sst_allowed_trivial_move_min_size")]
638    pub sst_allowed_trivial_move_min_size: u64,
639    #[serde(default = "default::compaction_config::sst_allowed_trivial_move_max_count")]
640    pub sst_allowed_trivial_move_max_count: u32,
641    #[serde(default = "default::compaction_config::max_l0_compact_level_count")]
642    pub max_l0_compact_level_count: u32,
643    #[serde(default = "default::compaction_config::disable_auto_group_scheduling")]
644    pub disable_auto_group_scheduling: bool,
645    #[serde(default = "default::compaction_config::max_overlapping_level_size")]
646    pub max_overlapping_level_size: u64,
647    #[serde(default = "default::compaction_config::emergency_level0_sst_file_count")]
648    pub emergency_level0_sst_file_count: u32,
649    #[serde(default = "default::compaction_config::emergency_level0_sub_level_partition")]
650    pub emergency_level0_sub_level_partition: u32,
651    #[serde(default = "default::compaction_config::level0_stop_write_threshold_max_sst_count")]
652    pub level0_stop_write_threshold_max_sst_count: u32,
653    #[serde(default = "default::compaction_config::level0_stop_write_threshold_max_size")]
654    pub level0_stop_write_threshold_max_size: u64,
655    #[serde(default = "default::compaction_config::enable_optimize_l0_interval_selection")]
656    pub enable_optimize_l0_interval_selection: bool,
657    /// KV-count threshold for using blocked xor filters when output filter layout is "auto".
658    ///
659    /// When `sstable_filter_layout[level]` is "auto", compaction will build blocked xor filters if
660    /// the estimated key count of one output SST exceeds this threshold. Otherwise it will build a
661    /// single non-blocked xor filter for that output.
662    ///
663    /// This is an output-SST-level heuristic. Older versions compared the threshold with the total
664    /// key count of the whole compaction task, which could classify many small output SSTs as
665    /// blocked only because they came from a large task. With the current heuristic, those outputs
666    /// can be classified back to plain filters.
667    ///
668    /// Note: shared-buffer flush does not read compaction group config, and always uses the
669    /// built-in default threshold.
670    #[serde(default = "default::compaction_config::blocked_xor_filter_kv_count_threshold")]
671    #[serde(alias = "max_kv_count_for_xor16")]
672    pub blocked_xor_filter_kv_count_threshold: Option<u64>,
673    #[serde(default = "default::compaction_config::max_vnode_key_range_bytes")]
674    pub max_vnode_key_range_bytes: Option<u64>,
675    /// Per-level SST filter type for compaction output. Supported values: "none", "xor16", "xor8".
676    ///
677    /// Index by LSM level: `0..=max_level`. Note: L0 (index 0) is currently ignored by shared-buffer
678    /// flush, which always uses "xor16".
679    #[serde(default = "default::compaction_config::sstable_filter_type")]
680    pub sstable_filter_type: Vec<String>,
681    /// Per-level xor filter layout for compaction output.
682    ///
683    /// `auto` uses the kv-count heuristic; `plain` forces non-blocked filters; `blocked`
684    /// forces block-based filters. Explicit `plain` and `blocked` values ignore the kv-count
685    /// threshold. This setting is ignored when the corresponding `sstable_filter_type` is "none".
686    ///
687    /// Index by LSM level: `0..=max_level`. Note: L0 (index 0) is currently ignored by shared-buffer
688    /// flush, which always uses "auto".
689    #[serde(default = "default::compaction_config::sstable_filter_layout")]
690    pub sstable_filter_layout: Vec<String>,
691}
692
693pub mod default {
694    pub use crate::config::default::developer;
695
696    pub mod meta {
697        use crate::config::{DefaultParallelism, MetaBackend};
698
699        pub fn min_sst_retention_time_sec() -> u64 {
700            3600 * 6
701        }
702
703        pub fn gc_history_retention_time_sec() -> u64 {
704            3600 * 6
705        }
706
707        pub fn full_gc_interval_sec() -> u64 {
708            3600
709        }
710
711        pub fn full_gc_object_limit() -> u64 {
712            100_000
713        }
714
715        pub fn max_inflight_time_travel_query() -> u64 {
716            1000
717        }
718
719        pub fn periodic_compaction_interval_sec() -> u64 {
720            300
721        }
722
723        pub fn vacuum_interval_sec() -> u64 {
724            30
725        }
726
727        pub fn vacuum_spin_interval_ms() -> u64 {
728            100
729        }
730
731        pub fn iceberg_gc_interval_sec() -> u64 {
732            3600
733        }
734
735        pub fn iceberg_compaction_report_timeout_sec() -> u64 {
736            30 * 60
737        }
738
739        pub fn iceberg_compaction_config_refresh_interval_sec() -> u64 {
740            60
741        }
742
743        pub fn hummock_version_checkpoint_interval_sec() -> u64 {
744            30
745        }
746
747        pub fn checkpoint_read_chunk_size() -> usize {
748            128 * 1024 * 1024 // 128MB
749        }
750
751        pub fn checkpoint_read_max_in_flight_chunks() -> usize {
752            4
753        }
754
755        pub fn enable_hummock_data_archive() -> bool {
756            false
757        }
758
759        pub fn hummock_time_travel_snapshot_interval() -> u64 {
760            100
761        }
762
763        pub fn min_delta_log_num_for_hummock_version_checkpoint() -> u64 {
764            10
765        }
766
767        pub fn max_heartbeat_interval_sec() -> u32 {
768            60
769        }
770
771        pub fn meta_leader_lease_secs() -> u64 {
772            30
773        }
774
775        pub fn default_parallelism() -> DefaultParallelism {
776            DefaultParallelism::Full
777        }
778
779        pub fn pause_on_next_bootstrap_offline() -> bool {
780            false
781        }
782
783        pub fn node_num_monitor_interval_sec() -> u64 {
784            10
785        }
786
787        pub fn backend() -> MetaBackend {
788            MetaBackend::Mem
789        }
790
791        pub fn periodic_space_reclaim_compaction_interval_sec() -> u64 {
792            3600 // 60min
793        }
794
795        pub fn periodic_ttl_reclaim_compaction_interval_sec() -> u64 {
796            1800 // 30mi
797        }
798
799        pub fn periodic_scheduling_compaction_group_split_interval_sec() -> u64 {
800            10 // 10s
801        }
802
803        pub fn periodic_tombstone_reclaim_compaction_interval_sec() -> u64 {
804            600
805        }
806
807        // limit the size of state table to trigger split by high throughput
808        pub fn move_table_size_limit() -> u64 {
809            10 * 1024 * 1024 * 1024 // 10GB
810        }
811
812        // limit the size of group to trigger split by group_size and avoid too many small groups
813        pub fn split_group_size_limit() -> u64 {
814            64 * 1024 * 1024 * 1024 // 64GB
815        }
816
817        pub fn partition_vnode_count() -> u32 {
818            16
819        }
820
821        pub fn table_high_write_throughput_threshold() -> u64 {
822            16 * 1024 * 1024 // 16MB
823        }
824
825        pub fn table_low_write_throughput_threshold() -> u64 {
826            4 * 1024 * 1024 // 4MB
827        }
828
829        pub fn compaction_task_max_heartbeat_interval_secs() -> u64 {
830            30 // 30s
831        }
832
833        pub fn compaction_task_max_progress_interval_secs() -> u64 {
834            60 * 10 // 10min
835        }
836
837        pub fn compaction_task_id_refill_capacity() -> u32 {
838            64
839        }
840
841        pub fn cut_table_size_limit() -> u64 {
842            1024 * 1024 * 1024 // 1GB
843        }
844
845        pub fn hybrid_partition_vnode_count() -> u32 {
846            4
847        }
848
849        pub fn compact_task_table_size_partition_threshold_low() -> u64 {
850            128 * 1024 * 1024 // 128MB
851        }
852
853        pub fn compact_task_table_size_partition_threshold_high() -> u64 {
854            512 * 1024 * 1024 // 512MB
855        }
856
857        pub fn event_log_enabled() -> bool {
858            true
859        }
860
861        pub fn event_log_channel_max_size() -> u32 {
862            10
863        }
864
865        pub fn parallelism_control_batch_size() -> usize {
866            10
867        }
868
869        pub fn parallelism_control_trigger_period_sec() -> u64 {
870            10
871        }
872
873        pub fn parallelism_control_trigger_first_delay_sec() -> u64 {
874            30
875        }
876
877        pub fn enable_dropped_column_reclaim() -> bool {
878            false
879        }
880
881        pub fn split_group_size_ratio() -> f64 {
882            0.9
883        }
884
885        pub fn table_stat_high_write_throughput_ratio_for_split() -> f64 {
886            0.5
887        }
888
889        pub fn table_stat_low_write_throughput_ratio_for_merge() -> f64 {
890            0.7
891        }
892
893        pub fn table_stat_throuput_window_seconds_for_split() -> usize {
894            60
895        }
896
897        pub fn table_stat_throuput_window_seconds_for_merge() -> usize {
898            240
899        }
900
901        pub fn periodic_scheduling_compaction_group_merge_interval_sec() -> u64 {
902            60 * 10 // 10min
903        }
904
905        pub fn enable_compaction_group_normalize() -> bool {
906            true
907        }
908
909        pub fn max_normalize_splits_per_round() -> u64 {
910            4
911        }
912
913        pub fn compaction_group_merge_dimension_threshold() -> f64 {
914            1.2
915        }
916
917        pub fn cdc_table_split_init_sleep_interval_splits() -> u64 {
918            1000
919        }
920
921        pub fn cdc_table_split_init_sleep_duration_millis() -> u64 {
922            500
923        }
924
925        pub fn cdc_table_split_init_insert_batch_size() -> u64 {
926            100
927        }
928
929        pub fn enable_legacy_table_migration() -> bool {
930            true
931        }
932    }
933
934    pub mod meta_store_config {
935        const DEFAULT_MAX_CONNECTIONS: u32 = 10;
936        const DEFAULT_MIN_CONNECTIONS: u32 = 1;
937        const DEFAULT_CONNECTION_TIMEOUT_SEC: u64 = 10;
938        const DEFAULT_IDLE_TIMEOUT_SEC: u64 = 30;
939        const DEFAULT_ACQUIRE_TIMEOUT_SEC: u64 = 30;
940
941        pub fn max_connections() -> u32 {
942            DEFAULT_MAX_CONNECTIONS
943        }
944
945        pub fn min_connections() -> u32 {
946            DEFAULT_MIN_CONNECTIONS
947        }
948
949        pub fn connection_timeout_sec() -> u64 {
950            DEFAULT_CONNECTION_TIMEOUT_SEC
951        }
952
953        pub fn idle_timeout_sec() -> u64 {
954            DEFAULT_IDLE_TIMEOUT_SEC
955        }
956
957        pub fn acquire_timeout_sec() -> u64 {
958            DEFAULT_ACQUIRE_TIMEOUT_SEC
959        }
960    }
961
962    pub mod compaction_config {
963        const MB: u64 = 1024 * 1024;
964        const GB: u64 = 1024 * 1024 * 1024;
965        const DEFAULT_MAX_COMPACTION_BYTES: u64 = 2 * GB; // 2GB
966        const DEFAULT_MIN_COMPACTION_BYTES: u64 = 128 * MB; // 128MB
967        const DEFAULT_MAX_BYTES_FOR_LEVEL_BASE: u64 = 512 * MB; // 512MB
968
969        // decrease this configure when the generation of checkpoint barrier is not frequent.
970        const DEFAULT_TIER_COMPACT_TRIGGER_NUMBER: u64 = 12;
971        const DEFAULT_TARGET_FILE_SIZE_BASE: u64 = 32 * MB;
972        // 32MB
973        const DEFAULT_MAX_SUB_COMPACTION: u32 = 4;
974        const DEFAULT_LEVEL_MULTIPLIER: u64 = 10;
975        const DEFAULT_MAX_SPACE_RECLAIM_BYTES: u64 = 512 * MB; // 512MB;
976        const DEFAULT_LEVEL0_STOP_WRITE_THRESHOLD_SUB_LEVEL_NUMBER: u64 = 128;
977        const DEFAULT_MAX_COMPACTION_FILE_COUNT: u64 = 100;
978        const DEFAULT_MIN_SUB_LEVEL_COMPACT_LEVEL_COUNT: u32 = 3;
979        const DEFAULT_MIN_OVERLAPPING_SUB_LEVEL_COMPACT_LEVEL_COUNT: u32 = 12;
980        const DEFAULT_TOMBSTONE_RATIO_PERCENT: u32 = 40;
981        const DEFAULT_EMERGENCY_PICKER: bool = true;
982        const DEFAULT_MAX_LEVEL: u32 = 6;
983        const DEFAULT_MAX_L0_COMPACT_LEVEL_COUNT: u32 = 42;
984        const DEFAULT_SST_ALLOWED_TRIVIAL_MOVE_MIN_SIZE: u64 = 4 * MB;
985        const DEFAULT_SST_ALLOWED_TRIVIAL_MOVE_MAX_COUNT: u32 = 256;
986        const DEFAULT_EMERGENCY_LEVEL0_SST_FILE_COUNT: u32 = 2000; // > 50G / 32M = 1600
987        const DEFAULT_EMERGENCY_LEVEL0_SUB_LEVEL_PARTITION: u32 = 256;
988        const DEFAULT_LEVEL0_STOP_WRITE_THRESHOLD_MAX_SST_COUNT: u32 = 5000;
989        const DEFAULT_LEVEL0_STOP_WRITE_THRESHOLD_MAX_SIZE: u64 = 300 * 1024 * MB; // 300GB
990        const DEFAULT_ENABLE_OPTIMIZE_L0_INTERVAL_SELECTION: bool = true;
991        pub const DEFAULT_BLOCKED_XOR_FILTER_KV_COUNT_THRESHOLD: u64 = 256 * 1024;
992        const DEFAULT_MAX_VNODE_KEY_RANGE_BYTES: Option<u64> = None;
993
994        use crate::catalog::hummock::CompactionFilterFlag;
995
996        pub fn max_bytes_for_level_base() -> u64 {
997            DEFAULT_MAX_BYTES_FOR_LEVEL_BASE
998        }
999
1000        pub fn max_bytes_for_level_multiplier() -> u64 {
1001            DEFAULT_LEVEL_MULTIPLIER
1002        }
1003
1004        pub fn max_compaction_bytes() -> u64 {
1005            DEFAULT_MAX_COMPACTION_BYTES
1006        }
1007
1008        pub fn sub_level_max_compaction_bytes() -> u64 {
1009            DEFAULT_MIN_COMPACTION_BYTES
1010        }
1011
1012        pub fn level0_tier_compact_file_number() -> u64 {
1013            DEFAULT_TIER_COMPACT_TRIGGER_NUMBER
1014        }
1015
1016        pub fn target_file_size_base() -> u64 {
1017            DEFAULT_TARGET_FILE_SIZE_BASE
1018        }
1019
1020        pub fn compaction_filter_mask() -> u32 {
1021            (CompactionFilterFlag::STATE_CLEAN | CompactionFilterFlag::TTL).into()
1022        }
1023
1024        pub fn max_sub_compaction() -> u32 {
1025            DEFAULT_MAX_SUB_COMPACTION
1026        }
1027
1028        pub fn level0_stop_write_threshold_sub_level_number() -> u64 {
1029            DEFAULT_LEVEL0_STOP_WRITE_THRESHOLD_SUB_LEVEL_NUMBER
1030        }
1031
1032        pub fn level0_sub_level_compact_level_count() -> u32 {
1033            DEFAULT_MIN_SUB_LEVEL_COMPACT_LEVEL_COUNT
1034        }
1035
1036        pub fn level0_overlapping_sub_level_compact_level_count() -> u32 {
1037            DEFAULT_MIN_OVERLAPPING_SUB_LEVEL_COMPACT_LEVEL_COUNT
1038        }
1039
1040        pub fn max_space_reclaim_bytes() -> u64 {
1041            DEFAULT_MAX_SPACE_RECLAIM_BYTES
1042        }
1043
1044        pub fn level0_max_compact_file_number() -> u64 {
1045            DEFAULT_MAX_COMPACTION_FILE_COUNT
1046        }
1047
1048        pub fn tombstone_reclaim_ratio() -> u32 {
1049            DEFAULT_TOMBSTONE_RATIO_PERCENT
1050        }
1051
1052        pub fn enable_emergency_picker() -> bool {
1053            DEFAULT_EMERGENCY_PICKER
1054        }
1055
1056        pub fn max_level() -> u32 {
1057            DEFAULT_MAX_LEVEL
1058        }
1059
1060        pub fn max_l0_compact_level_count() -> u32 {
1061            DEFAULT_MAX_L0_COMPACT_LEVEL_COUNT
1062        }
1063
1064        pub fn sst_allowed_trivial_move_min_size() -> u64 {
1065            DEFAULT_SST_ALLOWED_TRIVIAL_MOVE_MIN_SIZE
1066        }
1067
1068        pub fn disable_auto_group_scheduling() -> bool {
1069            false
1070        }
1071
1072        pub fn max_overlapping_level_size() -> u64 {
1073            256 * MB
1074        }
1075
1076        pub fn sst_allowed_trivial_move_max_count() -> u32 {
1077            DEFAULT_SST_ALLOWED_TRIVIAL_MOVE_MAX_COUNT
1078        }
1079
1080        pub fn emergency_level0_sst_file_count() -> u32 {
1081            DEFAULT_EMERGENCY_LEVEL0_SST_FILE_COUNT
1082        }
1083
1084        pub fn emergency_level0_sub_level_partition() -> u32 {
1085            DEFAULT_EMERGENCY_LEVEL0_SUB_LEVEL_PARTITION
1086        }
1087
1088        pub fn level0_stop_write_threshold_max_sst_count() -> u32 {
1089            DEFAULT_LEVEL0_STOP_WRITE_THRESHOLD_MAX_SST_COUNT
1090        }
1091
1092        pub fn level0_stop_write_threshold_max_size() -> u64 {
1093            DEFAULT_LEVEL0_STOP_WRITE_THRESHOLD_MAX_SIZE
1094        }
1095
1096        pub fn enable_optimize_l0_interval_selection() -> bool {
1097            DEFAULT_ENABLE_OPTIMIZE_L0_INTERVAL_SELECTION
1098        }
1099
1100        pub fn blocked_xor_filter_kv_count_threshold() -> Option<u64> {
1101            Some(DEFAULT_BLOCKED_XOR_FILTER_KV_COUNT_THRESHOLD)
1102        }
1103
1104        /// Default compression algorithm for a given LSM-tree level.
1105        ///
1106        /// This is the single source of truth used by meta's default compaction config builder
1107        /// and by SQL `ALTER COMPACTION GROUP ... SET compression_algorithm = DEFAULT`.
1108        pub fn compression_algorithm_for_level(level: u32) -> &'static str {
1109            // L0/L1 and L2 do not use compression algorithms.
1110            // L3 - L4 use Lz4, else use Zstd.
1111            match level {
1112                0..=2 => "None",
1113                3 | 4 => "Lz4",
1114                _ => "Zstd",
1115            }
1116        }
1117
1118        /// Default compression algorithm vector for levels `0..=max_level`.
1119        pub fn compression_algorithm_vec(max_level: u32) -> Vec<String> {
1120            (0..=max_level)
1121                .map(|level| compression_algorithm_for_level(level).to_owned())
1122                .collect()
1123        }
1124
1125        pub fn max_vnode_key_range_bytes() -> Option<u64> {
1126            DEFAULT_MAX_VNODE_KEY_RANGE_BYTES
1127        }
1128
1129        pub fn sstable_filter_type() -> Vec<String> {
1130            vec![
1131                "xor16".to_owned(),
1132                "xor16".to_owned(),
1133                "xor16".to_owned(),
1134                "xor16".to_owned(),
1135                "xor16".to_owned(),
1136                "xor8".to_owned(),
1137                "xor8".to_owned(),
1138            ]
1139        }
1140
1141        pub fn sstable_filter_layout() -> Vec<String> {
1142            vec![
1143                "auto".to_owned(),
1144                "blocked".to_owned(),
1145                "blocked".to_owned(),
1146                "blocked".to_owned(),
1147                "blocked".to_owned(),
1148                "blocked".to_owned(),
1149                "blocked".to_owned(),
1150            ]
1151        }
1152    }
1153}