diff --git a/src/metric-engine/src/engine.rs b/src/metric-engine/src/engine.rs index 7f54321d639c..f8587a3b1fe6 100644 --- a/src/metric-engine/src/engine.rs +++ b/src/metric-engine/src/engine.rs @@ -163,9 +163,9 @@ impl RegionEngine for MetricEngine { /// Note: Returns `None` if it's a logical region. async fn region_disk_usage(&self, region_id: RegionId) -> Option { if self.inner.is_physical_region(region_id).await { - None - } else { self.inner.mito.region_disk_usage(region_id).await + } else { + None } } @@ -203,9 +203,9 @@ impl RegionEngine for MetricEngine { /// Note: Returns `None` if it's a logical region. async fn role(&self, region_id: RegionId) -> Option { if self.inner.is_physical_region(region_id).await { - None - } else { self.inner.mito.role(region_id).await + } else { + None } } @@ -319,7 +319,7 @@ mod test { let physical_region_id = env.default_physical_region_id(); assert!(env.metric().role(logical_region_id).await.is_none()); - assert!(env.metric().role(physical_region_id).await.is_none()); + assert!(env.metric().role(physical_region_id).await.is_some()); } #[tokio::test] @@ -339,6 +339,6 @@ mod test { .metric() .region_disk_usage(physical_region_id) .await - .is_none()); + .is_some()); } }