Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[merge to stable] issue-1285: fix missing StartedTs initialization for requestInfo in Flush, CollectGarbage and Cleanup, report readblob operation once event for multiple blobs in service sensors #2115

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 15 additions & 19 deletions cloud/filestore/libs/storage/service/service_actor_readdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ class TReadDataActor final: public TActorBootstrapped<TReadDataActor>
// Stats for reporting
IRequestStatsPtr RequestStats;
IProfileLogPtr ProfileLog;
TMaybe<TInFlightRequest> InFlightRequest;
TVector<std::unique_ptr<TInFlightRequest>> InFlightBSRequests;
std::optional<TInFlightRequest> InFlightRequest;
const NCloud::NProto::EStorageMediaKind MediaKind;

public:
Expand Down Expand Up @@ -144,7 +143,7 @@ void TReadDataActor::DescribeData(const TActorContext& ctx)

// RequestType is set in order to properly record the request type
RequestInfo->CallContext->RequestType = EFileStoreRequest::DescribeData;
InFlightRequest.ConstructInPlace(
InFlightRequest.emplace(
TRequestInfo(
RequestInfo->Sender,
RequestInfo->Cookie,
Expand Down Expand Up @@ -295,17 +294,18 @@ void TReadDataActor::ReadBlobIfNeeded(const TActorContext& ctx)

RequestInfo->CallContext->RequestType = EFileStoreRequest::ReadBlob;
ui32 blobPieceId = 0;
InFlightBSRequests.reserve(RemainingBlobsToRead);

InFlightRequest.emplace(
TRequestInfo(
RequestInfo->Sender,
RequestInfo->Cookie,
RequestInfo->CallContext),
ProfileLog,
MediaKind,
RequestStats);
InFlightRequest->Start(ctx.Now());

for (const auto& blobPiece: DescribeResponse.GetBlobPieces()) {
InFlightBSRequests.emplace_back(std::make_unique<TInFlightRequest>(
TRequestInfo(
RequestInfo->Sender,
RequestInfo->Cookie,
RequestInfo->CallContext),
ProfileLog,
MediaKind,
RequestStats));
InFlightBSRequests.back()->Start(ctx.Now());
NKikimr::TLogoBlobID blobId =
LogoBlobIDFromLogoBlobID(blobPiece.GetBlobId());
LOG_DEBUG(
Expand Down Expand Up @@ -387,12 +387,6 @@ void TReadDataActor::HandleReadBlobResponse(
TABLET_VERIFY(ev->Cookie < DescribeResponse.BlobPiecesSize());
const auto& blobPiece = DescribeResponse.GetBlobPieces(ev->Cookie);

ui64 blobIdx = ev->Cookie;
TABLET_VERIFY(
blobIdx < InFlightBSRequests.size() && InFlightBSRequests[blobIdx] &&
!InFlightBSRequests[blobIdx]->IsCompleted());
InFlightBSRequests[blobIdx]->Complete(ctx.Now(), {});

for (size_t i = 0; i < msg->ResponseSz; ++i) {
TABLET_VERIFY(i < blobPiece.RangesSize());

Expand Down Expand Up @@ -467,6 +461,8 @@ void TReadDataActor::HandleReadBlobResponse(

--RemainingBlobsToRead;
if (RemainingBlobsToRead == 0) {
InFlightRequest->Complete(ctx.Now(), {});

RequestInfo->CallContext->RequestType = EFileStoreRequest::ReadData;
ReplyAndDie(ctx);
}
Expand Down
4 changes: 2 additions & 2 deletions cloud/filestore/libs/storage/service/service_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2031,9 +2031,9 @@ Y_UNIT_TEST_SUITE(TStorageServiceTest)
{
auto subgroup = counters->FindSubgroup("request", "ReadBlob");
UNIT_ASSERT(subgroup);
// 1MB = 4 blobs of 256KB. Read is performed thrice
// Read is performed thrice
UNIT_ASSERT_VALUES_EQUAL(
12,
3,
subgroup->GetCounter("Count")->GetAtomic());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ void TIndexTabletActor::HandleCleanup(
ev->Sender,
ev->Cookie,
msg->CallContext);
requestInfo->StartedTs = ctx.Now();

ExecuteTx<TCleanup>(
ctx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ void TIndexTabletActor::HandleCollectGarbage(
ev->Sender,
ev->Cookie,
msg->CallContext);
requestInfo->StartedTs = ctx.Now();

auto channels = GetChannels(EChannelDataKind::Mixed);

Expand Down
1 change: 1 addition & 0 deletions cloud/filestore/libs/storage/tablet/tablet_actor_flush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ void TIndexTabletActor::HandleFlush(
ev->Sender,
ev->Cookie,
msg->CallContext);
requestInfo->StartedTs = ctx.Now();

AcquireCollectBarrier(commitId);

Expand Down
Loading