File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
ydb/core/blobstorage/dsproxy Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff 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 ();
You can’t perform that action at this time.
0 commit comments