Skip to content

Commit e647621

Browse files
committed
add logs to dsproxy #10905
1 parent 15bc5d2 commit e647621

File tree

5 files changed

+33
-8
lines changed

5 files changed

+33
-8
lines changed

ydb/core/blobstorage/dsproxy/dsproxy_get.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,10 @@ class TBlobStorageGroupGetRequest : public TBlobStorageGroupRequestActor<TBlobSt
377377
LWPROBE(DSProxyRequestDuration, TEvBlobStorage::EvGet, requestSize, duration.SecondsFloat() * 1000.0, tabletId,
378378
evResult->GroupId, channel, NKikimrBlobStorage::EGetHandleClass_Name(handleClass),
379379
success);
380-
A_LOG_LOG_S(true, success ? NLog::PRI_INFO : NLog::PRI_NOTICE, "BPG68", "Result# " << evResult->Print(false));
380+
A_LOG_LOG_S(true, success ? NLog::PRI_INFO : NLog::PRI_NOTICE, "BPG68", "Result# " << evResult->Print(false) << " GroupId# " << Info->GroupID);
381381

382-
if (TActivationContext::Monotonic() - RequestStartTime >= LongRequestThreshold) {
383-
if (AllowToReport(GetImpl.GetHandleClass())) {
382+
if (AllowToReport(handleClass)) {
383+
if (TActivationContext::Monotonic() - RequestStartTime >= LongRequestThreshold) {
384384
STLOG(PRI_WARN, BS_PROXY_GET, BPG71, "Long TEvGet request detected", \
385385
(LongRequestThreshold, LongRequestThreshold), \
386386
(GroupId, Info->GroupID), \
@@ -390,6 +390,12 @@ class TBlobStorageGroupGetRequest : public TBlobStorageGroupRequestActor<TBlobSt
390390
(RestartCounter, RestartCounter), \
391391
(History, GetImpl.PrintHistory()));
392392
}
393+
394+
STLOG(GetImpl.WasNotOkResponses() ? NLog::PRI_NOTICE : NLog::PRI_DEBUG, BS_PROXY_GET, BPG72, \
395+
"Query history", \
396+
(GroupId, Info->GroupID), \
397+
(HandleClass, NKikimrBlobStorage::EGetHandleClass_Name(handleClass)), \
398+
(History, GetImpl.PrintHistory()));
393399
}
394400
return SendResponseAndDie(std::unique_ptr<TEvBlobStorage::TEvGetResult>(evResult.Release()));
395401
}

ydb/core/blobstorage/dsproxy/dsproxy_get_impl.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ class TGetImpl {
5252

5353
THistory History;
5454

55+
bool AtLeastOneResponseWasNotOk = false;
56+
5557
friend class TBlobStorageGroupGetRequest;
5658
friend class THistory;
5759

@@ -234,6 +236,7 @@ class TGetImpl {
234236
R_LOG_DEBUG_SX(logCtx, "BPG60", "Got# " << NKikimrProto::EReplyStatus_Name(replyStatus).data()
235237
<< " orderNumber# " << orderNumber << " vDiskId# " << vdisk.ToString());
236238
Blackboard.AddErrorResponse(blobId, orderNumber);
239+
AtLeastOneResponseWasNotOk = true;
237240
} else if (replyStatus == NKikimrProto::NOT_YET) {
238241
R_LOG_DEBUG_SX(logCtx, "BPG67", "Got# NOT_YET orderNumber# " << orderNumber
239242
<< " vDiskId# " << vdisk.ToString());
@@ -292,6 +295,10 @@ class TGetImpl {
292295
return History.Print((QuerySize == 0) ? nullptr : &Queries[0].Id);
293296
}
294297

298+
bool WasNotOkResponses() {
299+
return AtLeastOneResponseWasNotOk;
300+
}
301+
295302
protected:
296303
EStrategyOutcome RunBoldStrategy(TLogContext &logCtx);
297304
EStrategyOutcome RunMirror3dcStrategy(TLogContext &logCtx);

ydb/core/blobstorage/dsproxy/dsproxy_put.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,17 +425,25 @@ class TBlobStorageGroupPutRequest : public TBlobStorageGroupRequestActor<TBlobSt
425425
SendReply(std::move(result), blobIdx);
426426
}
427427

428-
if (TActivationContext::Monotonic() - RequestStartTime >= LongRequestThreshold) {
429-
bool allowToReport = AllowToReport(HandleClass);
430-
if (allowToReport) {
431-
STLOG(PRI_WARN, BS_PROXY_PUT, BPP71, "Long TEvPut request detected", \
428+
if (AllowToReport(HandleClass)) {
429+
if (TActivationContext::Monotonic() - RequestStartTime >= LongRequestThreshold) {
430+
STLOG(PRI_WARN, BS_PROXY_PUT, BPP71, "Long TEvPut request detected", \
432431
(LongRequestThreshold, LongRequestThreshold), \
433432
(GroupId, Info->GroupID), \
434433
(HandleClass, NKikimrBlobStorage::EPutHandleClass_Name(HandleClass)), \
435434
(Tactic, TEvBlobStorage::TEvPut::TacticName(Tactic)), \
436435
(RestartCounter, RestartCounter), \
437436
(History, PutImpl.PrintHistory()));
438437
}
438+
439+
if (ResponsesSent == PutImpl.Blobs.size()) {
440+
STLOG(PutImpl.WasNotOkResponses() ? PRI_NOTICE : PRI_DEBUG, BS_PROXY_PUT, BPP72,
441+
"Query history", \
442+
(GroupId, Info->GroupID), \
443+
(HandleClass, NKikimrBlobStorage::EPutHandleClass_Name(HandleClass)), \
444+
(Tactic, TEvBlobStorage::TEvPut::TacticName(Tactic)), \
445+
(History, PutImpl.PrintHistory()));
446+
}
439447
}
440448

441449
if (ResponsesSent == PutImpl.Blobs.size()) {

ydb/core/blobstorage/dsproxy/dsproxy_put_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void TPutImpl::PrepareOneReply(NKikimrProto::EReplyStatus status, size_t blobIdx
6969
Info->GroupID, ApproximateFreeSpaceShare);
7070
ev->ErrorReason = std::move(errorReason);
7171
const NLog::EPriority priority = GetPriorityForReply(Info->PutErrorMuteChecker, status);
72-
A_LOG_LOG_SX(logCtx, true, priority, "BPP12", "Result# " << ev->Print(false));
72+
A_LOG_LOG_SX(logCtx, true, priority, "BPP12", "Result# " << ev->Print(false) << " GroupId# " << Info->GroupID);
7373
outPutResults.emplace_back(blobIdx, std::move(ev));
7474
}
7575
}

ydb/core/blobstorage/dsproxy/dsproxy_put_impl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ class TPutImpl {
294294
return it->second;
295295
}
296296

297+
bool WasNotOkResponses() {
298+
return AtLeastOneResponseWasNotOk;
299+
}
300+
297301
protected:
298302
void RunStrategies(TLogContext &logCtx, TPutResultVec &outPutResults, const TBlobStorageGroupInfo::TGroupVDisks& expired,
299303
bool accelerate);

0 commit comments

Comments
 (0)