diff --git a/src/query/service/src/catalogs/default/mutable_catalog.rs b/src/query/service/src/catalogs/default/mutable_catalog.rs index 2fb6249342cf..8c559f34915c 100644 --- a/src/query/service/src/catalogs/default/mutable_catalog.rs +++ b/src/query/service/src/catalogs/default/mutable_catalog.rs @@ -118,6 +118,7 @@ use databend_common_meta_types::seq_value::SeqV; use databend_common_meta_types::MetaId; use fastrace::func_name; use log::info; +use log::warn; use crate::catalogs::default::catalog_context::CatalogContext; use crate::databases::Database; @@ -250,11 +251,18 @@ impl Catalog for MutableCatalog { }) .await?; - dbs.iter().try_fold(vec![], |mut acc, item| { - let db = self.build_db_instance(item)?; - acc.push(db); - Ok(acc) - }) + dbs.iter() + .try_fold(vec![], |mut acc, item: &Arc| { + let db_result = self.build_db_instance(item); + match db_result { + Ok(db) => acc.push(db), + Err(err) => { + // Ignore the error and continue, allow partial failure. + warn!("Failed to build database '{:?}': {:?}", item, err); + } + } + Ok(acc) + }) } #[async_backtrace::framed]