Skip to content

Commit

Permalink
Add address of WN to message if RPC request failed (#8795)
Browse files Browse the repository at this point in the history
ref #8794
  • Loading branch information
JinheLin authored Feb 27, 2024
1 parent ef90ce4 commit f751e46
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 6 additions & 4 deletions dbms/src/Storages/DeltaMerge/SegmentReadTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(status.error_code()),
status.error_message());
status.error_message(),
extra_remote_info->store_address);
return false;
}
},
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion dbms/src/Storages/StorageDisaggregatedRemote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit f751e46

Please sign in to comment.