Skip to content

Balancing: fix fresh blobs ingress merging #9035

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

Merged
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
24 changes: 2 additions & 22 deletions ydb/core/blobstorage/ut_blobstorage/balancing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,12 @@ struct TStopOneNodeTest {
Env.StartNode(nodeIdWithBlob);
Env->Sim(TDuration::Seconds(30));

Cerr << "Start compaction 1" << Endl;
Cerr << "Start compaction" << Endl;
for (ui32 pos = 0; pos < Env->Settings.NodeCount; ++pos) {
Env->CompactVDisk(Env.GroupInfo->GetActorId(pos));
}
Env->Sim(TDuration::Seconds(30));
Cerr << "Finish compaction 1" << Endl;

Cerr << "Start compaction 2" << Endl;
for (ui32 pos = 0; pos < Env->Settings.NodeCount; ++pos) {
Env->CompactVDisk(Env.GroupInfo->GetActorId(pos));
}
Env->Sim(TDuration::Seconds(30));
Cerr << "Finish compaction 2" << Endl;
Cerr << "Finish compaction" << Endl;

Env.CheckPartsLocations(MakeLogoBlobId(step, data.size()));
UNIT_ASSERT_VALUES_EQUAL(Env.SendGet(step, data.size())->Get()->Responses[0].Buffer.ConvertToString(), data);
Expand Down Expand Up @@ -327,12 +320,6 @@ struct TRandomTest {
}
Env->Sim(TDuration::Seconds(60));

Cerr << "Start compaction 2" << Endl;
for (ui32 pos = 0; pos < Env->Settings.NodeCount; ++pos) {
Env->CompactVDisk(Env.GroupInfo->GetActorId(pos));
}
Env->Sim(TDuration::Seconds(60));

Cerr << "Start checking" << Endl;
for (ui32 step: successfulSteps) {
Env.CheckPartsLocations(MakeLogoBlobId(step, data[step].size()));
Expand Down Expand Up @@ -408,13 +395,6 @@ struct TTwoPartsOnOneNodeTest {
Env->Sim(TDuration::Seconds(30));
Cerr << "Finish compaction 1" << Endl;

Cerr << "Start compaction 2" << Endl;
for (ui32 pos = 0; pos < Env->Settings.NodeCount; ++pos) {
Env->CompactVDisk(Env.GroupInfo->GetActorId(pos));
}
Env->Sim(TDuration::Seconds(30));
Cerr << "Finish compaction 2" << Endl;

Env.CheckPartsLocations(MakeLogoBlobId(step, data.size()));
UNIT_ASSERT_VALUES_EQUAL(Env.SendGet(step, data.size())->Get()->Responses[0].Buffer.ConvertToString(), data);
}
Expand Down
9 changes: 9 additions & 0 deletions ydb/core/blobstorage/vdisk/balance/balancing_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ namespace NBalancing {
}

void CollectKeys() {
if (ConnectedVDisks.size() + 1 != GInfo->GetTotalVDisksNum()) {
// not all vdisks are connected
STLOG(PRI_INFO, BS_VDISK_BALANCING, BSVB11, VDISKP(Ctx->VCtx, "Not all vdisks are connected, balancing should work only for full groups"),
(ConnectedVDisks, ConnectedVDisks.size()), (TotalVDisksInGroup, GInfo->GetTotalVDisksNum()));
Send(Ctx->SkeletonId, new TEvStartBalancing());
PassAway();
return;
}

THPTimer timer;

for (ui32 cnt = 0; It.Valid(); It.Next(), ++cnt) {
Expand Down
3 changes: 2 additions & 1 deletion ydb/core/blobstorage/vdisk/balance/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ namespace NBalancing {
}

void TPartsCollectorMerger::AddFromFresh(const TMemRecLogoBlob& memRec, const TRope* data, const TKeyLogoBlob& key, ui64 /*lsn*/) {
Ingress.Merge(memRec.GetIngress());

if (!memRec.HasData()) {
return;
}
Ingress.Merge(memRec.GetIngress());

const NMatrix::TVectorType local = memRec.GetLocalParts(GType);

Expand Down
Loading