Skip to content

Commit 358aba0

Browse files
authored
Merge 844d30b into 34e573c
2 parents 34e573c + 844d30b commit 358aba0

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

ydb/core/blobstorage/vdisk/balance/balancing_actor.cpp

+13-6
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ namespace NBalancing {
8787
///////////////////////////////////////////////////////////////////////////////////////////
8888

8989
void ContinueBalancing() {
90+
Ctx->MonGroup.PlannedToSendOnMain() = SendOnMainParts.Data.size();
91+
Ctx->MonGroup.CandidatesToDelete() = TryDeleteParts.Data.size();
92+
9093
if (SendOnMainParts.Empty() && TryDeleteParts.Empty()) {
9194
// no more parts to send or delete
9295
STLOG(PRI_INFO, BS_VDISK_BALANCING, BSVB03, VDISKP(Ctx->VCtx, "Balancing completed"));
@@ -101,8 +104,6 @@ namespace NBalancing {
101104

102105
void ScheduleJobQuant() {
103106
Ctx->MonGroup.ReplTokenAquired()++;
104-
Ctx->MonGroup.PlannedToSendOnMain() = SendOnMainParts.Data.size();
105-
Ctx->MonGroup.CandidatesToDelete() = TryDeleteParts.Data.size();
106107

107108
// once repl token received, start balancing - waking up sender and deleter
108109
STLOG(PRI_INFO, BS_VDISK_BALANCING, BSVB02, VDISKP(Ctx->VCtx, "Schedule job quant"),
@@ -128,16 +129,21 @@ namespace NBalancing {
128129
THPTimer timer;
129130

130131
for (ui32 cnt = 0; It.Valid(); It.Next(), ++cnt) {
131-
if (cnt % 100 == 99 && TDuration::Seconds(timer.Passed()) > JOB_GRANULARITY) {
132+
if (cnt % 128 == 127 && TDuration::Seconds(timer.Passed()) > JOB_GRANULARITY) {
132133
// actor should not block the thread for a long time, so we should yield
133-
// STLOG(PRI_DEBUG, BS_VDISK_BALANCING, BSVB04, VDISKP(Ctx->VCtx, "Collect keys"), (collected, cnt), (passed, timer.Passed()));
134+
STLOG(PRI_DEBUG, BS_VDISK_BALANCING, BSVB04, VDISKP(Ctx->VCtx, "Collect keys"), (collected, cnt), (passed, timer.Passed()));
134135
Send(SelfId(), new NActors::TEvents::TEvWakeup());
135136
return;
136137
}
137138

138139
const auto& top = GInfo->GetTopology();
139140
const auto& key = It.GetCurKey().LogoBlobID();
140141

142+
if (BALANCE_ONLY_HUGE_BLOBS && !Ctx->HugeBlobCtx->IsHugeBlob(GInfo->Type, key, Ctx->MinREALHugeBlobInBytes)) {
143+
// skip non huge blobs
144+
continue;
145+
}
146+
141147
TPartsCollectorMerger merger(top.GType);
142148
It.PutToMerger(&merger);
143149

@@ -197,6 +203,7 @@ namespace NBalancing {
197203
Send(MakeBlobStorageReplBrokerID(), new TEvReleaseReplToken);
198204
STLOG(PRI_INFO, BS_VDISK_BALANCING, BSVB04, VDISKP(Ctx->VCtx, "Epoch timeout"));
199205
PassAway();
206+
return;
200207
}
201208

202209
if (BatchManager.IsBatchCompleted()) {
@@ -242,8 +249,8 @@ namespace NBalancing {
242249

243250
void Handle(NActors::TEvents::TEvUndelivered::TPtr ev) {
244251
if (ev.Get()->Type == TEvReplToken::EventType) {
245-
STLOG(PRI_WARN, BS_VDISK_BALANCING, BSVB06, VDISKP(Ctx->VCtx, "Ask repl token msg not delivered"), (SelfId, SelfId()), (PDiskId, Ctx->VDiskCfg->BaseInfo.PDiskId));
246-
ScheduleJobQuant();
252+
STLOG(PRI_ERROR, BS_VDISK_BALANCING, BSVB06, VDISKP(Ctx->VCtx, "Ask repl token msg not delivered"), (SelfId, SelfId()), (PDiskId, Ctx->VDiskCfg->BaseInfo.PDiskId));
253+
ContinueBalancing();
247254
}
248255
}
249256

ydb/core/blobstorage/vdisk/balance/defs.h

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ namespace NBalancing {
7676
static constexpr ui32 MAX_TO_DELETE_PER_EPOCH = 1000;
7777
static constexpr TDuration EPOCH_TIMEOUT = TDuration::Minutes(1);
7878

79+
static constexpr bool BALANCE_ONLY_HUGE_BLOBS = true;
80+
7981

8082
struct TEvBalancingSendPartsOnMain : TEventLocal<TEvBalancingSendPartsOnMain, TEvBlobStorage::EvBalancingSendPartsOnMain> {
8183
TEvBalancingSendPartsOnMain(const TVector<TLogoBlobID>& ids)

0 commit comments

Comments
 (0)