From 30287e7e41abf469c1f558ebf7b89442e0011b23 Mon Sep 17 00:00:00 2001 From: shuiyisong <113876041+shuiyisong@users.noreply.github.com> Date: Mon, 27 Feb 2023 19:28:45 +0800 Subject: [PATCH] fix: continue if parsing err catalog (#1090) * fix: continue if parsing err catalog * fix: change from warn to error --- src/frontend/src/catalog.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/catalog.rs b/src/frontend/src/catalog.rs index 293f9202c8..814f10452b 100644 --- a/src/frontend/src/catalog.rs +++ b/src/frontend/src/catalog.rs @@ -27,6 +27,7 @@ use catalog::{ RegisterSchemaRequest, RegisterSystemTableRequest, RegisterTableRequest, RenameTableRequest, SchemaProvider, SchemaProviderRef, }; +use common_telemetry::error; use futures::StreamExt; use meta_client::rpc::TableName; use partition::manager::PartitionRuleManagerRef; @@ -156,9 +157,13 @@ impl CatalogList for FrontendCatalogManager { while let Some(r) = iter.next().await { let Kv(k, _) = r?; - let key = CatalogKey::parse(String::from_utf8_lossy(&k)) - .context(InvalidCatalogValueSnafu)?; - res.insert(key.catalog_name); + + let catalog_key = String::from_utf8_lossy(&k); + if let Ok(key) = CatalogKey::parse(catalog_key.as_ref()) { + res.insert(key.catalog_name); + } else { + error!("invalid catalog key: {:?}", catalog_key); + } } Ok(res.into_iter().collect()) })