diff --git a/src/analytic_engine/src/memtable/mod.rs b/src/analytic_engine/src/memtable/mod.rs index e6b1b36dc3..b608729800 100644 --- a/src/analytic_engine/src/memtable/mod.rs +++ b/src/analytic_engine/src/memtable/mod.rs @@ -103,9 +103,24 @@ impl Default for LayeredMemtableOptions { impl From for LayeredMemtableOptions { fn from(value: manifest::LayeredMemtableOptions) -> Self { + let mutable_segment_switch_threshold = ReadableSize(value.mutable_segment_switch_threshold); + let enable = match value.enable { Some(Enable::EnableOpt(enable)) => enable, - None => false, + None => { + // For compatibility, mutable_segment_switch_threshold is used to decision + // whether use the layered memtable in former. + // So this situation is possible to exist: + // + // mutable_segment_switch_threshold > 0 and enable none + // + // And in this situation, layered memtable should be used. + if mutable_segment_switch_threshold.0 > 0 { + true + } else { + false + } + } }; Self {