Skip to content

Commit

Permalink
Fix VDisk chunks leaking in runtime (#5112)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvru authored Jun 3, 2024
1 parent f960cd6 commit 463821c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 4 additions & 8 deletions ydb/core/blobstorage/vdisk/hullop/blobstorage_hullcommit.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,10 @@ namespace NKikimr {

// notify delayed deleter when log record is actually written; we MUST ensure that updates are coming in
// order of increasing LSN's; this is achieved automatically as all actors reside on the same mailbox
if (WId) {
LevelIndex->DelayedCompactionDeleterInfo->Update(LsnSeg.Last, std::move(Metadata.RemovedHugeBlobs),
CommitRecord.DeleteToDecommitted ? CommitRecord.DeleteChunks : TVector<TChunkIdx>(),
PDiskSignatureForHullDbKey<TKey>(), WId, ctx, Ctx->HugeKeeperId, Ctx->SkeletonId, Ctx->PDiskCtx,
Ctx->HullCtx->VCtx);
} else {
Y_ABORT_UNLESS(Metadata.RemovedHugeBlobs.Empty());
}
LevelIndex->DelayedCompactionDeleterInfo->Update(LsnSeg.Last, std::move(Metadata.RemovedHugeBlobs),
CommitRecord.DeleteToDecommitted ? CommitRecord.DeleteChunks : TVector<TChunkIdx>(),
PDiskSignatureForHullDbKey<TKey>(), WId, ctx, Ctx->HugeKeeperId, Ctx->SkeletonId, Ctx->PDiskCtx,
Ctx->HullCtx->VCtx);

NPDisk::TEvLogResult* msg = ev->Get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ namespace NKikimr {
ui64 wId, const TActorContext& ctx, const TActorId& hugeKeeperId, const TActorId& skeletonId,
const TPDiskCtxPtr& pdiskCtx, const TVDiskContextPtr& vctx) {
Y_ABORT_UNLESS(recordLsn > LastDeletionLsn);
Y_ABORT_UNLESS(!removedHugeBlobs.Empty());
LastDeletionLsn = recordLsn;
LOG_DEBUG_S(ctx, NKikimrServices::BS_HULLCOMP, vctx->VDiskLogPrefix
<< "TDelayedCompactionDeleter: Update recordLsn# " << recordLsn << " removedHugeBlobs.size# "
Expand Down Expand Up @@ -223,8 +222,12 @@ namespace NKikimr {
TReleaseQueueItem& item = ReleaseQueue.front();
if (CurrentSnapshots.empty() || (item.RecordLsn <= CurrentSnapshots.begin()->first)) {
// matching record -- commit it to huge hull keeper and throw out of the queue
ctx.Send(hugeKeeperId, new TEvHullFreeHugeSlots(std::move(item.RemovedHugeBlobs),
item.RecordLsn, item.Signature, item.WId));
if (item.WId) {
ctx.Send(hugeKeeperId, new TEvHullFreeHugeSlots(std::move(item.RemovedHugeBlobs),
item.RecordLsn, item.Signature, item.WId));
} else {
Y_ABORT_UNLESS(item.RemovedHugeBlobs.Empty());
}
if (item.ChunksToForget) {
LOG_DEBUG(ctx, NKikimrServices::BS_VDISK_CHUNKS, VDISKP(vctx->VDiskLogPrefix,
"FORGET: PDiskId# %s ChunksToForget# %s", pdiskCtx->PDiskIdString.data(),
Expand Down

0 comments on commit 463821c

Please sign in to comment.