From b2c6fce3bcc52944cbd84f6a96772bc25dd19709 Mon Sep 17 00:00:00 2001 From: Ruihang Xia Date: Sun, 24 Nov 2024 18:25:00 +0800 Subject: [PATCH] fix: prevent metadata region from inheriting database ttl Signed-off-by: Ruihang Xia --- src/metric-engine/src/engine/create.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/metric-engine/src/engine/create.rs b/src/metric-engine/src/engine/create.rs index 0523dd1e5389..dd3b5cb1f358 100644 --- a/src/metric-engine/src/engine/create.rs +++ b/src/metric-engine/src/engine/create.rs @@ -458,7 +458,7 @@ impl MetricEngineInner { // remove TTL and APPEND_MODE option let mut options = request.options.clone(); - options.remove(TTL_KEY); + options.insert(TTL_KEY.to_string(), "10000 years".to_string()); options.remove(APPEND_MODE_KEY); RegionCreateRequest { @@ -724,6 +724,9 @@ mod test { metadata_region_request.region_dir, "/test_dir/metadata/".to_string() ); - assert!(!metadata_region_request.options.contains_key("ttl")); + assert_eq!( + metadata_region_request.options.get("ttl").unwrap(), + "10000 years" + ); } }