From 6a90414465e24295cd544701f01460ed49a9edc7 Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Fri, 5 Jul 2024 17:07:25 +0800 Subject: [PATCH] fix --- src/meta/src/manager/catalog/mod.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/meta/src/manager/catalog/mod.rs b/src/meta/src/manager/catalog/mod.rs index 4192403a4cbf5..925c9414611b6 100644 --- a/src/meta/src/manager/catalog/mod.rs +++ b/src/meta/src/manager/catalog/mod.rs @@ -1246,9 +1246,18 @@ impl CatalogManager { ) -> MetaResult<()> { let core = &mut *self.core.lock().await; let database_core = &mut core.database; - let tables = &mut database_core.tables; let version = try { - let mut tables = BTreeMapTransaction::new(tables); + let mut tables = BTreeMapTransaction::new(&mut database_core.tables); + let key = (table.database_id, table.schema_id, table.name.clone()); + assert!( + !tables.contains_key(&table.id) + && database_core.in_progress_creation_tracker.contains(&key), + "table must be in creating procedure" + ); + database_core.in_progress_creation_tracker.remove(&key); + database_core + .in_progress_creation_streaming_job + .remove(&table.id); table.stream_job_status = PbStreamJobStatus::Created.into(); tables.insert(table.id, table.clone());