From f751e4662db73c90065801e91b8a70d8c17f0aa3 Mon Sep 17 00:00:00 2001 From: jinhelin Date: Tue, 27 Feb 2024 18:51:32 +0800 Subject: [PATCH] Add address of WN to message if RPC request failed (#8795) ref pingcap/tiflash#8794 --- dbms/src/Storages/DeltaMerge/SegmentReadTask.cpp | 10 ++++++---- dbms/src/Storages/StorageDisaggregatedRemote.cpp | 8 +++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dbms/src/Storages/DeltaMerge/SegmentReadTask.cpp b/dbms/src/Storages/DeltaMerge/SegmentReadTask.cpp index 4c4b39ddee1..de2befb029c 100644 --- a/dbms/src/Storages/DeltaMerge/SegmentReadTask.cpp +++ b/dbms/src/Storages/DeltaMerge/SegmentReadTask.cpp @@ -574,10 +574,11 @@ void SegmentReadTask::doFetchPages(const disaggregated::FetchDisaggPagesRequest stream_resp.reset(); // Reset to avoid calling `Finish()` repeatedly. RUNTIME_CHECK_MSG( status.ok(), - "Failed to fetch all pages from {}, status={}, message={}", + "Failed to fetch all pages for {}, status={}, message={}, wn_address={}", *this, static_cast(status.error_code()), - status.error_message()); + status.error_message(), + extra_remote_info->store_address); return false; } }, @@ -706,9 +707,10 @@ void SegmentReadTask::doFetchPagesImpl( checkMemTableSetReady(); RUNTIME_CHECK_MSG( remaining_pages_to_fetch.empty(), - "Failed to fetch all pages (from {}), remaining_pages_to_fetch={}", + "Failed to fetch all pages for {}, remaining_pages_to_fetch={}, wn_address={}", *this, - remaining_pages_to_fetch); + remaining_pages_to_fetch, + extra_remote_info->store_address); GET_METRIC(tiflash_disaggregated_breakdown_duration_seconds, type_rpc_fetch_page) .Observe(read_page_ns / 1000000000.0); diff --git a/dbms/src/Storages/StorageDisaggregatedRemote.cpp b/dbms/src/Storages/StorageDisaggregatedRemote.cpp index 271cc9fabf6..883c276eec1 100644 --- a/dbms/src/Storages/StorageDisaggregatedRemote.cpp +++ b/dbms/src/Storages/StorageDisaggregatedRemote.cpp @@ -72,6 +72,7 @@ namespace ErrorCodes { extern const int DISAGG_ESTABLISH_RETRYABLE_ERROR; extern const int TIMEOUT_EXCEEDED; +extern const int UNKNOWN_EXCEPTION; } // namespace ErrorCodes namespace @@ -254,7 +255,12 @@ void StorageDisaggregated::buildReadTaskForWriteNode( req->address(), log->identifier()); else if (!status.ok()) - throw Exception(rpc.errMsg(status)); + throw Exception( + ErrorCodes::UNKNOWN_EXCEPTION, + "EstablishDisaggTask failed, wn_address={}, errmsg={}, {}", + req->address(), + rpc.errMsg(status), + log->identifier()); const DM::DisaggTaskId snapshot_id(resp.snapshot_id()); LOG_DEBUG(