fix: continue if parsing err catalog (#1090)

* fix: continue if parsing err catalog

* fix: change from warn to error
This commit is contained in:
shuiyisong
2023-02-27 19:28:45 +08:00
committed by GitHub
parent 0b3f955ca7
commit 30287e7e41

View File

@@ -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())
})