From 2d74417b39f7bdd8d4831afb1f3c52c00632868a Mon Sep 17 00:00:00 2001 From: Polina Volosnikova Date: Tue, 5 Nov 2024 10:41:32 +0000 Subject: [PATCH] add logs to dsproxy #10905 --- ydb/core/blobstorage/dsproxy/dsproxy_get.cpp | 12 +++++++++--- ydb/core/blobstorage/dsproxy/dsproxy_get_impl.h | 7 +++++++ ydb/core/blobstorage/dsproxy/dsproxy_put.cpp | 16 ++++++++++++---- .../blobstorage/dsproxy/dsproxy_put_impl.cpp | 2 +- ydb/core/blobstorage/dsproxy/dsproxy_put_impl.h | 4 ++++ 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_get.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_get.cpp index 662474a25858..90bf35bca20e 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_get.cpp +++ b/ydb/core/blobstorage/dsproxy/dsproxy_get.cpp @@ -377,10 +377,10 @@ class TBlobStorageGroupGetRequest : public TBlobStorageGroupRequestActorGroupId, channel, NKikimrBlobStorage::EGetHandleClass_Name(handleClass), success); - A_LOG_LOG_S(true, success ? NLog::PRI_INFO : NLog::PRI_NOTICE, "BPG68", "Result# " << evResult->Print(false)); + A_LOG_LOG_S(true, success ? NLog::PRI_INFO : NLog::PRI_NOTICE, "BPG68", "Result# " << evResult->Print(false) << " GroupId# " << Info->GroupID); - if (TActivationContext::Monotonic() - RequestStartTime >= LongRequestThreshold) { - if (AllowToReport(GetImpl.GetHandleClass())) { + if (AllowToReport(handleClass)) { + if (TActivationContext::Monotonic() - RequestStartTime >= LongRequestThreshold) { STLOG(PRI_WARN, BS_PROXY_GET, BPG71, "Long TEvGet request detected", \ (LongRequestThreshold, LongRequestThreshold), \ (GroupId, Info->GroupID), \ @@ -390,6 +390,12 @@ class TBlobStorageGroupGetRequest : public TBlobStorageGroupRequestActorGroupID), \ + (HandleClass, NKikimrBlobStorage::EGetHandleClass_Name(handleClass)), \ + (History, GetImpl.PrintHistory())); } return SendResponseAndDie(std::unique_ptr(evResult.Release())); } diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.h b/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.h index c9381957ad09..98d3c985a913 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.h +++ b/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.h @@ -52,6 +52,8 @@ class TGetImpl { THistory History; + bool AtLeastOneResponseWasNotOk = false; + friend class TBlobStorageGroupGetRequest; friend class THistory; @@ -234,6 +236,7 @@ class TGetImpl { R_LOG_DEBUG_SX(logCtx, "BPG60", "Got# " << NKikimrProto::EReplyStatus_Name(replyStatus).data() << " orderNumber# " << orderNumber << " vDiskId# " << vdisk.ToString()); Blackboard.AddErrorResponse(blobId, orderNumber); + AtLeastOneResponseWasNotOk = true; } else if (replyStatus == NKikimrProto::NOT_YET) { R_LOG_DEBUG_SX(logCtx, "BPG67", "Got# NOT_YET orderNumber# " << orderNumber << " vDiskId# " << vdisk.ToString()); @@ -292,6 +295,10 @@ class TGetImpl { return History.Print((QuerySize == 0) ? nullptr : &Queries[0].Id); } + bool WasNotOkResponses() { + return AtLeastOneResponseWasNotOk; + } + protected: EStrategyOutcome RunBoldStrategy(TLogContext &logCtx); EStrategyOutcome RunMirror3dcStrategy(TLogContext &logCtx); diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_put.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_put.cpp index ad278137d0e6..089a629fd892 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_put.cpp +++ b/ydb/core/blobstorage/dsproxy/dsproxy_put.cpp @@ -425,10 +425,9 @@ class TBlobStorageGroupPutRequest : public TBlobStorageGroupRequestActor= LongRequestThreshold) { - bool allowToReport = AllowToReport(HandleClass); - if (allowToReport) { - STLOG(PRI_WARN, BS_PROXY_PUT, BPP71, "Long TEvPut request detected", \ + if (AllowToReport(HandleClass)) { + if (TActivationContext::Monotonic() - RequestStartTime >= LongRequestThreshold) { + STLOG(PRI_WARN, BS_PROXY_PUT, BPP71, "Long TEvPut request detected", \ (LongRequestThreshold, LongRequestThreshold), \ (GroupId, Info->GroupID), \ (HandleClass, NKikimrBlobStorage::EPutHandleClass_Name(HandleClass)), \ @@ -436,6 +435,15 @@ class TBlobStorageGroupPutRequest : public TBlobStorageGroupRequestActorGroupID), \ + (HandleClass, NKikimrBlobStorage::EPutHandleClass_Name(HandleClass)), \ + (Tactic, TEvBlobStorage::TEvPut::TacticName(Tactic)), \ + (History, PutImpl.PrintHistory())); + } } if (ResponsesSent == PutImpl.Blobs.size()) { diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.cpp index 710fbdf4cfb6..eb0726873c99 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.cpp +++ b/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.cpp @@ -69,7 +69,7 @@ void TPutImpl::PrepareOneReply(NKikimrProto::EReplyStatus status, size_t blobIdx Info->GroupID, ApproximateFreeSpaceShare); ev->ErrorReason = std::move(errorReason); const NLog::EPriority priority = GetPriorityForReply(Info->PutErrorMuteChecker, status); - A_LOG_LOG_SX(logCtx, true, priority, "BPP12", "Result# " << ev->Print(false)); + A_LOG_LOG_SX(logCtx, true, priority, "BPP12", "Result# " << ev->Print(false) << " GroupId# " << Info->GroupID); outPutResults.emplace_back(blobIdx, std::move(ev)); } } diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.h b/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.h index 1cd57615e2db..086b1c0e870e 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.h +++ b/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.h @@ -294,6 +294,10 @@ class TPutImpl { return it->second; } + bool WasNotOkResponses() { + return AtLeastOneResponseWasNotOk; + } + protected: void RunStrategies(TLogContext &logCtx, TPutResultVec &outPutResults, const TBlobStorageGroupInfo::TGroupVDisks& expired, bool accelerate);