Skip to content

Commit

Permalink
fix log acquire
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia authored and WenyXu committed Nov 7, 2024
1 parent b56bc64 commit 00bb2ea
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/metric-engine/src/engine/region_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

//! Implementation of retrieving logical region's region metadata.
use common_telemetry::info;
use std::collections::HashMap;

use common_telemetry::info;
use store_api::metadata::ColumnMetadata;
use store_api::storage::RegionId;

Expand Down Expand Up @@ -43,7 +44,7 @@ impl MetricEngineInner {
.collect::<Vec<_>>();

// Update cache
let mutable_state = self.state.write().unwrap();
let mut mutable_state = self.state.write().unwrap();
// Merge with existing cached columnd.
let existing_columns = mutable_state
.logical_columns()
Expand All @@ -61,10 +62,7 @@ impl MetricEngineInner {
.collect::<Vec<_>>();
// Sort columns on column name to ensure the order
dedup_columns.sort_unstable_by(|c1, c2| c1.column_schema.name.cmp(&c2.column_schema.name));
self.state
.write()
.unwrap()
.set_logical_columns(logical_region_id, dedup_columns.clone());
mutable_state.set_logical_columns(logical_region_id, dedup_columns.clone());

Ok(dedup_columns)
}
Expand Down

0 comments on commit 00bb2ea

Please sign in to comment.