summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorserg-belyakov <[email protected]>2022-07-27 19:41:54 +0300
committerserg-belyakov <[email protected]>2022-07-27 19:41:54 +0300
commit08dd5dd0d88c58d1572d4b0f17b1e066c7b09ff0 (patch)
tree085a43e5282b10356a17c17c75ea801232baee96
parentb06c90c50f46fa60dab756015ca2d3443184393f (diff)
Fix error logs,
Add markers for logs in tablet_req_rebuildhistory.cpp
-rw-r--r--ydb/core/blobstorage/dsproxy/dsproxy_get.cpp5
-rw-r--r--ydb/core/blobstorage/dsproxy/dsproxy_get_impl.cpp3
-rw-r--r--ydb/core/blobstorage/dsproxy/dsproxy_get_impl.h7
-rw-r--r--ydb/core/blobstorage/dsproxy/dsproxy_range.cpp5
-rw-r--r--ydb/core/tablet/tablet_req_rebuildhistory.cpp38
5 files changed, 31 insertions, 27 deletions
diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_get.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_get.cpp
index e4043c36754..0b89004dd24 100644
--- a/ydb/core/blobstorage/dsproxy/dsproxy_get.cpp
+++ b/ydb/core/blobstorage/dsproxy/dsproxy_get.cpp
@@ -331,7 +331,7 @@ class TBlobStorageGroupGetRequest : public TBlobStorageGroupRequestActor<TBlobSt
TStringStream errorReason;
errorReason << "Got VMultiPutResult itemStatus# " << itemStatus << " from VDiskId# " << vDiskId;
ErrorReason = errorReason.Str();
- GetImpl.PrepareReply(itemStatus, LogCtx, outGetResult);
+ GetImpl.PrepareReply(itemStatus, ErrorReason, LogCtx, outGetResult);
return true;
} else {
R_LOG_DEBUG_S("BPG27", "Handle TEvVMultiPutResultItem"
@@ -543,8 +543,7 @@ public:
friend class TBlobStorageGroupRequestActor<TBlobStorageGroupGetRequest>;
void ReplyAndDie(NKikimrProto::EReplyStatus status) {
TAutoPtr<TEvBlobStorage::TEvGetResult> getResult;
- GetImpl.PrepareReply(status, LogCtx, getResult);
- getResult->ErrorReason = ErrorReason;
+ GetImpl.PrepareReply(status, ErrorReason, LogCtx, getResult);
SendReplyAndDie(getResult);
return;
}
diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.cpp
index f1d01776b6c..9729b909811 100644
--- a/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.cpp
+++ b/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.cpp
@@ -16,11 +16,12 @@
namespace NKikimr {
-void TGetImpl::PrepareReply(NKikimrProto::EReplyStatus status, TLogContext &logCtx,
+void TGetImpl::PrepareReply(NKikimrProto::EReplyStatus status, TString errorReason, TLogContext &logCtx,
TAutoPtr<TEvBlobStorage::TEvGetResult> &outGetResult) {
outGetResult.Reset(new TEvBlobStorage::TEvGetResult(status, QuerySize, Info->GroupID));
ReplyBytes = 0;
outGetResult->BlockedGeneration = BlockedGeneration;
+ outGetResult->ErrorReason = errorReason;
if (status != NKikimrProto::OK) {
for (ui32 i = 0, e = QuerySize; i != e; ++i) {
diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.h b/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.h
index 815ec33c285..146c0270c37 100644
--- a/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.h
+++ b/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.h
@@ -248,7 +248,7 @@ public:
TDeque<std::unique_ptr<TEvBlobStorage::TEvVMultiPut>> &outVMultiPuts,
TAutoPtr<TEvBlobStorage::TEvGetResult> &outGetResult);
- void PrepareReply(NKikimrProto::EReplyStatus status, TLogContext &logCtx,
+ void PrepareReply(NKikimrProto::EReplyStatus status, TString errorReason, TLogContext &logCtx,
TAutoPtr<TEvBlobStorage::TEvGetResult> &outGetResult);
template <typename TVPutEvent>
@@ -301,12 +301,11 @@ protected:
}
case EStrategyOutcome::ERROR:
- PrepareReply(NKikimrProto::ERROR, logCtx, outGetResult);
- outGetResult->ErrorReason = outcome.ErrorReason;
+ PrepareReply(NKikimrProto::ERROR, outcome.ErrorReason, logCtx, outGetResult);
return false;
case EStrategyOutcome::DONE:
- PrepareReply(NKikimrProto::OK, logCtx, outGetResult);
+ PrepareReply(NKikimrProto::OK, "", logCtx, outGetResult);
return false;
}
}
diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_range.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_range.cpp
index 319e7e11ca3..299dfa2af7d 100644
--- a/ydb/core/blobstorage/dsproxy/dsproxy_range.cpp
+++ b/ydb/core/blobstorage/dsproxy/dsproxy_range.cpp
@@ -95,6 +95,7 @@ class TBlobStorageGroupRangeRequest : public TBlobStorageGroupRequestActor<TBlob
case NKikimrProto::OUT_OF_SPACE:
FailedDisks |= TBlobStorageGroupInfo::TGroupVDisks(&Info->GetTopology(), vdisk);
if (!Info->GetQuorumChecker().CheckFailModelForGroup(FailedDisks)) {
+ ErrorReason = "Failed disks check fails on non-OK event status";
return ReplyAndDie(NKikimrProto::ERROR);
}
break;
@@ -106,6 +107,7 @@ class TBlobStorageGroupRangeRequest : public TBlobStorageGroupRequestActor<TBlob
" TEvVGetResult# " << ev->Get()->ToString());
FailedDisks |= TBlobStorageGroupInfo::TGroupVDisks(&Info->GetTopology(), vdisk);
if (!Info->GetQuorumChecker().CheckFailModelForGroup(FailedDisks)) {
+ ErrorReason = "Failed disks check fails on OK event status";
return ReplyAndDie(NKikimrProto::ERROR);
}
}
@@ -193,6 +195,7 @@ class TBlobStorageGroupRangeRequest : public TBlobStorageGroupRequestActor<TBlob
switch (tracker.GetBlobState(Info.Get(), &lostByIngress)) {
case TBlobStorageGroupInfo::EBS_DISINTEGRATED:
R_LOG_ERROR_S("DSR02", "disintegrated");
+ ErrorReason = "BS disintegrated";
return ReplyAndDie(NKikimrProto::ERROR);
case TBlobStorageGroupInfo::EBS_UNRECOVERABLE_FRAGMENTARY:
@@ -269,6 +272,7 @@ class TBlobStorageGroupRangeRequest : public TBlobStorageGroupRequestActor<TBlob
NKikimrProto::EReplyStatus status = getResult.Status;
if (status != NKikimrProto::OK) {
R_LOG_ERROR_S("DSR03", "Handle TEvGetResult status# " << NKikimrProto::EReplyStatus_Name(status).data());
+ ErrorReason = getResult.ErrorReason;
ReplyAndDie(status);
return;
}
@@ -289,6 +293,7 @@ class TBlobStorageGroupRangeRequest : public TBlobStorageGroupRequestActor<TBlob
<< " Response[" << i << "]# " << NKikimrProto::EReplyStatus_Name(response.Status)
<< " BlobsToGet# " << DumpBlobsToGet()
<< " TEvGetResult# " << ev->Get()->ToString());
+ ErrorReason = getResult.ErrorReason;
ReplyAndDie(NKikimrProto::ERROR);
return;
}
diff --git a/ydb/core/tablet/tablet_req_rebuildhistory.cpp b/ydb/core/tablet/tablet_req_rebuildhistory.cpp
index c12f6c93ad4..6c2dd2ce46e 100644
--- a/ydb/core/tablet/tablet_req_rebuildhistory.cpp
+++ b/ydb/core/tablet/tablet_req_rebuildhistory.cpp
@@ -16,11 +16,11 @@
#error log macro definition clash
#endif
-#define BLOG_D(stream) LOG_DEBUG_S(*TlsActivationContext, NKikimrServices::TABLET_MAIN, "TabletId# " << Info->TabletID << (FollowerCookie ? "f " : " ") << stream)
-#define BLOG_W(stream) LOG_WARN_S(*TlsActivationContext, NKikimrServices::TABLET_MAIN, "TabletId# " << Info->TabletID << (FollowerCookie ? "f " : " ") << stream)
-#define BLOG_ERROR(stream) LOG_ERROR_S(*TlsActivationContext, NKikimrServices::TABLET_MAIN, "TabletId# " << Info->TabletID << (FollowerCookie ? "f " : " ") << stream)
-#define BLOG_TRACE(stream) LOG_TRACE_S(*TlsActivationContext, NKikimrServices::TABLET_MAIN, "TabletId# " << Info->TabletID << (FollowerCookie ? "f " : " ") << stream)
-#define BLOG_CRIT(stream) LOG_CRIT_S(*TlsActivationContext, NKikimrServices::TABLET_MAIN, "TabletId# " << Info->TabletID << (FollowerCookie ? "f " : " ") << stream)
+#define BLOG_D(stream, marker) LOG_DEBUG_S(*TlsActivationContext, NKikimrServices::TABLET_MAIN, "TabletId# " << Info->TabletID << (FollowerCookie ? "f " : " ") << stream << " Marker# " << marker)
+#define BLOG_W(stream, marker) LOG_WARN_S(*TlsActivationContext, NKikimrServices::TABLET_MAIN, "TabletId# " << Info->TabletID << (FollowerCookie ? "f " : " ") << stream << " Marker# " << marker)
+#define BLOG_ERROR(stream, marker) LOG_ERROR_S(*TlsActivationContext, NKikimrServices::TABLET_MAIN, "TabletId# " << Info->TabletID << (FollowerCookie ? "f " : " ") << stream << " Marker# " << marker)
+#define BLOG_TRACE(stream, marker) LOG_TRACE_S(*TlsActivationContext, NKikimrServices::TABLET_MAIN, "TabletId# " << Info->TabletID << (FollowerCookie ? "f " : " ") << stream << " Marker# " << marker)
+#define BLOG_CRIT(stream, marker) LOG_CRIT_S(*TlsActivationContext, NKikimrServices::TABLET_MAIN, "TabletId# " << Info->TabletID << (FollowerCookie ? "f " : " ") << stream << " Marker# " << marker)
namespace NKikimr {
@@ -228,7 +228,7 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
void ProcessZeroEntry(ui32 gen, NKikimrTabletBase::TTabletLogEntry &logEntry) {
- BLOG_D("TTabletReqRebuildHistoryGraph::ProcessZeroEntry - generation " << gen);
+ BLOG_D("TTabletReqRebuildHistoryGraph::ProcessZeroEntry - generation " << gen, "TRRH01");
if (IntrospectionTrace) {
IntrospectionTrace->Attach(MakeHolder<NTracing::TOnProcessZeroEntry>(gen, Snapshot, Confirmed));
}
@@ -262,7 +262,7 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
const ui32 prevGeneration = confirmed.first;
if (prevGeneration < Snapshot.first) {
- BLOG_CRIT("snapshot overrun in gen " << gen << " zero entry, declared prev gen " << prevGeneration << " while known snapshot is " << Snapshot.first << ":" << Snapshot.second);
+ BLOG_CRIT("snapshot overrun in gen " << gen << " zero entry, declared prev gen " << prevGeneration << " while known snapshot is " << Snapshot.first << ":" << Snapshot.second, "TRRH02");
if (IntrospectionTrace)
IntrospectionTrace->Attach(MakeHolder<NTracing::TErrorRebuildGraph>(gen, 0));
@@ -403,7 +403,7 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
void ProcessKeyEntry(const TLogoBlobID &id, const TString &logBody) {
NKikimrTabletBase::TTabletLogEntry logEntry;
if (!logEntry.ParseFromString(logBody)) {
- BLOG_ERROR("TTabletReqRebuildHistoryGraph::ProcessKeyEntry logBody ParseFromString error, id# " << id);
+ BLOG_ERROR("TTabletReqRebuildHistoryGraph::ProcessKeyEntry logBody ParseFromString error, id# " << id, "TRRH03");
if (IntrospectionTrace) {
IntrospectionTrace->Attach(MakeHolder<NTracing::TErrorParsingFromString>(id));
}
@@ -415,7 +415,7 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
BLOG_D("TTabletReqRebuildHistoryGraph::ProcessKeyEntry, LastBlobID: " << id.ToString()
<< " Snap: " << Snapshot.first << ":" << Snapshot.second
- << " for " << Info->TabletID);
+ << " for " << Info->TabletID, "TRRH04");
const bool isZeroStep = id.Step() == 0;
const bool isSynthEntry = id.Cookie() != 0;
@@ -467,7 +467,7 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
NKikimrTabletBase::TTabletLogEntry logEntry;
if (!logEntry.ParseFromString(it->Buffer)) {
- BLOG_ERROR("TTabletReqRebuildHistoryGraph::ApplyDiscoveryRange it->Buffer ParseFromString error, id# " << id);
+ BLOG_ERROR("TTabletReqRebuildHistoryGraph::ApplyDiscoveryRange it->Buffer ParseFromString error, id# " << id, "TRRH05");
return ReplyAndDie(NKikimrProto::ERROR, "Log entry parse failed");
}
@@ -494,7 +494,7 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
for (auto &xpair : RefsToCheckByGroup) {
if (!SendRefsCheck(xpair.second, xpair.first)) {
- BLOG_ERROR("TTabletReqRebuildHistoryGraph::MakeHistory SendRefsCheck A error");
+ BLOG_ERROR("TTabletReqRebuildHistoryGraph::MakeHistory SendRefsCheck A error", "TRRH06");
if (IntrospectionTrace) {
IntrospectionTrace->Attach(MakeHolder<NTracing::TErrorSendRefsCheck>());
}
@@ -590,11 +590,11 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
GroupReadOps[std::make_pair(response.Id.Channel(), msg->GroupId)] += 1;
break;
case NKikimrProto::NODATA:
- BLOG_W("TTabletReqRebuildHistoryGraph::CheckReferences - NODATA for blob " << response.Id);
+ BLOG_W("TTabletReqRebuildHistoryGraph::CheckReferences - NODATA for blob " << response.Id, "TRRH07");
break; // must left as unchecked
default:
BLOG_ERROR("TTabletReqRebuildHistoryGraph::CheckReferences - blob " << response.Id
- << " Status# " << NKikimrProto::EReplyStatus_Name(response.Status));
+ << " Status# " << NKikimrProto::EReplyStatus_Name(response.Status), "TRRH08");
if (IntrospectionTrace) {
IntrospectionTrace->Attach(MakeHolder<NTracing::TErrorUnknownStatus>(response.Status, msg->ErrorReason));
}
@@ -619,7 +619,7 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
bool hasSnapshotInGeneration = (generation == 0);
BLOG_D("TTabletReqRebuildHistoryGraph::BuildHistory - Process generation " << generation
- << " from " << (ui32)gx.Base << " with " << gx.Body.size() << " steps");
+ << " from " << (ui32)gx.Base << " with " << gx.Body.size() << " steps", "TRRH09");
for (ui32 i = 0, e = (ui32)gx.Body.size(); i != e; ++i) {
const ui32 step = gx.Base + i;
@@ -700,7 +700,7 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
hasSnapshotInGeneration = true;
}
} else {
- BLOG_D("TTabletReqRebuildHistoryGraph::BuildHistory - THE TAIL - miss " << id.first << ":" << id.second);
+ BLOG_D("TTabletReqRebuildHistoryGraph::BuildHistory - THE TAIL - miss " << id.first << ":" << id.second, "TRRH10");
}
}
break;
@@ -801,7 +801,7 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
case NKikimrProto::OK:
if (FollowerCookie == 0 && msg->Latest.Generation() > BlockedGen) {
BLOG_ERROR("TTabletReqRebuildHistoryGraph - Found entry beyond blocked generation"
- << " LastBlobID: " << msg->Latest.ToString() << ". Blocked: " << BlockedGen);
+ << " LastBlobID: " << msg->Latest.ToString() << ". Blocked: " << BlockedGen, "TRRH11");
if (IntrospectionTrace) {
IntrospectionTrace->Attach(MakeHolder<NTracing::TErrorEntryBeyondBlocked>(msg->Latest, BlockedGen));
}
@@ -818,7 +818,7 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
return ReplyAndDie(msg->Status, msg->ErrorReason); // valid condition, nothing known in blob-storage
default:
BLOG_ERROR("TTabletReqRebuildHistoryGraph::Handle TEvFindLatestLogEntryResult"
- << " Status# " << NKikimrProto::EReplyStatus_Name(msg->Status));
+ << " Status# " << NKikimrProto::EReplyStatus_Name(msg->Status), "TRRH12");
if (IntrospectionTrace) {
IntrospectionTrace->Attach(MakeHolder<NTracing::TErrorUnknownStatus>(msg->Status, msg->ErrorReason));
}
@@ -838,7 +838,7 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
default:
BLOG_ERROR("TTabletReqRebuildHistoryGraph::HandleDiscover TEvRangeResult"
<< " Status# " << NKikimrProto::EReplyStatus_Name(msg->Status)
- << " Result# " << msg->Print(false));
+ << " Result# " << msg->Print(false), "TRRH13");
if (IntrospectionTrace) {
IntrospectionTrace->Attach(MakeHolder<NTracing::TErrorUnknownStatus>(msg->Status, msg->ErrorReason));
}
@@ -862,7 +862,7 @@ class TTabletReqRebuildHistoryGraph : public TActorBootstrapped<TTabletReqRebuil
default:
BLOG_ERROR("TTabletReqRebuildHistoryGraph::Handle TEvGetResult"
<< " Status# " << NKikimrProto::EReplyStatus_Name(msg->Status)
- << " Result# " << msg->Print(false));
+ << " Result# " << msg->Print(false), "TRRH14");
if (IntrospectionTrace) {
IntrospectionTrace->Attach(MakeHolder<NTracing::TErrorUnknownStatus>(msg->Status, msg->ErrorReason));
}