Skip to content

Commit

Permalink
[Filestore]: include logtag in service_actor_writedata.cpp (#2883)
Browse files Browse the repository at this point in the history
  • Loading branch information
debnatkh authored Jan 20, 2025
1 parent 2a7ee1e commit 2cf042b
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions cloud/filestore/libs/storage/service/service_actor_writedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ class TWriteDataActor final: public TActorBootstrapped<TWriteDataActor>
LOG_DEBUG(
ctx,
TFileStoreComponents::SERVICE,
"WriteDataActor started, data size: %lu, offset: %lu"
", aligned size: %lu, aligned offset: %lu",
"%s WriteDataActor started, data size: %lu, offset: %lu, aligned "
"size: %lu, aligned offset: %lu",
LogTag.c_str(),
WriteRequest.GetBuffer().size(),
WriteRequest.GetOffset(),
BlobRange.Length,
Expand Down Expand Up @@ -174,7 +175,8 @@ class TWriteDataActor final: public TActorBootstrapped<TWriteDataActor>
LOG_DEBUG(
ctx,
TFileStoreComponents::SERVICE,
"GenerateBlobIds response received: %s",
"%s GenerateBlobIds response received: %s",
LogTag.c_str(),
GenerateBlobIdsResponse.DebugString().Quote().c_str());

WriteBlobs(ctx);
Expand Down Expand Up @@ -231,7 +233,9 @@ class TWriteDataActor final: public TActorBootstrapped<TWriteDataActor>
LOG_DEBUG(
ctx,
TFileStoreComponents::SERVICE,
"Sending TEvPut request to blob storage, blobId: %s, proxy: %s",
"%s Sending TEvPut request to blob storage, blobId: %s, proxy: "
"%s",
LogTag.c_str(),
blobId.ToString().c_str(),
proxy.ToString().c_str());
SendToBSProxy(ctx, proxy, request.release(), blobId.Cookie());
Expand All @@ -254,7 +258,8 @@ class TWriteDataActor final: public TActorBootstrapped<TWriteDataActor>
LOG_WARN(
ctx,
TFileStoreComponents::SERVICE,
"WriteData error: %s",
"%s WriteData error: %s",
LogTag.c_str(),
msg->ErrorReason.Quote().c_str());
// We still may receive some responses, but we do not want to
// process them
Expand All @@ -264,7 +269,8 @@ class TWriteDataActor final: public TActorBootstrapped<TWriteDataActor>
LOG_DEBUG(
ctx,
TFileStoreComponents::SERVICE,
"TEvPutResult response received: %s",
"%s TEvPutResult response received: %s",
LogTag.c_str(),
msg->ToString().c_str());

ui64 blobIdx = msg->Id.Cookie();
Expand Down Expand Up @@ -348,7 +354,8 @@ class TWriteDataActor final: public TActorBootstrapped<TWriteDataActor>
LOG_DEBUG(
ctx,
TFileStoreComponents::SERVICE,
"Sending AddData request to tablet: %s",
"%s Sending AddData request to tablet: %s",
LogTag.c_str(),
request->Record.DebugString().Quote().c_str());

ctx.Send(MakeIndexTabletProxyServiceId(), request.release());
Expand Down Expand Up @@ -386,8 +393,9 @@ class TWriteDataActor final: public TActorBootstrapped<TWriteDataActor>
LOG_WARN(
ctx,
TFileStoreComponents::SERVICE,
"Falling back to WriteData for %lu, %lu, %lu (%lu bytes). Message: "
"%s",
"%s Falling back to WriteData for %lu, %lu, %lu (%lu bytes). "
"Message: %s",
LogTag.c_str(),
WriteRequest.GetNodeId(),
WriteRequest.GetHandle(),
WriteRequest.GetOffset(),
Expand All @@ -413,7 +421,11 @@ class TWriteDataActor final: public TActorBootstrapped<TWriteDataActor>
return;
}

LOG_DEBUG(ctx, TFileStoreComponents::SERVICE, "WriteData succeeded");
LOG_DEBUG(
ctx,
TFileStoreComponents::SERVICE,
"%s WriteData succeeded",
LogTag.c_str());

auto response = std::make_unique<TEvService::TEvWriteDataResponse>();
response->Record = std::move(msg->Record);
Expand Down Expand Up @@ -510,10 +522,12 @@ void TStorageServiceActor::HandleWriteData(
&& (range.IsAligned()
|| StorageConfig->GetUnalignedThreeStageWriteEnabled());
if (threeStageWriteEnabled) {
auto logTag = filestore.GetFileSystemId();
LOG_DEBUG(
ctx,
TFileStoreComponents::SERVICE,
"Using three-stage write for request, size: %lu",
"%s Using three-stage write for request, size: %lu",
logTag.c_str(),
msg->Record.GetBuffer().size());

auto [cookie, inflight] = CreateInFlightRequest(
Expand All @@ -531,7 +545,7 @@ void TStorageServiceActor::HandleWriteData(
std::move(msg->Record),
range,
std::move(requestInfo),
filestore.GetFileSystemId(),
std::move(logTag),
session->RequestStats,
ProfileLog,
session->MediaKind);
Expand Down

0 comments on commit 2cf042b

Please sign in to comment.