chore(meta): avoid panic by treating error returned from an older version as string
@@ -640,6 +640,9 @@ impl MetaNode {
Ok(r) => {
let reply = r.into_inner();
+ if reply.error.is_empty() {
+ // No error. It does not have to decode an error from an old databend-meta
+
let res: Result<ForwardResponse, MetaAPIError> = reply.into();
match res {
Ok(v) => {
@@ -654,6 +657,14 @@ impl MetaNode {
);
}
}
+ } else {
+ // TODO: workaround: error type changed. new version of databend-meta does not understand old databend-meta error.
+ error!("join cluster via {} fail: {}", addr, &reply.error);
+ errors.push(
+ AnyError::error(&reply.error)
+ .add_context(|| format!("join via: {}", addr.clone())),
+ );
+ }
}
Err(s) => {
error!("join cluster via {} fail: {:?}", addr, s);
