Skip to content

Commit

Permalink
M src/meta/api/src/schema_api_impl.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer committed Sep 30, 2024
1 parent 3f9034d commit 0bb9b76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
16 changes: 4 additions & 12 deletions src/meta/api/src/schema_api_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2730,18 +2730,10 @@ impl<KV: kvapi::KVApi<Error = MetaError> + ?Sized> SchemaApi for KV {
}
};

let db_info = Arc::new(DatabaseInfo {
database_id: seq_db_id.data,
name_ident: tenant_dbname.clone(),
meta: db_meta,
});
let table_nivs = get_history_tables_for_gc(
self,
drop_time_range.clone(),
db_info.database_id.db_id,
the_limit,
)
.await?;
let database_id = seq_db_id.data;
let table_nivs =
get_history_tables_for_gc(self, drop_time_range.clone(), database_id.db_id, the_limit)
.await?;

let mut drop_ids = vec![];
let mut vacuum_tables = vec![];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,10 @@ impl Interpreter for VacuumDropTablesInterpreter {
.await?;

// map: table id to its belonging db id
let mut belonging_db = BTreeMap::new();
let mut containing_db = BTreeMap::new();
for drop_id in drop_ids.iter() {
match drop_id {
DroppedId::Table { name, id } => {
belonging_db.insert(id.table_id, name.db_id);
}
_ => {}
if let DroppedId::Table { name, id } = drop_id {
containing_db.insert(id.table_id, name.db_id);
}
}

Expand Down Expand Up @@ -184,7 +181,7 @@ impl Interpreter for VacuumDropTablesInterpreter {
let failed_db_ids = failed_tables
.iter()
// Safe unwrap: the map is built from drop_ids
.map(|id| *belonging_db.get(id).unwrap())
.map(|id| *containing_db.get(id).unwrap())
.collect::<HashSet<_>>();

// gc metadata only when not dry run
Expand Down

0 comments on commit 0bb9b76

Please sign in to comment.