From 9faa0240b9d4c9aa0cebef88e8d05f2271d45c0b Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Tue, 3 Nov 2026 13:25:14 +0000 Subject: [PATCH] fix: include peer context in distributed query errors (#10118) Signed-off-by: WenyXu (cherry picked from commit 8deb3872b3283b01ebc629a5d1642b7053b65fbb) Signed-off-by: WenyXu --- src/catalog/src/error.rs | 3 ++- src/catalog/src/information_extension.rs | 4 +++- src/client/src/error.rs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/catalog/src/error.rs b/src/catalog/src/error.rs index 58c5ef96b96..24bf61a6b0e 100644 --- a/src/catalog/src/error.rs +++ b/src/catalog/src/error.rs @@ -291,8 +291,9 @@ pub enum Error { location: Location, }, - #[snafu(display("Failed to handle query"))] + #[snafu(display("Failed to handle query, addr: {}", addr))] HandleQuery { + addr: String, source: common_meta::error::Error, #[snafu(implicit)] location: Location, diff --git a/src/catalog/src/information_extension.rs b/src/catalog/src/information_extension.rs index f22c169df13..0c572eac562 100644 --- a/src/catalog/src/information_extension.rs +++ b/src/catalog/src/information_extension.rs @@ -84,7 +84,9 @@ impl DistributedInformationExtension { header: None, }) .await - .context(crate::error::HandleQuerySnafu) + .context(crate::error::HandleQuerySnafu { + addr: node.peer.addr, + }) } })) .await?; diff --git a/src/client/src/error.rs b/src/client/src/error.rs index d9fa8c96050..afa834655e5 100644 --- a/src/client/src/error.rs +++ b/src/client/src/error.rs @@ -42,7 +42,7 @@ pub enum Error { location: Location, }, - #[snafu(display("Failed to do Flight get, code: {}", tonic_code))] + #[snafu(display("Failed to do Flight get, addr: {}, code: {}", addr, tonic_code))] FlightGet { addr: String, tonic_code: Code,