Skip to content

Commit

Permalink
add logs to dsproxy #10905
Browse files Browse the repository at this point in the history
  • Loading branch information
VPolka committed Nov 7, 2024
1 parent 15bc5d2 commit e647621
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
12 changes: 9 additions & 3 deletions ydb/core/blobstorage/dsproxy/dsproxy_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ class TBlobStorageGroupGetRequest : public TBlobStorageGroupRequestActor<TBlobSt
LWPROBE(DSProxyRequestDuration, TEvBlobStorage::EvGet, requestSize, duration.SecondsFloat() * 1000.0, tabletId,
evResult->GroupId, 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), \
Expand All @@ -390,6 +390,12 @@ class TBlobStorageGroupGetRequest : public TBlobStorageGroupRequestActor<TBlobSt
(RestartCounter, RestartCounter), \
(History, GetImpl.PrintHistory()));
}

STLOG(GetImpl.WasNotOkResponses() ? NLog::PRI_NOTICE : NLog::PRI_DEBUG, BS_PROXY_GET, BPG72, \
"Query history", \
(GroupId, Info->GroupID), \
(HandleClass, NKikimrBlobStorage::EGetHandleClass_Name(handleClass)), \
(History, GetImpl.PrintHistory()));
}
return SendResponseAndDie(std::unique_ptr<TEvBlobStorage::TEvGetResult>(evResult.Release()));
}
Expand Down
7 changes: 7 additions & 0 deletions ydb/core/blobstorage/dsproxy/dsproxy_get_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class TGetImpl {

THistory History;

bool AtLeastOneResponseWasNotOk = false;

friend class TBlobStorageGroupGetRequest;
friend class THistory;

Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Expand Down
16 changes: 12 additions & 4 deletions ydb/core/blobstorage/dsproxy/dsproxy_put.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,17 +425,25 @@ class TBlobStorageGroupPutRequest : public TBlobStorageGroupRequestActor<TBlobSt
SendReply(std::move(result), blobIdx);
}

if (TActivationContext::Monotonic() - RequestStartTime >= 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)), \
(Tactic, TEvBlobStorage::TEvPut::TacticName(Tactic)), \
(RestartCounter, RestartCounter), \
(History, PutImpl.PrintHistory()));
}

if (ResponsesSent == PutImpl.Blobs.size()) {
STLOG(PutImpl.WasNotOkResponses() ? PRI_NOTICE : PRI_DEBUG, BS_PROXY_PUT, BPP72,
"Query history", \
(GroupId, Info->GroupID), \
(HandleClass, NKikimrBlobStorage::EPutHandleClass_Name(HandleClass)), \
(Tactic, TEvBlobStorage::TEvPut::TacticName(Tactic)), \
(History, PutImpl.PrintHistory()));
}
}

if (ResponsesSent == PutImpl.Blobs.size()) {
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/blobstorage/dsproxy/dsproxy_put_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down
4 changes: 4 additions & 0 deletions ydb/core/blobstorage/dsproxy/dsproxy_put_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e647621

Please sign in to comment.