Skip to content
Draft
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
13 changes: 9 additions & 4 deletions contrib/ydb/core/base/blobstorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ struct TEvBlobStorage {
std::vector<std::pair<ui64, ui32>> ExtraBlockChecks; // (TabletId, Generation) pairs
std::shared_ptr<TExecutionRelay> 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)
Expand All @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions contrib/ydb/core/blob_depot/agent/storage_put.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down
11 changes: 7 additions & 4 deletions contrib/ydb/core/blobstorage/dsproxy/dsproxy_put.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ class TBlobStorageGroupPutRequest : public TBlobStorageGroupRequestActor<TBlobSt
ev->Bunch.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*/,
Expand Down Expand Up @@ -524,9 +524,12 @@ class TBlobStorageGroupPutRequest : public TBlobStorageGroupRequestActor<TBlobSt
if (ev->Orbit.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;
}
Expand Down
4 changes: 2 additions & 2 deletions contrib/ydb/core/blobstorage/dsproxy/dsproxy_put_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand Down