Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(catalog): ignore error when listing databases #16514

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/query/service/src/catalogs/default/mutable_catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<DatabaseInfo>| {
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]
Expand Down
Loading