Skip to content

Commit

Permalink
[NBS, Filestore] add filename and line to the "tablet is dead" message (
Browse files Browse the repository at this point in the history
#2755)

* [NBS, Filestore] add filename and line to the "tablet is dead" message
  • Loading branch information
debnatkh authored Dec 25, 2024
1 parent 734b8e3 commit e708405
Show file tree
Hide file tree
Showing 24 changed files with 35 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void TDiskRegistryActor::BeforeDie(const NActors::TActorContext& ctx)
ReplyToPendingDeallocations(
ctx,
requestInfos,
MakeError(E_REJECTED, "Tablet is dead"));
MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
}
PendingDiskDeallocationRequests.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ void TAcquireDiskActor::HandlePoisonPill(
{
Y_UNUSED(ev);

ReplyAndDie(ctx, MakeError(E_REJECTED, "Tablet is dead"));
ReplyAndDie(ctx, MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
}

void TAcquireDiskActor::OnAcquireResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void TCleanupActor::HandlePoisonPill(
const TActorContext& ctx)
{
Y_UNUSED(ev);
ReplyAndDie(ctx, MakeError(E_REJECTED, "Tablet is dead"));
ReplyAndDie(ctx, MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ void TCmsRequestActor::HandlePoisonPill(
{
Y_UNUSED(ev);

*Response->Record.MutableError() = MakeError(E_REJECTED, "Tablet is dead");
*Response->Record.MutableError() =
MakeTabletIsDeadError(E_REJECTED, __LOCATION__);

ReplyAndDie(ctx);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void TDestroyActor::HandlePoisonPill(
const TActorContext& ctx)
{
Y_UNUSED(ev);
ReplyAndDie(ctx, MakeError(E_REJECTED, "Tablet is dead"));
ReplyAndDie(ctx, MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
}

void TDestroyActor::HandleDestroyVolumeResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void TMarkReplacementDevicesActor::HandlePoisonPill(
{
Y_UNUSED(ev);

Error = MakeError(E_REJECTED, "Tablet is dead");
Error = MakeTabletIsDeadError(E_REJECTED, __LOCATION__);
ReplyAndDie(ctx);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void TReplaceActor::HandlePoisonPill(
const TActorContext& ctx)
{
Y_UNUSED(ev);
ReplyAndDie(ctx, MakeError(E_REJECTED, "Tablet is dead"));
ReplyAndDie(ctx, MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
}

void TReplaceActor::HandleReplaceDeviceResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void THttpVolumeReallocActor::HandlePoisonPill(
const TActorContext& ctx)
{
Y_UNUSED(ev);
ReplyAndDie(ctx, MakeError(E_REJECTED, "Tablet is dead"));
ReplyAndDie(ctx, MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void TReleaseDiskActor::HandlePoisonPill(
{
Y_UNUSED(ev);

ReplyAndDie(ctx, MakeError(E_REJECTED, "Tablet is dead"));
ReplyAndDie(ctx, MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
}

void TReleaseDiskActor::HandleTimeout(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void TReplaceActor::HandlePoisonPill(
const TActorContext& ctx)
{
Y_UNUSED(ev);
ReplyAndDie(ctx, MakeError(E_REJECTED, "Tablet is dead"));
ReplyAndDie(ctx, MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void TResumeDeviceActor::HandlePoisonPill(
const TActorContext& ctx)
{
Y_UNUSED(ev);
ReplyAndDie(ctx, MakeError(E_REJECTED, "Tablet is dead"));
ReplyAndDie(ctx, MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void TSecureEraseActor::HandlePoisonPill(
const TActorContext& ctx)
{
Y_UNUSED(ev);
ReplyAndDie(ctx, MakeError(E_REJECTED, "Tablet is dead"));
ReplyAndDie(ctx, MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
}

STFUNC(TSecureEraseActor::StateErase)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void TUpdateActor::HandlePoisonPill(
const TActorContext& ctx)
{
Y_UNUSED(ev);
ReplyAndDie(ctx, MakeError(E_REJECTED, "Tablet is dead"));
ReplyAndDie(ctx, MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
}

void TUpdateActor::ReplyAndDie(const TActorContext& ctx, NProto::TError error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class TMountVolumeActor final

auto response =
std::make_unique<TEvService::TEvMountVolumeResponse>(
MakeError(E_REJECTED, "Tablet is dead"));
MakeTabletIsDeadError(E_REJECTED, __LOCATION__));

NCloud::Reply(ctx, *RequestInfo, std::move(response));
Die(ctx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class TReadBlocksRemoteRequestActor final
const TActorContext& ctx)
{
auto response = std::make_unique<TEvService::TEvReadBlocksLocalResponse>(
MakeError(E_REJECTED, "Tablet is dead"));
MakeTabletIsDeadError(E_REJECTED, __LOCATION__));

NCloud::Reply(ctx, *Request, std::move(response));
Die(ctx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class TDelayChangeBindingActor final

auto response =
std::make_unique<TEvService::TEvChangeVolumeBindingResponse>(
MakeError(E_REJECTED, "Tablet is dead"),
MakeTabletIsDeadError(E_REJECTED, __LOCATION__),
DiskId);

NCloud::Reply(ctx, *RequestInfo, std::move(response));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class TWriteBlocksRemoteRequestActor final
const TEvService::TEvWriteBlocksRequest::TPtr&,
const TActorContext& ctx)
{
ReplyAndDie(ctx, MakeError(E_REJECTED, "Tablet is dead"));
ReplyAndDie(ctx, MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
}

void HandleWriteBlocksResponse(
Expand Down
2 changes: 1 addition & 1 deletion cloud/blockstore/libs/storage/service/service_ut_mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2626,7 +2626,7 @@ Y_UNIT_TEST_SUITE(TServiceMountVolumeTest)
switch (event->GetTypeRewrite()) {
case TEvVolume::EvRemoveClientRequest: {
auto msg = std::make_unique<TEvVolume::TEvRemoveClientResponse>(
MakeError(E_REJECTED, "Tablet is dead"));
MakeTabletIsDeadError(E_REJECTED, __LOCATION__));
runtime.Send(
new IEventHandle(
event->Sender,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void TVolumeClientActor::HandleRequest(
// otherwise it is safe to use Get() to retrieve actual message.
if (!ev->HasBuffer() && !ev->HasEvent()) {
auto response = std::make_unique<typename TMethod::TResponse>(
MakeError(E_REJECTED, "Tablet is dead"));
MakeTabletIsDeadError(E_REJECTED, __LOCATION__));

NCloud::Reply(ctx, *ev, std::move(response));
return;
Expand Down
4 changes: 2 additions & 2 deletions cloud/blockstore/libs/storage/undelivered/undelivered.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ void TUndeliveredHandlerActor::CancelRequest(
const TActorContext& ctx,
const typename TMethod::TRequest::TPtr& ev)
{
auto response = std::make_unique<typename TMethod::TResponse>(
MakeError(E_REJECTED, "Tablet is dead"));
auto response = std::make_unique<typename TMethod::TResponse>(
MakeTabletIsDeadError(E_REJECTED, __LOCATION__));

NCloud::Reply(ctx, *ev, std::move(response));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ void TVolumeProxyActor::HandleRequest(
// otherwise it is safe to use Get() to retrieve actual message.
if (!ev->HasBuffer() && !ev->HasEvent()) {
auto response = std::make_unique<typename TMethod::TResponse>(
MakeError(E_REJECTED, "Tablet is dead"));
MakeTabletIsDeadError(E_REJECTED, __LOCATION__));

NCloud::Reply(ctx, *ev, std::move(response));
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void TIndexTabletProxyActor::HandleRequest(
// otherwise it is safe to use Get() to retrieve actual message.
if (!ev->HasBuffer() && !ev->HasEvent()) {
auto response = std::make_unique<typename TMethod::TResponse>(
MakeError(E_REJECTED, "tablet is dead"));
MakeTabletIsDeadError(E_REJECTED, __LOCATION__));

NCloud::Reply(ctx, *ev, std::move(response));
return;
Expand Down
7 changes: 7 additions & 0 deletions cloud/storage/core/libs/common/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@ NProto::TError MakeError(ui32 code, TString message, ui32 flags)
return error;
}

NProto::TError MakeTabletIsDeadError(ui32 code, const TSourceLocation& location)
{
TStringStream out;
out << "Tablet is dead: " << location.File << ":" << location.Line;
return MakeError(code, out.Str());
}

} // namespace NCloud

////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 4 additions & 0 deletions cloud/storage/core/libs/common/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ inline TResultOrError<void> ResultOrError(NThreading::TFuture<void>& future)
});
}

NProto::TError MakeTabletIsDeadError(
ui32 code,
const TSourceLocation& location);

} // namespace NCloud

////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit e708405

Please sign in to comment.