Skip to content

Commit

Permalink
fix: prevent metadata region from inheriting database ttl
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
  • Loading branch information
waynexia committed Nov 24, 2024
1 parent a6571d3 commit b2c6fce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/metric-engine/src/engine/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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"
);
}
}

0 comments on commit b2c6fce

Please sign in to comment.