diff --git a/contrib/ydb/core/base/blobstorage.h b/contrib/ydb/core/base/blobstorage.h index c1dc7cd2ec8..45df7515710 100644 --- a/contrib/ydb/core/base/blobstorage.h +++ b/contrib/ydb/core/base/blobstorage.h @@ -910,7 +910,7 @@ struct TEvBlobStorage { std::vector> ExtraBlockChecks; // (TabletId, Generation) pairs std::shared_ptr ExecutionRelay; - TEvPut(const TLogoBlobID &id, TRcBuf &&buffer, TInstant deadline, + TEvPut(const TLogoBlobID &id, TRope &&buffer, TInstant deadline, NKikimrBlobStorage::EPutHandleClass handleClass = NKikimrBlobStorage::TabletLog, ETactic tactic = TacticDefault) : Id(id) @@ -933,17 +933,22 @@ struct TEvBlobStorage { REQUEST_VALGRIND_CHECK_MEM_IS_DEFINED(&tactic, sizeof(tactic)); } - TEvPut(const TLogoBlobID &id, const TString &buffer, TInstant deadline, + TEvPut(const TLogoBlobID &id, TRcBuf &&buffer, TInstant deadline, NKikimrBlobStorage::EPutHandleClass handleClass = NKikimrBlobStorage::TabletLog, ETactic tactic = TacticDefault) - : TEvPut(id, TRcBuf(buffer), deadline, handleClass, tactic) + : TEvPut(id, TRope(std::move(buffer)), deadline, handleClass, tactic) {} + TEvPut(const TLogoBlobID &id, const TString &buffer, TInstant deadline, + NKikimrBlobStorage::EPutHandleClass handleClass = NKikimrBlobStorage::TabletLog, + ETactic tactic = TacticDefault) + : TEvPut(id, TRope(buffer), deadline, handleClass, tactic) + {} TEvPut(const TLogoBlobID &id, const TSharedData &buffer, TInstant deadline, NKikimrBlobStorage::EPutHandleClass handleClass = NKikimrBlobStorage::TabletLog, ETactic tactic = TacticDefault) - : TEvPut(id, TRcBuf(buffer), deadline, handleClass, tactic) + : TEvPut(id, TRope(buffer), deadline, handleClass, tactic) {} TString Print(bool isFull) const { diff --git a/contrib/ydb/core/blob_depot/agent/storage_put.cpp b/contrib/ydb/core/blob_depot/agent/storage_put.cpp index 4f2c045f9a6..62b7ef86b19 100644 --- a/contrib/ydb/core/blob_depot/agent/storage_put.cpp +++ b/contrib/ydb/core/blob_depot/agent/storage_put.cpp @@ -115,7 +115,7 @@ namespace NKikimr::NBlobDepot { footer.StoredBlobId = Request.Id; } - auto put = [&](EBlobType type, TRcBuf&& buffer) { + auto put = [&](EBlobType type, TRope&& buffer) { const auto& [id, groupId] = kind.MakeBlobId(Agent, BlobSeqId, type, 0, buffer.size()); Y_ABORT_UNLESS(!locator->HasGroupId() || locator->GetGroupId() == groupId); locator->SetGroupId(groupId); @@ -130,17 +130,17 @@ namespace NKikimr::NBlobDepot { if (SuppressFooter) { // write the blob as is, we don't need footer for this kind - put(EBlobType::VG_DATA_BLOB, TRcBuf(std::move(Request.Buffer))); + put(EBlobType::VG_DATA_BLOB, std::move(Request.Buffer)); } else if (Request.Buffer.size() + sizeof(TVirtualGroupBlobFooter) <= MaxBlobSize) { // write single blob with footer TRope buffer = TRope(std::move(Request.Buffer)); buffer.Insert(buffer.End(), std::move(footerData)); buffer.Compact(); - put(EBlobType::VG_COMPOSITE_BLOB, TRcBuf(std::move(buffer))); + put(EBlobType::VG_COMPOSITE_BLOB, std::move(buffer)); } else { // write data blob and blob with footer - put(EBlobType::VG_DATA_BLOB, TRcBuf(std::move(Request.Buffer))); - put(EBlobType::VG_FOOTER_BLOB, TRcBuf(std::move(footerData))); + put(EBlobType::VG_DATA_BLOB, std::move(Request.Buffer)); + put(EBlobType::VG_FOOTER_BLOB, TRope(std::move(footerData))); } if (IssueUncertainWrites) { diff --git a/contrib/ydb/core/blobstorage/dsproxy/dsproxy_put.cpp b/contrib/ydb/core/blobstorage/dsproxy/dsproxy_put.cpp index 08bd1585405..f5d50cc0606 100644 --- a/contrib/ydb/core/blobstorage/dsproxy/dsproxy_put.cpp +++ b/contrib/ydb/core/blobstorage/dsproxy/dsproxy_put.cpp @@ -472,7 +472,7 @@ class TBlobStorageGroupPutRequest : public TBlobStorageGroupRequestActorBunch.emplace_back(new IEventHandle( TActorId() /*recipient*/, item.Recipient, - put = new TEvBlobStorage::TEvPut(item.BlobId, TRcBuf(item.Buffer), item.Deadline, HandleClass, Tactic), + put = new TEvBlobStorage::TEvPut(item.BlobId, std::move(item.Buffer), item.Deadline, HandleClass, Tactic), 0 /*flags*/, item.Cookie, nullptr /*forwardOnNondelivery*/, @@ -524,9 +524,12 @@ class TBlobStorageGroupPutRequest : public TBlobStorageGroupRequestActorOrbit.HasShuttles()) { RootCauseTrack.IsOn = true; } - ReportBytes(PutImpl.Blobs[0].Buffer.capacity() + sizeof(*this)); - - RequestBytes = ev->Buffer.size(); + RequestBytes = 0; + for (auto &item: PutImpl.Blobs) { + ReportBytes(item.Buffer.capacity()); + RequestBytes += item.BufferSize; + } + ReportBytes(sizeof(*this)); RequestHandleClass = HandleClassToHandleClass(HandleClass); MaxSaneRequests = info->Type.TotalPartCount() * (1ull + info->Type.Handoff()) * 2; } diff --git a/contrib/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.h b/contrib/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.h index f5abe068fd1..e66c7a5913c 100644 --- a/contrib/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.h +++ b/contrib/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.h @@ -115,7 +115,7 @@ class TPutImpl { , Tactic(ev->Tactic) { BlobMap.emplace(ev->Id, Blobs.size()); - Blobs.emplace_back(ev->Id, TRope(ev->Buffer), recipient, cookie, std::move(traceId), std::move(ev->Orbit), + Blobs.emplace_back(ev->Id, std::move(ev->Buffer), recipient, cookie, std::move(traceId), std::move(ev->Orbit), std::move(ev->ExtraBlockChecks), true, std::move(ev->ExecutionRelay), ev->Deadline); auto& blob = Blobs.back(); @@ -144,7 +144,7 @@ class TPutImpl { Y_ABORT_UNLESS(msg.HandleClass == putHandleClass); Y_ABORT_UNLESS(msg.Tactic == tactic); BlobMap.emplace(msg.Id, Blobs.size()); - Blobs.emplace_back(msg.Id, TRope(msg.Buffer), ev->Sender, ev->Cookie, std::move(ev->TraceId), + Blobs.emplace_back(msg.Id, std::move(msg.Buffer), ev->Sender, ev->Cookie, std::move(ev->TraceId), std::move(msg.Orbit), std::move(msg.ExtraBlockChecks), false, std::move(msg.ExecutionRelay), msg.Deadline);