aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Doronin <dorooleg@yandex.ru>2025-03-28 17:55:30 +0300
committerGitHub <noreply@github.com>2025-03-28 17:55:30 +0300
commit4d4d83d2e7b51ef3b732bc8a6dc4d41924dcb71c (patch)
treeed3e69af5d61ae4a938d4ba5f8137be7a6b204cb
parent5b5dbc522e02e56e93be4974be1f91ca07af858e (diff)
downloadydb-4d4d83d2e7b51ef3b732bc8a6dc4d41924dcb71c.tar.gz
more detailed information about error from blob cache (#16365)
-rw-r--r--ydb/core/tx/columnshard/blob_cache.cpp16
-rw-r--r--ydb/core/tx/columnshard/blob_cache.h4
-rw-r--r--ydb/core/tx/columnshard/blobs_action/tier/adapter.cpp4
-rw-r--r--ydb/core/tx/columnshard/blobs_reader/actor.cpp2
-rw-r--r--ydb/core/tx/columnshard/blobs_reader/read_coordinator.cpp2
5 files changed, 16 insertions, 12 deletions
diff --git a/ydb/core/tx/columnshard/blob_cache.cpp b/ydb/core/tx/columnshard/blob_cache.cpp
index f404a25536..391f57535c 100644
--- a/ydb/core/tx/columnshard/blob_cache.cpp
+++ b/ydb/core/tx/columnshard/blob_cache.cpp
@@ -237,7 +237,7 @@ private:
if (it != Cache.End()) {
Hits->Inc();
HitsBytes->Add(blobRange.Size);
- SendResult(sender, blobRange, NKikimrProto::OK, it.Value(), ctx, true);
+ SendResult(sender, blobRange, NKikimrProto::OK, it.Value(), {}, ctx, true);
return true;
}
@@ -423,10 +423,10 @@ private:
}
void SendResult(const TActorId& to, const TBlobRange& blobRange, NKikimrProto::EReplyStatus status,
- const TString& data, const TActorContext& ctx, const bool fromCache = false) {
+ const TString& data, const TString& detailedError, const TActorContext& ctx, const bool fromCache = false) {
LOG_S_DEBUG("Send result: " << blobRange << " to: " << to << " status: " << status);
- ctx.Send(to, new TEvBlobCache::TEvReadBlobRangeResult(blobRange, status, data, fromCache));
+ ctx.Send(to, new TEvBlobCache::TEvReadBlobRangeResult(blobRange, status, data, detailedError, fromCache));
}
void Handle(TEvBlobStorage::TEvGetResult::TPtr& ev, const TActorContext& ctx) {
@@ -436,7 +436,9 @@ private:
Y_ABORT("Unexpected reply from blobstorage");
}
+ TString detailedError;
if (ev->Get()->Status != NKikimrProto::EReplyStatus::OK) {
+ detailedError = ev->Get()->ToString();
AFL_WARN(NKikimrServices::BLOB_CACHE)("fail", ev->Get()->ToString());
ReadSimpleFailedBytes->Add(ev->Get()->ResponseSz);
ReadSimpleFailedCount->Add(1);
@@ -458,14 +460,14 @@ private:
for (size_t i = 0; i < ev->Get()->ResponseSz; ++i) {
const auto& res = ev->Get()->Responses[i];
- ProcessSingleRangeResult(blobRanges[i], readCookie, res.Status, res.Buffer.ConvertToString(), ctx);
+ ProcessSingleRangeResult(blobRanges[i], readCookie, res.Status, res.Buffer.ConvertToString(), detailedError, ctx);
}
MakeReadRequests(ctx);
}
void ProcessSingleRangeResult(const TBlobRange& blobRange, const ui64 readCookie,
- ui32 status, const TString& data, const TActorContext& ctx) noexcept
+ ui32 status, const TString& data, const TString& detailedError, const TActorContext& ctx) noexcept
{
AFL_DEBUG(NKikimrServices::BLOB_CACHE)("ProcessSingleRangeResult", blobRange);
auto readIt = OutstandingReads.find(blobRange);
@@ -500,7 +502,7 @@ private:
AFL_DEBUG(NKikimrServices::BLOB_CACHE)("ProcessSingleRangeResult", blobRange)("send_replies", readIt->second.Waiting.size());
// Send results to all waiters
for (const auto& to : readIt->second.Waiting) {
- SendResult(to, blobRange, (NKikimrProto::EReplyStatus)status, data, ctx);
+ SendResult(to, blobRange, (NKikimrProto::EReplyStatus)status, data, detailedError, ctx);
}
OutstandingReads.erase(readIt);
@@ -525,7 +527,7 @@ private:
for (size_t i = 0; i < blobRanges.size(); ++i) {
Y_ABORT_UNLESS(blobRanges[i].BlobId.GetTabletId() == tabletId);
- ProcessSingleRangeResult(blobRanges[i], readCookie, NKikimrProto::EReplyStatus::NOTREADY, {}, ctx);
+ ProcessSingleRangeResult(blobRanges[i], readCookie, NKikimrProto::EReplyStatus::NOTREADY, {}, {}, ctx);
}
}
diff --git a/ydb/core/tx/columnshard/blob_cache.h b/ydb/core/tx/columnshard/blob_cache.h
index 75e0ccf0a6..61aa6edcf9 100644
--- a/ydb/core/tx/columnshard/blob_cache.h
+++ b/ydb/core/tx/columnshard/blob_cache.h
@@ -72,14 +72,16 @@ struct TEvBlobCache {
TBlobRange BlobRange;
NKikimrProto::EReplyStatus Status;
TString Data;
+ TString DetailedError;
const bool FromCache = false;
const TInstant ConstructTime = Now();
const TString DataSourceId;
- TEvReadBlobRangeResult(const TBlobRange& blobRange, NKikimrProto::EReplyStatus status, const TString& data, const bool fromCache = false, const TString& dataSourceId = Default<TString>())
+ TEvReadBlobRangeResult(const TBlobRange& blobRange, NKikimrProto::EReplyStatus status, const TString& data, const TString& detailedError, const bool fromCache = false, const TString& dataSourceId = Default<TString>())
: BlobRange(blobRange)
, Status(status)
, Data(data)
+ , DetailedError(detailedError)
, FromCache(fromCache)
, DataSourceId(dataSourceId)
{}
diff --git a/ydb/core/tx/columnshard/blobs_action/tier/adapter.cpp b/ydb/core/tx/columnshard/blobs_action/tier/adapter.cpp
index d0136aa983..8d42d230ee 100644
--- a/ydb/core/tx/columnshard/blobs_action/tier/adapter.cpp
+++ b/ydb/core/tx/columnshard/blobs_action/tier/adapter.cpp
@@ -16,11 +16,11 @@ std::unique_ptr<NActors::IEventBase> TRepliesAdapter::RebuildReplyEvent(std::uni
}
if (ev->IsSuccess()) {
AFL_VERIFY(!!ev->Body)("key", ev->Key)("interval_from", ev->GetReadInterval().first)("interval_to", ev->GetReadInterval().second);
- return std::make_unique<NBlobCache::TEvBlobCache::TEvReadBlobRangeResult>(bRange, NKikimrProto::EReplyStatus::OK, ev->Body, false, StorageId);
+ return std::make_unique<NBlobCache::TEvBlobCache::TEvReadBlobRangeResult>(bRange, NKikimrProto::EReplyStatus::OK, ev->Body, TString{}, false, StorageId);
} else {
AFL_DEBUG(NKikimrServices::TX_TIERING)("event", "s3_request_failed")("request_type", "get_object")(
"exception", ev->GetError().GetExceptionName())("message", ev->GetError().GetMessage())("storage_id", StorageId)("blob", logoBlobId);
- return std::make_unique<NBlobCache::TEvBlobCache::TEvReadBlobRangeResult>(bRange, NKikimrProto::EReplyStatus::ERROR, TStringBuilder() << ev->Result, false, StorageId);
+ return std::make_unique<NBlobCache::TEvBlobCache::TEvReadBlobRangeResult>(bRange, NKikimrProto::EReplyStatus::ERROR, TStringBuilder() << ev->Result, TStringBuilder{} << ev->GetError().GetExceptionName() << ", " << ev->GetError().GetMessage(), false, StorageId);
}
}
diff --git a/ydb/core/tx/columnshard/blobs_reader/actor.cpp b/ydb/core/tx/columnshard/blobs_reader/actor.cpp
index 3d27b9d8a0..2121d30893 100644
--- a/ydb/core/tx/columnshard/blobs_reader/actor.cpp
+++ b/ydb/core/tx/columnshard/blobs_reader/actor.cpp
@@ -15,7 +15,7 @@ void TActor::Handle(NBlobCache::TEvBlobCache::TEvReadBlobRangeResult::TPtr& ev)
bool aborted = false;
if (event.Status != NKikimrProto::EReplyStatus::OK) {
WaitingBlobsCount.Sub(Task->GetWaitingRangesCount());
- if (!Task->AddError(event.DataSourceId, event.BlobRange, IBlobsReadingAction::TErrorStatus::Fail(event.Status, "cannot get blob: " + event.Data.substr(0, 1024)))) {
+ if (!Task->AddError(event.DataSourceId, event.BlobRange, IBlobsReadingAction::TErrorStatus::Fail(event.Status, "cannot get blob: " + event.Data.substr(0, 1024) + ", detailed error: " + event.DetailedError))) {
aborted = true;
}
} else {
diff --git a/ydb/core/tx/columnshard/blobs_reader/read_coordinator.cpp b/ydb/core/tx/columnshard/blobs_reader/read_coordinator.cpp
index df9a740d23..207b41f00e 100644
--- a/ydb/core/tx/columnshard/blobs_reader/read_coordinator.cpp
+++ b/ydb/core/tx/columnshard/blobs_reader/read_coordinator.cpp
@@ -18,7 +18,7 @@ void TReadCoordinatorActor::Handle(NBlobCache::TEvBlobCache::TEvReadBlobRangeRes
auto tasks = BlobTasks.Extract(event.DataSourceId, event.BlobRange);
for (auto&& i : tasks) {
if (event.Status != NKikimrProto::EReplyStatus::OK) {
- i->AddError(event.DataSourceId, event.BlobRange, IBlobsReadingAction::TErrorStatus::Fail(event.Status, "cannot get blob"));
+ i->AddError(event.DataSourceId, event.BlobRange, IBlobsReadingAction::TErrorStatus::Fail(event.Status, "cannot get blob, detailed error: " + event.DetailedError));
} else {
i->AddData(event.DataSourceId, event.BlobRange, event.Data);
}