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    /// Deprecated. Split now compares observed bytes per second directly with the high threshold.
388    #[serde(default = "default::meta::table_stat_high_write_throughput_ratio_for_split")]
389    #[deprecated]
390    pub table_stat_high_write_throughput_ratio_for_split: f64,
391
392    /// Deprecated. Merge now requires a full observed window with a low peak throughput.
393    #[serde(default = "default::meta::table_stat_low_write_throughput_ratio_for_merge")]
394    #[deprecated]
395    pub table_stat_low_write_throughput_ratio_for_merge: f64,
396
397    /// Deprecated and ignored. Use `table_write_throughput_retention_seconds`.
398    #[serde(default = "default::meta::table_stat_throuput_window_seconds_for_split")]
399    #[deprecated]
400    pub table_stat_throuput_window_seconds_for_split: usize,
401
402    /// Deprecated and ignored. Use `table_write_throughput_retention_seconds`.
403    #[serde(default = "default::meta::table_stat_throuput_window_seconds_for_merge")]
404    #[deprecated]
405    pub table_stat_throuput_window_seconds_for_merge: usize,
406
407    /// Retention in seconds for successful commit throughput observations. Split uses the
408    /// latest observed rate; merge requires a full observed retention with a low peak.
409    /// Six buckets may retain a boundary sample for up to one extra bucket
410    /// (one fifth of retention, at least one second). Zero retention is treated as one second.
411    #[serde(default = "default::meta::table_write_throughput_retention_seconds")]
412    pub table_write_throughput_retention_seconds: usize,
413
414    /// 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.
415    /// Set it max value of 64-bit number to disable this feature.
416    #[serde(default = "default::meta::compact_task_table_size_partition_threshold_low")]
417    pub compact_task_table_size_partition_threshold_low: u64,
418
419    /// 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.
420    /// Set it max value of 64-bit number to disable this feature.
421    #[serde(default = "default::meta::compact_task_table_size_partition_threshold_high")]
422    pub compact_task_table_size_partition_threshold_high: u64,
423
424    /// The interval of the regular periodic compaction group split job.
425    /// This does not disable merge-triggered normalize splits when
426    /// `enable_compaction_group_normalize` is enabled.
427    #[serde(
428        default = "default::meta::periodic_scheduling_compaction_group_split_interval_sec",
429        alias = "periodic_split_compact_group_interval_sec"
430    )]
431    pub periodic_scheduling_compaction_group_split_interval_sec: u64,
432
433    /// Whether to normalize overlapping compaction groups before the regular merge scheduling.
434    #[serde(default = "default::meta::enable_compaction_group_normalize")]
435    pub enable_compaction_group_normalize: bool,
436
437    /// The maximum number of normalize splits in one scheduler round. Must be greater than 0.
438    #[serde(
439        default = "default::meta::max_normalize_splits_per_round",
440        deserialize_with = "deserialize_max_normalize_splits_per_round"
441    )]
442    pub max_normalize_splits_per_round: u64,
443
444    /// The interval of the periodic scheduling compaction group merge job.
445    #[serde(default = "default::meta::periodic_scheduling_compaction_group_merge_interval_sec")]
446    pub periodic_scheduling_compaction_group_merge_interval_sec: u64,
447
448    /// 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.
449    #[serde(default = "default::meta::compaction_group_merge_dimension_threshold")]
450    pub compaction_group_merge_dimension_threshold: f64,
451
452    /// The interval that the CDC table splits initialization should yield to avoid overloading upstream system.
453    #[serde(default = "default::meta::cdc_table_split_init_sleep_interval_splits")]
454    pub cdc_table_split_init_sleep_interval_splits: u64,
455
456    /// The duration that the CDC table splits initialization should yield to avoid overloading upstream system.
457    #[serde(default = "default::meta::cdc_table_split_init_sleep_duration_millis")]
458    pub cdc_table_split_init_sleep_duration_millis: u64,
459
460    /// The batch size that the CDC table splits initialization should use when persisting to meta store.
461    #[serde(default = "default::meta::cdc_table_split_init_insert_batch_size")]
462    pub cdc_table_split_init_insert_batch_size: u64,
463
464    /// Whether to automatically migrate legacy table fragments when meta starts.
465    #[serde(default = "default::meta::enable_legacy_table_migration")]
466    pub enable_legacy_table_migration: bool,
467
468    #[serde(default)]
469    #[config_doc(nested)]
470    pub meta_store_config: MetaStoreConfig,
471}
472
473/// Note: only applies to meta store backends other than `SQLite`.
474#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
475#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde, ConfigDoc)]
476pub struct MetaStoreConfig {
477    /// Maximum number of connections for the meta store connection pool.
478    #[serde(default = "default::meta_store_config::max_connections")]
479    pub max_connections: u32,
480    /// Minimum number of connections for the meta store connection pool.
481    #[serde(default = "default::meta_store_config::min_connections")]
482    pub min_connections: u32,
483    /// Connection timeout in seconds for a meta store connection.
484    #[serde(default = "default::meta_store_config::connection_timeout_sec")]
485    pub connection_timeout_sec: u64,
486    /// Idle timeout in seconds for a meta store connection.
487    #[serde(default = "default::meta_store_config::idle_timeout_sec")]
488    pub idle_timeout_sec: u64,
489    /// Acquire timeout in seconds for a meta store connection.
490    #[serde(default = "default::meta_store_config::acquire_timeout_sec")]
491    pub acquire_timeout_sec: u64,
492}
493
494fn deserialize_max_normalize_splits_per_round<'de, D>(deserializer: D) -> Result<u64, D::Error>
495where
496    D: serde::Deserializer<'de>,
497{
498    let value = u64::deserialize(deserializer)?;
499    if value == 0 {
500        return Err(D::Error::custom(
501            "meta.max_normalize_splits_per_round must be greater than 0",
502        ));
503    }
504    Ok(value)
505}
506
507/// The subsections `[meta.developer]`.
508///
509/// It is put at [`MetaConfig::developer`].
510#[serde_prefix_all("meta_", mode = "alias")]
511#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
512#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde, ConfigDoc)]
513pub struct MetaDeveloperConfig {
514    /// The number of traces to be cached in-memory by the tracing collector
515    /// embedded in the meta node.
516    #[serde(default = "default::developer::meta_cached_traces_num")]
517    pub cached_traces_num: u32,
518
519    /// The maximum memory usage in bytes for the tracing collector embedded
520    /// in the meta node.
521    #[serde(default = "default::developer::meta_cached_traces_memory_limit_bytes")]
522    pub cached_traces_memory_limit_bytes: usize,
523
524    /// Compaction picker config
525    #[serde(default = "default::developer::enable_trivial_move")]
526    pub enable_trivial_move: bool,
527    #[serde(default = "default::developer::enable_check_task_level_overlap")]
528    pub enable_check_task_level_overlap: bool,
529    #[serde(default = "default::developer::max_trivial_move_task_count_per_loop")]
530    pub max_trivial_move_task_count_per_loop: usize,
531
532    #[serde(default = "default::developer::max_get_task_probe_times")]
533    pub max_get_task_probe_times: usize,
534
535    /// Max number of actor allowed per parallelism (default = 100).
536    /// CREATE MV/Table will be noticed when the number of actors exceeds this limit.
537    #[serde(default = "default::developer::actor_cnt_per_worker_parallelism_soft_limit")]
538    pub actor_cnt_per_worker_parallelism_soft_limit: usize,
539
540    /// Max number of actor allowed per parallelism (default = 400).
541    /// CREATE MV/Table will be rejected when the number of actors exceeds this limit.
542    #[serde(default = "default::developer::actor_cnt_per_worker_parallelism_hard_limit")]
543    pub actor_cnt_per_worker_parallelism_hard_limit: usize,
544
545    /// Max number of SSTs fetched from meta store per SELECT, during time travel Hummock version replay.
546    #[serde(default = "default::developer::hummock_time_travel_sst_info_fetch_batch_size")]
547    pub hummock_time_travel_sst_info_fetch_batch_size: usize,
548
549    /// Max number of SSTs inserted into meta store per INSERT, during time travel metadata writing.
550    #[serde(default = "default::developer::hummock_time_travel_sst_info_insert_batch_size")]
551    pub hummock_time_travel_sst_info_insert_batch_size: usize,
552
553    #[serde(default = "default::developer::time_travel_vacuum_interval_sec")]
554    pub time_travel_vacuum_interval_sec: u64,
555
556    #[serde(default = "default::developer::time_travel_vacuum_max_version_count")]
557    pub time_travel_vacuum_max_version_count: Option<u32>,
558
559    /// Max number of epoch-to-version inserted into meta store per INSERT, during time travel metadata writing.
560    #[serde(default = "default::developer::hummock_time_travel_epoch_version_insert_batch_size")]
561    pub hummock_time_travel_epoch_version_insert_batch_size: usize,
562
563    /// Max number of version deltas fetched from meta store per SELECT, during time travel metadata vacuum.
564    #[serde(default = "default::developer::hummock_time_travel_delta_fetch_batch_size")]
565    pub hummock_time_travel_delta_fetch_batch_size: usize,
566
567    #[serde(default = "default::developer::hummock_gc_history_insert_batch_size")]
568    pub hummock_gc_history_insert_batch_size: usize,
569
570    #[serde(default = "default::developer::hummock_time_travel_filter_out_objects_batch_size")]
571    pub hummock_time_travel_filter_out_objects_batch_size: usize,
572
573    #[serde(default = "default::developer::hummock_time_travel_filter_out_objects_v1")]
574    pub hummock_time_travel_filter_out_objects_v1: bool,
575
576    #[serde(
577        default = "default::developer::hummock_time_travel_filter_out_objects_list_version_batch_size"
578    )]
579    pub hummock_time_travel_filter_out_objects_list_version_batch_size: usize,
580
581    #[serde(
582        default = "default::developer::hummock_time_travel_filter_out_objects_list_delta_batch_size"
583    )]
584    pub hummock_time_travel_filter_out_objects_list_delta_batch_size: usize,
585
586    #[serde(default)]
587    pub compute_client_config: RpcClientConfig,
588
589    #[serde(default)]
590    pub stream_client_config: RpcClientConfig,
591
592    #[serde(default)]
593    pub frontend_client_config: RpcClientConfig,
594
595    #[serde(default = "default::developer::table_change_log_insert_batch_size")]
596    pub table_change_log_insert_batch_size: u64,
597
598    #[serde(default = "default::developer::table_change_log_delete_batch_size")]
599    pub table_change_log_delete_batch_size: u64,
600
601    #[serde(default = "default::developer::table_change_log_truncate_interval_sec")]
602    pub table_change_log_truncate_interval_sec: u64,
603}
604
605#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
606#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde, ConfigDoc)]
607pub struct CompactionConfig {
608    #[serde(default = "default::compaction_config::max_bytes_for_level_base")]
609    pub max_bytes_for_level_base: u64,
610    #[serde(default = "default::compaction_config::max_bytes_for_level_multiplier")]
611    pub max_bytes_for_level_multiplier: u64,
612    #[serde(default = "default::compaction_config::max_compaction_bytes")]
613    pub max_compaction_bytes: u64,
614    #[serde(default = "default::compaction_config::sub_level_max_compaction_bytes")]
615    pub sub_level_max_compaction_bytes: u64,
616    #[serde(default = "default::compaction_config::level0_tier_compact_file_number")]
617    pub level0_tier_compact_file_number: u64,
618    #[serde(default = "default::compaction_config::target_file_size_base")]
619    pub target_file_size_base: u64,
620    #[serde(default = "default::compaction_config::compaction_filter_mask")]
621    pub compaction_filter_mask: u32,
622    #[serde(default = "default::compaction_config::max_sub_compaction")]
623    pub max_sub_compaction: u32,
624    #[serde(default = "default::compaction_config::level0_stop_write_threshold_sub_level_number")]
625    pub level0_stop_write_threshold_sub_level_number: u64,
626    #[serde(default = "default::compaction_config::level0_sub_level_compact_level_count")]
627    pub level0_sub_level_compact_level_count: u32,
628    #[serde(
629        default = "default::compaction_config::level0_overlapping_sub_level_compact_level_count"
630    )]
631    pub level0_overlapping_sub_level_compact_level_count: u32,
632    #[serde(default = "default::compaction_config::max_space_reclaim_bytes")]
633    pub max_space_reclaim_bytes: u64,
634    #[serde(default = "default::compaction_config::level0_max_compact_file_number")]
635    pub level0_max_compact_file_number: u64,
636    #[serde(default = "default::compaction_config::tombstone_reclaim_ratio")]
637    pub tombstone_reclaim_ratio: u32,
638    #[serde(default = "default::compaction_config::enable_emergency_picker")]
639    pub enable_emergency_picker: bool,
640    #[serde(default = "default::compaction_config::max_level")]
641    pub max_level: u32,
642    #[serde(default = "default::compaction_config::sst_allowed_trivial_move_min_size")]
643    pub sst_allowed_trivial_move_min_size: u64,
644    #[serde(default = "default::compaction_config::sst_allowed_trivial_move_max_count")]
645    pub sst_allowed_trivial_move_max_count: u32,
646    #[serde(default = "default::compaction_config::max_l0_compact_level_count")]
647    pub max_l0_compact_level_count: u32,
648    #[serde(default = "default::compaction_config::disable_auto_group_scheduling")]
649    pub disable_auto_group_scheduling: bool,
650    #[serde(default = "default::compaction_config::max_overlapping_level_size")]
651    pub max_overlapping_level_size: u64,
652    #[serde(default = "default::compaction_config::emergency_level0_sst_file_count")]
653    pub emergency_level0_sst_file_count: u32,
654    #[serde(default = "default::compaction_config::emergency_level0_sub_level_partition")]
655    pub emergency_level0_sub_level_partition: u32,
656    #[serde(default = "default::compaction_config::level0_stop_write_threshold_max_sst_count")]
657    pub level0_stop_write_threshold_max_sst_count: u32,
658    #[serde(default = "default::compaction_config::level0_stop_write_threshold_max_size")]
659    pub level0_stop_write_threshold_max_size: u64,
660    #[serde(default = "default::compaction_config::enable_optimize_l0_interval_selection")]
661    pub enable_optimize_l0_interval_selection: bool,
662    /// KV-count threshold for using blocked xor filters when output filter layout is "auto".
663    ///
664    /// When `sstable_filter_layout[level]` is "auto", compaction will build blocked xor filters if
665    /// the estimated key count of one output SST exceeds this threshold. Otherwise it will build a
666    /// single non-blocked xor filter for that output.
667    ///
668    /// This is an output-SST-level heuristic. Older versions compared the threshold with the total
669    /// key count of the whole compaction task, which could classify many small output SSTs as
670    /// blocked only because they came from a large task. With the current heuristic, those outputs
671    /// can be classified back to plain filters.
672    ///
673    /// Note: shared-buffer flush does not read compaction group config, and always uses the
674    /// built-in default threshold.
675    #[serde(default = "default::compaction_config::blocked_xor_filter_kv_count_threshold")]
676    #[serde(alias = "max_kv_count_for_xor16")]
677    pub blocked_xor_filter_kv_count_threshold: Option<u64>,
678    #[serde(default = "default::compaction_config::max_vnode_key_range_bytes")]
679    pub max_vnode_key_range_bytes: Option<u64>,
680    /// Per-level SST filter type for compaction output. Supported values: "none", "xor16", "xor8".
681    ///
682    /// Index by LSM level: `0..=max_level`. Note: L0 (index 0) is currently ignored by shared-buffer
683    /// flush, which always uses "xor16".
684    #[serde(default = "default::compaction_config::sstable_filter_type")]
685    pub sstable_filter_type: Vec<String>,
686    /// Per-level xor filter layout for compaction output.
687    ///
688    /// `auto` uses the kv-count heuristic; `plain` forces non-blocked filters; `blocked`
689    /// forces block-based filters. Explicit `plain` and `blocked` values ignore the kv-count
690    /// threshold. This setting is ignored when the corresponding `sstable_filter_type` is "none".
691    ///
692    /// Index by LSM level: `0..=max_level`. Note: L0 (index 0) is currently ignored by shared-buffer
693    /// flush, which always uses "auto".
694    #[serde(default = "default::compaction_config::sstable_filter_layout")]
695    pub sstable_filter_layout: Vec<String>,
696}
697
698pub mod default {
699    pub use crate::config::default::developer;
700
701    pub mod meta {
702        use crate::config::{DefaultParallelism, MetaBackend};
703
704        pub fn min_sst_retention_time_sec() -> u64 {
705            3600 * 6
706        }
707
708        pub fn gc_history_retention_time_sec() -> u64 {
709            3600 * 6
710        }
711
712        pub fn full_gc_interval_sec() -> u64 {
713            3600
714        }
715
716        pub fn full_gc_object_limit() -> u64 {
717            100_000
718        }
719
720        pub fn max_inflight_time_travel_query() -> u64 {
721            1000
722        }
723
724        pub fn periodic_compaction_interval_sec() -> u64 {
725            300
726        }
727
728        pub fn vacuum_interval_sec() -> u64 {
729            30
730        }
731
732        pub fn vacuum_spin_interval_ms() -> u64 {
733            100
734        }
735
736        pub fn iceberg_gc_interval_sec() -> u64 {
737            3600
738        }
739
740        pub fn iceberg_compaction_report_timeout_sec() -> u64 {
741            30 * 60
742        }
743
744        pub fn iceberg_compaction_config_refresh_interval_sec() -> u64 {
745            60
746        }
747
748        pub fn hummock_version_checkpoint_interval_sec() -> u64 {
749            30
750        }
751
752        pub fn checkpoint_read_chunk_size() -> usize {
753            128 * 1024 * 1024 // 128MB
754        }
755
756        pub fn checkpoint_read_max_in_flight_chunks() -> usize {
757            4
758        }
759
760        pub fn enable_hummock_data_archive() -> bool {
761            false
762        }
763
764        pub fn hummock_time_travel_snapshot_interval() -> u64 {
765            100
766        }
767
768        pub fn min_delta_log_num_for_hummock_version_checkpoint() -> u64 {
769            10
770        }
771
772        pub fn max_heartbeat_interval_sec() -> u32 {
773            60
774        }
775
776        pub fn meta_leader_lease_secs() -> u64 {
777            30
778        }
779
780        pub fn default_parallelism() -> DefaultParallelism {
781            DefaultParallelism::Full
782        }
783
784        pub fn pause_on_next_bootstrap_offline() -> bool {
785            false
786        }
787
788        pub fn node_num_monitor_interval_sec() -> u64 {
789            10
790        }
791
792        pub fn backend() -> MetaBackend {
793            MetaBackend::Mem
794        }
795
796        pub fn periodic_space_reclaim_compaction_interval_sec() -> u64 {
797            3600 // 60min
798        }
799
800        pub fn periodic_ttl_reclaim_compaction_interval_sec() -> u64 {
801            1800 // 30mi
802        }
803
804        pub fn periodic_scheduling_compaction_group_split_interval_sec() -> u64 {
805            10 // 10s
806        }
807
808        pub fn periodic_tombstone_reclaim_compaction_interval_sec() -> u64 {
809            600
810        }
811
812        // limit the size of state table to trigger split by high throughput
813        pub fn move_table_size_limit() -> u64 {
814            10 * 1024 * 1024 * 1024 // 10GB
815        }
816
817        // limit the size of group to trigger split by group_size and avoid too many small groups
818        pub fn split_group_size_limit() -> u64 {
819            64 * 1024 * 1024 * 1024 // 64GB
820        }
821
822        pub fn partition_vnode_count() -> u32 {
823            16
824        }
825
826        pub fn table_high_write_throughput_threshold() -> u64 {
827            16 * 1024 * 1024 // 16MB
828        }
829
830        pub fn table_low_write_throughput_threshold() -> u64 {
831            4 * 1024 * 1024 // 4MB
832        }
833
834        pub fn compaction_task_max_heartbeat_interval_secs() -> u64 {
835            30 // 30s
836        }
837
838        pub fn compaction_task_max_progress_interval_secs() -> u64 {
839            60 * 10 // 10min
840        }
841
842        pub fn compaction_task_id_refill_capacity() -> u32 {
843            64
844        }
845
846        pub fn cut_table_size_limit() -> u64 {
847            1024 * 1024 * 1024 // 1GB
848        }
849
850        pub fn hybrid_partition_vnode_count() -> u32 {
851            4
852        }
853
854        pub fn compact_task_table_size_partition_threshold_low() -> u64 {
855            128 * 1024 * 1024 // 128MB
856        }
857
858        pub fn compact_task_table_size_partition_threshold_high() -> u64 {
859            512 * 1024 * 1024 // 512MB
860        }
861
862        pub fn event_log_enabled() -> bool {
863            true
864        }
865
866        pub fn event_log_channel_max_size() -> u32 {
867            10
868        }
869
870        pub fn parallelism_control_batch_size() -> usize {
871            10
872        }
873
874        pub fn parallelism_control_trigger_period_sec() -> u64 {
875            10
876        }
877
878        pub fn parallelism_control_trigger_first_delay_sec() -> u64 {
879            30
880        }
881
882        pub fn enable_dropped_column_reclaim() -> bool {
883            false
884        }
885
886        pub fn split_group_size_ratio() -> f64 {
887            0.9
888        }
889
890        pub fn table_stat_high_write_throughput_ratio_for_split() -> f64 {
891            0.5
892        }
893
894        pub fn table_stat_low_write_throughput_ratio_for_merge() -> f64 {
895            0.7
896        }
897
898        pub fn table_stat_throuput_window_seconds_for_split() -> usize {
899            60
900        }
901
902        pub fn table_stat_throuput_window_seconds_for_merge() -> usize {
903            240
904        }
905
906        pub fn table_write_throughput_retention_seconds() -> usize {
907            300
908        }
909
910        pub fn periodic_scheduling_compaction_group_merge_interval_sec() -> u64 {
911            60 * 10 // 10min
912        }
913
914        pub fn enable_compaction_group_normalize() -> bool {
915            true
916        }
917
918        pub fn max_normalize_splits_per_round() -> u64 {
919            4
920        }
921
922        pub fn compaction_group_merge_dimension_threshold() -> f64 {
923            1.2
924        }
925
926        pub fn cdc_table_split_init_sleep_interval_splits() -> u64 {
927            1000
928        }
929
930        pub fn cdc_table_split_init_sleep_duration_millis() -> u64 {
931            500
932        }
933
934        pub fn cdc_table_split_init_insert_batch_size() -> u64 {
935            100
936        }
937
938        pub fn enable_legacy_table_migration() -> bool {
939            true
940        }
941    }
942
943    pub mod meta_store_config {
944        const DEFAULT_MAX_CONNECTIONS: u32 = 10;
945        const DEFAULT_MIN_CONNECTIONS: u32 = 1;
946        const DEFAULT_CONNECTION_TIMEOUT_SEC: u64 = 10;
947        const DEFAULT_IDLE_TIMEOUT_SEC: u64 = 30;
948        const DEFAULT_ACQUIRE_TIMEOUT_SEC: u64 = 30;
949
950        pub fn max_connections() -> u32 {
951            DEFAULT_MAX_CONNECTIONS
952        }
953
954        pub fn min_connections() -> u32 {
955            DEFAULT_MIN_CONNECTIONS
956        }
957
958        pub fn connection_timeout_sec() -> u64 {
959            DEFAULT_CONNECTION_TIMEOUT_SEC
960        }
961
962        pub fn idle_timeout_sec() -> u64 {
963            DEFAULT_IDLE_TIMEOUT_SEC
964        }
965
966        pub fn acquire_timeout_sec() -> u64 {
967            DEFAULT_ACQUIRE_TIMEOUT_SEC
968        }
969    }
970
971    pub mod compaction_config {
972        const MB: u64 = 1024 * 1024;
973        const GB: u64 = 1024 * 1024 * 1024;
974        const DEFAULT_MAX_COMPACTION_BYTES: u64 = 2 * GB; // 2GB
975        const DEFAULT_MIN_COMPACTION_BYTES: u64 = 128 * MB; // 128MB
976        const DEFAULT_MAX_BYTES_FOR_LEVEL_BASE: u64 = 512 * MB; // 512MB
977
978        // decrease this configure when the generation of checkpoint barrier is not frequent.
979        const DEFAULT_TIER_COMPACT_TRIGGER_NUMBER: u64 = 12;
980        const DEFAULT_TARGET_FILE_SIZE_BASE: u64 = 32 * MB;
981        // 32MB
982        const DEFAULT_MAX_SUB_COMPACTION: u32 = 4;
983        const DEFAULT_LEVEL_MULTIPLIER: u64 = 10;
984        const DEFAULT_MAX_SPACE_RECLAIM_BYTES: u64 = 512 * MB; // 512MB;
985        const DEFAULT_LEVEL0_STOP_WRITE_THRESHOLD_SUB_LEVEL_NUMBER: u64 = 128;
986        const DEFAULT_MAX_COMPACTION_FILE_COUNT: u64 = 100;
987        const DEFAULT_MIN_SUB_LEVEL_COMPACT_LEVEL_COUNT: u32 = 3;
988        const DEFAULT_MIN_OVERLAPPING_SUB_LEVEL_COMPACT_LEVEL_COUNT: u32 = 12;
989        const DEFAULT_TOMBSTONE_RATIO_PERCENT: u32 = 40;
990        const DEFAULT_EMERGENCY_PICKER: bool = true;
991        const DEFAULT_MAX_LEVEL: u32 = 6;
992        const DEFAULT_MAX_L0_COMPACT_LEVEL_COUNT: u32 = 42;
993        const DEFAULT_SST_ALLOWED_TRIVIAL_MOVE_MIN_SIZE: u64 = 4 * MB;
994        const DEFAULT_SST_ALLOWED_TRIVIAL_MOVE_MAX_COUNT: u32 = 256;
995        const DEFAULT_EMERGENCY_LEVEL0_SST_FILE_COUNT: u32 = 2000; // > 50G / 32M = 1600
996        const DEFAULT_EMERGENCY_LEVEL0_SUB_LEVEL_PARTITION: u32 = 256;
997        const DEFAULT_LEVEL0_STOP_WRITE_THRESHOLD_MAX_SST_COUNT: u32 = 5000;
998        const DEFAULT_LEVEL0_STOP_WRITE_THRESHOLD_MAX_SIZE: u64 = 300 * 1024 * MB; // 300GB
999        const DEFAULT_ENABLE_OPTIMIZE_L0_INTERVAL_SELECTION: bool = true;
1000        pub const DEFAULT_BLOCKED_XOR_FILTER_KV_COUNT_THRESHOLD: u64 = 256 * 1024;
1001        const DEFAULT_MAX_VNODE_KEY_RANGE_BYTES: Option<u64> = None;
1002
1003        use crate::catalog::hummock::CompactionFilterFlag;
1004
1005        pub fn max_bytes_for_level_base() -> u64 {
1006            DEFAULT_MAX_BYTES_FOR_LEVEL_BASE
1007        }
1008
1009        pub fn max_bytes_for_level_multiplier() -> u64 {
1010            DEFAULT_LEVEL_MULTIPLIER
1011        }
1012
1013        pub fn max_compaction_bytes() -> u64 {
1014            DEFAULT_MAX_COMPACTION_BYTES
1015        }
1016
1017        pub fn sub_level_max_compaction_bytes() -> u64 {
1018            DEFAULT_MIN_COMPACTION_BYTES
1019        }
1020
1021        pub fn level0_tier_compact_file_number() -> u64 {
1022            DEFAULT_TIER_COMPACT_TRIGGER_NUMBER
1023        }
1024
1025        pub fn target_file_size_base() -> u64 {
1026            DEFAULT_TARGET_FILE_SIZE_BASE
1027        }
1028
1029        pub fn compaction_filter_mask() -> u32 {
1030            (CompactionFilterFlag::STATE_CLEAN | CompactionFilterFlag::TTL).into()
1031        }
1032
1033        pub fn max_sub_compaction() -> u32 {
1034            DEFAULT_MAX_SUB_COMPACTION
1035        }
1036
1037        pub fn level0_stop_write_threshold_sub_level_number() -> u64 {
1038            DEFAULT_LEVEL0_STOP_WRITE_THRESHOLD_SUB_LEVEL_NUMBER
1039        }
1040
1041        pub fn level0_sub_level_compact_level_count() -> u32 {
1042            DEFAULT_MIN_SUB_LEVEL_COMPACT_LEVEL_COUNT
1043        }
1044
1045        pub fn level0_overlapping_sub_level_compact_level_count() -> u32 {
1046            DEFAULT_MIN_OVERLAPPING_SUB_LEVEL_COMPACT_LEVEL_COUNT
1047        }
1048
1049        pub fn max_space_reclaim_bytes() -> u64 {
1050            DEFAULT_MAX_SPACE_RECLAIM_BYTES
1051        }
1052
1053        pub fn level0_max_compact_file_number() -> u64 {
1054            DEFAULT_MAX_COMPACTION_FILE_COUNT
1055        }
1056
1057        pub fn tombstone_reclaim_ratio() -> u32 {
1058            DEFAULT_TOMBSTONE_RATIO_PERCENT
1059        }
1060
1061        pub fn enable_emergency_picker() -> bool {
1062            DEFAULT_EMERGENCY_PICKER
1063        }
1064
1065        pub fn max_level() -> u32 {
1066            DEFAULT_MAX_LEVEL
1067        }
1068
1069        pub fn max_l0_compact_level_count() -> u32 {
1070            DEFAULT_MAX_L0_COMPACT_LEVEL_COUNT
1071        }
1072
1073        pub fn sst_allowed_trivial_move_min_size() -> u64 {
1074            DEFAULT_SST_ALLOWED_TRIVIAL_MOVE_MIN_SIZE
1075        }
1076
1077        pub fn disable_auto_group_scheduling() -> bool {
1078            false
1079        }
1080
1081        pub fn max_overlapping_level_size() -> u64 {
1082            256 * MB
1083        }
1084
1085        pub fn sst_allowed_trivial_move_max_count() -> u32 {
1086            DEFAULT_SST_ALLOWED_TRIVIAL_MOVE_MAX_COUNT
1087        }
1088
1089        pub fn emergency_level0_sst_file_count() -> u32 {
1090            DEFAULT_EMERGENCY_LEVEL0_SST_FILE_COUNT
1091        }
1092
1093        pub fn emergency_level0_sub_level_partition() -> u32 {
1094            DEFAULT_EMERGENCY_LEVEL0_SUB_LEVEL_PARTITION
1095        }
1096
1097        pub fn level0_stop_write_threshold_max_sst_count() -> u32 {
1098            DEFAULT_LEVEL0_STOP_WRITE_THRESHOLD_MAX_SST_COUNT
1099        }
1100
1101        pub fn level0_stop_write_threshold_max_size() -> u64 {
1102            DEFAULT_LEVEL0_STOP_WRITE_THRESHOLD_MAX_SIZE
1103        }
1104
1105        pub fn enable_optimize_l0_interval_selection() -> bool {
1106            DEFAULT_ENABLE_OPTIMIZE_L0_INTERVAL_SELECTION
1107        }
1108
1109        pub fn blocked_xor_filter_kv_count_threshold() -> Option<u64> {
1110            Some(DEFAULT_BLOCKED_XOR_FILTER_KV_COUNT_THRESHOLD)
1111        }
1112
1113        /// Default compression algorithm for a given LSM-tree level.
1114        ///
1115        /// This is the single source of truth used by meta's default compaction config builder
1116        /// and by SQL `ALTER COMPACTION GROUP ... SET compression_algorithm = DEFAULT`.
1117        pub fn compression_algorithm_for_level(level: u32) -> &'static str {
1118            // L0/L1 and L2 do not use compression algorithms.
1119            // L3 - L4 use Lz4, else use Zstd.
1120            match level {
1121                0..=2 => "None",
1122                3 | 4 => "Lz4",
1123                _ => "Zstd",
1124            }
1125        }
1126
1127        /// Default compression algorithm vector for levels `0..=max_level`.
1128        pub fn compression_algorithm_vec(max_level: u32) -> Vec<String> {
1129            (0..=max_level)
1130                .map(|level| compression_algorithm_for_level(level).to_owned())
1131                .collect()
1132        }
1133
1134        pub fn max_vnode_key_range_bytes() -> Option<u64> {
1135            DEFAULT_MAX_VNODE_KEY_RANGE_BYTES
1136        }
1137
1138        pub fn sstable_filter_type() -> Vec<String> {
1139            vec![
1140                "xor16".to_owned(),
1141                "xor16".to_owned(),
1142                "xor16".to_owned(),
1143                "xor16".to_owned(),
1144                "xor16".to_owned(),
1145                "xor8".to_owned(),
1146                "xor8".to_owned(),
1147            ]
1148        }
1149
1150        pub fn sstable_filter_layout() -> Vec<String> {
1151            vec![
1152                "auto".to_owned(),
1153                "blocked".to_owned(),
1154                "blocked".to_owned(),
1155                "blocked".to_owned(),
1156                "blocked".to_owned(),
1157                "blocked".to_owned(),
1158                "blocked".to_owned(),
1159            ]
1160        }
1161    }
1162}