Skip to content

Commit 04d5796

Browse files
committed
disable vpatch
1 parent 5489596 commit 04d5796

File tree

1 file changed

+46
-3
lines changed

1 file changed

+46
-3
lines changed

ydb/core/blobstorage/dsproxy/dsproxy_patch.cpp

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ class TBlobStorageGroupPatchRequest : public TBlobStorageGroupRequestActor {
591591
void StartMovedPatch() {
592592
PATCH_LOG(PRI_DEBUG, BS_PROXY_PATCH, BPPA09, "Start Moved strategy",
593593
(SentStarts, SentStarts));
594-
ScheduleWakeUp(StartTime, MovedPatchTag);
594+
// ScheduleWakeUp(StartTime, MovedPatchTag);
595595
Become(&TBlobStorageGroupPatchRequest::MovedPatchState);
596596
IsMovedPatch = true;
597597
ui32 subgroupIdx = 0;
@@ -600,6 +600,14 @@ class TBlobStorageGroupPatchRequest : public TBlobStorageGroupRequestActor {
600600
ui32 okVDiskIdx = RandomNumber<ui32>(OkVDisksWithParts.size());
601601
subgroupIdx = OkVDisksWithParts[okVDiskIdx];
602602
} else {
603+
ui64 worstNs = 0;
604+
ui64 nextToWorstNs = 0;
605+
i32 worstSubGroubIdx = -1;
606+
GetWorstPredictedDelaysNs(NKikimrBlobStorage::EVDiskQueueId::PutAsyncBlob, &worstNs, &nextToWorstNs, &worstSubGroubIdx);
607+
if (worstNs > nextToWorstNs * 2) {
608+
SlowFlags[worstSubGroubIdx] = true;
609+
HasSlowVDisk = true;
610+
}
603611
if (HasSlowVDisk) {
604612
TStackVec<ui32, TypicalDisksInSubring> goodDisks;
605613
for (ui32 idx = 0; idx < VDisks.size(); ++idx) {
@@ -659,13 +667,21 @@ class TBlobStorageGroupPatchRequest : public TBlobStorageGroupRequestActor {
659667
void StartVPatch() {
660668
StageStart = TActivationContext::Now();
661669
Become(&TBlobStorageGroupPatchRequest::VPatchState);
662-
Info->PickSubgroup(OriginalId.Hash(), &VDisks, nullptr);
663670
ReceivedResponseFlags.assign(VDisks.size(), false);
664671
ErrorResponseFlags.assign(VDisks.size(), false);
665672
EmptyResponseFlags.assign(VDisks.size(), false);
666673
ForceStopFlags.assign(VDisks.size(), false);
667674
SlowFlags.assign(VDisks.size(), false);
668675

676+
ui64 worstNs = 0;
677+
ui64 nextToWorstNs = 0;
678+
i32 worstSubGroubIdx = -1;
679+
GetWorstPredictedDelaysNs(NKikimrBlobStorage::EVDiskQueueId::GetFastRead, &worstNs, &nextToWorstNs, &worstSubGroubIdx);
680+
if (worstNs > nextToWorstNs * 2) {
681+
SlowFlags[worstSubGroubIdx] = true;
682+
HasSlowVDisk = true;
683+
}
684+
669685
TDeque<std::unique_ptr<TEvBlobStorage::TEvVPatchStart>> events;
670686
for (ui32 idx = 0; idx < VDisks.size(); ++idx) {
671687
if (!SlowFlags[idx]) {
@@ -780,6 +796,15 @@ class TBlobStorageGroupPatchRequest : public TBlobStorageGroupRequestActor {
780796
StageStart = TActivationContext::Now();
781797
IsContinuedVPatch = true;
782798

799+
ui64 worstNs = 0;
800+
ui64 nextToWorstNs = 0;
801+
i32 worstSubGroubIdx = -1;
802+
GetWorstPredictedDelaysNs(NKikimrBlobStorage::EVDiskQueueId::GetFastRead, &worstNs, &nextToWorstNs, &worstSubGroubIdx);
803+
if (worstNs > nextToWorstNs * 2) {
804+
SlowFlags[worstSubGroubIdx] = true;
805+
HasSlowVDisk = true;
806+
}
807+
783808
if (Info->Type.GetErasure() == TErasureType::ErasureMirror3dc) {
784809
return ContinueVPatchForMirror3dc();
785810
}
@@ -894,7 +919,7 @@ class TBlobStorageGroupPatchRequest : public TBlobStorageGroupRequestActor {
894919
IsAllowedErasure = Info->Type.ErasureFamily() == TErasureType::ErasureParityBlock
895920
|| Info->Type.GetErasure() == TErasureType::ErasureNone
896921
|| Info->Type.GetErasure() == TErasureType::ErasureMirror3dc;
897-
if (IsGoodPatchedBlobId && IsAllowedErasure && UseVPatch && OriginalGroupId == Info->GroupID && !IsSecured) {
922+
if (false && IsGoodPatchedBlobId && IsAllowedErasure && UseVPatch && OriginalGroupId == Info->GroupID && !IsSecured) {
898923
PATCH_LOG(PRI_DEBUG, BS_PROXY_PATCH, BPPA03, "Start VPatch strategy from bootstrap");
899924
StartVPatch();
900925
} else {
@@ -908,6 +933,24 @@ class TBlobStorageGroupPatchRequest : public TBlobStorageGroupRequestActor {
908933
}
909934
}
910935

936+
void GetWorstPredictedDelaysNs(NKikimrBlobStorage::EVDiskQueueId queueId,
937+
ui64 *outWorstNs, ui64 *outNextToWorstNs, i32 *outWorstSubgroupIdx) const
938+
{
939+
*outWorstSubgroupIdx = -1;
940+
*outWorstNs = 0;
941+
*outNextToWorstNs = 0;
942+
for (ui32 diskIdx = 0; diskIdx < VDisks.size(); ++diskIdx) {
943+
ui64 predictedNs = GroupQueues->GetPredictedDelayNsByOrderNumber(diskIdx, queueId);;
944+
if (predictedNs > *outWorstNs) {
945+
*outNextToWorstNs = *outWorstNs;
946+
*outWorstNs = predictedNs;
947+
*outWorstSubgroupIdx = diskIdx;
948+
} else if (predictedNs > *outNextToWorstNs) {
949+
*outNextToWorstNs = predictedNs;
950+
}
951+
}
952+
}
953+
911954
void SetSlowDisks() {
912955
for (ui32 idx = 0; idx < SlowFlags.size(); ++idx) {
913956
SlowFlags[idx] = !ReceivedResponseFlags[idx] && !EmptyResponseFlags[idx] && !ErrorResponseFlags[idx];

0 commit comments

Comments
 (0)