Skip to content

Commit 1bf9504

Browse files
committed
fix tests
1 parent d9172af commit 1bf9504

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

ydb/core/blobstorage/dsproxy/dsproxy_patch.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ class TBlobStorageGroupPatchRequest : public TBlobStorageGroupRequestActor {
594594
// ScheduleWakeUp(StartTime, MovedPatchTag);
595595
Become(&TBlobStorageGroupPatchRequest::MovedPatchState);
596596
IsMovedPatch = true;
597-
ui32 subgroupIdx = 0;
597+
std::optional<ui32> subgroupIdx = 0;
598598

599599
if (OkVDisksWithParts) {
600600
ui32 okVDiskIdx = RandomNumber<ui32>(OkVDisksWithParts.size());
@@ -615,13 +615,16 @@ class TBlobStorageGroupPatchRequest : public TBlobStorageGroupRequestActor {
615615
goodDisks.push_back(idx);
616616
}
617617
}
618-
ui32 okVDiskIdx = RandomNumber<ui32>(goodDisks.size());
619-
subgroupIdx = goodDisks[okVDiskIdx];
620-
} else {
621-
subgroupIdx = RandomNumber<ui32>(Info->Type.TotalPartCount());
618+
if (goodDisks.size()) {
619+
ui32 okVDiskIdx = RandomNumber<ui32>(goodDisks.size());
620+
subgroupIdx = goodDisks[okVDiskIdx];
621+
}
622622
}
623623
}
624-
TVDiskID vDisk = Info->GetVDiskInSubgroup(subgroupIdx, OriginalId.Hash());
624+
if (!subgroupIdx) {
625+
subgroupIdx = RandomNumber<ui32>(Info->Type.TotalPartCount());
626+
}
627+
TVDiskID vDisk = Info->GetVDiskInSubgroup(*subgroupIdx, OriginalId.Hash());
625628
TDeque<std::unique_ptr<TEvBlobStorage::TEvVMovedPatch>> events;
626629

627630
ui64 cookie = ((ui64)OriginalId.Hash() << 32) | PatchedId.Hash();

0 commit comments

Comments
 (0)