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

Fix iteration in handoff map and balancing sender/deleter completion #3750

Merged
merged 1 commit into from
Apr 15, 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
2 changes: 2 additions & 0 deletions ydb/core/blobstorage/vdisk/balance/balancing_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
12 changes: 10 additions & 2 deletions ydb/core/blobstorage/vdisk/balance/handoff_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading