diff --git a/ydb/core/blobstorage/vdisk/balance/balancing_actor.cpp b/ydb/core/blobstorage/vdisk/balance/balancing_actor.cpp index bb17b9491c69..ff14300f9b84 100644 --- a/ydb/core/blobstorage/vdisk/balance/balancing_actor.cpp +++ b/ydb/core/blobstorage/vdisk/balance/balancing_actor.cpp @@ -73,6 +73,8 @@ namespace NBalancing { if (Stats.SendPartsLeft != 0 || Stats.DeletePartsLeft != 0) { // sender or deleter has not finished yet + Stats.SendCompleted = Stats.SendPartsLeft == 0; + Stats.DeleteCompleted = Stats.DeletePartsLeft == 0; ContinueBalancing(); return; } diff --git a/ydb/core/blobstorage/vdisk/balance/handoff_map.h b/ydb/core/blobstorage/vdisk/balance/handoff_map.h index c05983b4cdb8..ddb8f2b5103d 100644 --- a/ydb/core/blobstorage/vdisk/balance/handoff_map.h +++ b/ydb/core/blobstorage/vdisk/balance/handoff_map.h @@ -81,9 +81,12 @@ namespace NKikimr { // Transforms record according to the built handoff map. It returns item we need to write, pointer is // valid until next call. Nullptr indicates that item is to be removed completely. const TTransformedItem *Transform(const TKey& key, const TMemRec* memRec, - const TDataMerger* dataMerger, bool /*keepData*/) { + const TDataMerger* dataMerger, bool /*keepData*/, bool keepItem) { // do nothing by default, all work is done in template specialization for logo blobs Counter++; + if (!keepItem) { + return nullptr; + } Y_DEBUG_ABORT_UNLESS(dataMerger->Empty()); return TrRes.SetRaw(key, memRec, dataMerger); } @@ -163,10 +166,15 @@ namespace NKikimr { const TKeyLogoBlob& key, const TMemRecLogoBlob* memRec, const TDataMerger* dataMerger, - bool keepData) + bool keepData, + bool keepItem) { Y_DEFER { Counter++; }; + if (!keepItem) { + return nullptr; + } + if (!keepData) { return TrRes.SetRmData(key, memRec, dataMerger); } diff --git a/ydb/core/blobstorage/vdisk/hullop/blobstorage_hullcompactworker.h b/ydb/core/blobstorage/vdisk/hullop/blobstorage_hullcompactworker.h index 449e21bc49a7..7ebfb73f63d0 100644 --- a/ydb/core/blobstorage/vdisk/hullop/blobstorage_hullcompactworker.h +++ b/ydb/core/blobstorage/vdisk/hullop/blobstorage_hullcompactworker.h @@ -542,11 +542,11 @@ namespace NKikimr { IndexMerger.Finish(); // reset transformed item and try to create new one if we want to keep this item - TransformedItem = nullptr; - if (GcmpIt.KeepItem()) { - const bool keepData = GcmpIt.KeepData(); + const bool keepData = GcmpIt.KeepData(); + const bool keepItem = GcmpIt.KeepItem(); + TransformedItem = Hmp->Transform(key, &IndexMerger.GetMemRec(), IndexMerger.GetDataMerger(), keepData, keepItem); + if (keepItem) { ++(keepData ? Statistics.KeepItemsWithData : Statistics.KeepItemsWOData); - TransformedItem = Hmp->Transform(key, &IndexMerger.GetMemRec(), IndexMerger.GetDataMerger(), keepData); } else { ++Statistics.DontKeepItems; }