Skip to content

Commit 1688542

Browse files
authored
Merge 61ceca6 into f486ded
2 parents f486ded + 61ceca6 commit 1688542

File tree

4 files changed

+41
-32
lines changed

4 files changed

+41
-32
lines changed

ydb/core/blobstorage/dsproxy/dsproxy_get_impl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ ui64 TGetImpl::GetTimeToAccelerateNs(TLogContext &logCtx, NKikimrBlobStorage::EV
170170
Blackboard.GetWorstPredictedDelaysNs(
171171
*Info, *Blackboard.GroupQueues, queueId, nthWorst, &worstDisks);
172172
}
173+
nthWorst = std::min(nthWorst, (ui32)worstDisks.size() - 1);
173174
return worstDisks[nthWorst].PredictedNs;
174175
}
175176

ydb/core/blobstorage/dsproxy/dsproxy_strategy_base.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,10 @@ void TStrategyBase::Prepare3dcPartPlacement(const TBlobState &state,
390390

391391
ui32 TStrategyBase::MakeSlowSubgroupDiskMask(TBlobState &state, const TBlobStorageGroupInfo &info, TBlackboard &blackboard,
392392
bool isPut) {
393+
if (info.GetTotalVDisksNum() == 1) {
394+
// when there is only one disk, we consider it not slow
395+
return 0;
396+
}
393397
// Find the slowest disk
394398
switch (blackboard.AccelerationMode) {
395399
case TBlackboard::AccelerationModeSkipOneSlowest: {

ydb/core/blobstorage/dsproxy/dsproxy_strategy_get_m3dc_basic.h

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -70,32 +70,34 @@ namespace NKikimr {
7070
// issue request for a specific disk; returns true if the request was issued and not yet completed, otherwise
7171
// false
7272

73-
// find the slowest disk and mark it
74-
switch (blackboard.AccelerationMode) {
75-
case TBlackboard::AccelerationModeSkipOneSlowest: {
76-
TDiskDelayPredictions worstDisks;
77-
state.GetWorstPredictedDelaysNs(info, *blackboard.GroupQueues,
78-
HandleClassToQueueId(blackboard.GetHandleClass), 1,
79-
&worstDisks);
80-
81-
// Check if the slowest disk exceptionally slow, or just not very fast
82-
i32 slowDiskSubgroupIdx = -1;
83-
if (worstDisks[1].PredictedNs > 0 && worstDisks[0].PredictedNs > worstDisks[1].PredictedNs * 2) {
84-
slowDiskSubgroupIdx = worstDisks[1].DiskIdx;
85-
}
73+
if (info.GetTotalVDisksNum() > 1) {
74+
// find the slowest disk and mark it
75+
switch (blackboard.AccelerationMode) {
76+
case TBlackboard::AccelerationModeSkipOneSlowest: {
77+
TDiskDelayPredictions worstDisks;
78+
state.GetWorstPredictedDelaysNs(info, *blackboard.GroupQueues,
79+
HandleClassToQueueId(blackboard.GetHandleClass), 1,
80+
&worstDisks);
81+
82+
// Check if the slowest disk exceptionally slow, or just not very fast
83+
i32 slowDiskSubgroupIdx = -1;
84+
if (worstDisks[1].PredictedNs > 0 && worstDisks[0].PredictedNs > worstDisks[1].PredictedNs * 2) {
85+
slowDiskSubgroupIdx = worstDisks[1].DiskIdx;
86+
}
8687

87-
// Mark single slow disk
88-
for (size_t diskIdx = 0; diskIdx < state.Disks.size(); ++diskIdx) {
89-
state.Disks[diskIdx].IsSlow = false;
90-
}
91-
if (slowDiskSubgroupIdx >= 0) {
92-
state.Disks[slowDiskSubgroupIdx].IsSlow = true;
88+
// Mark single slow disk
89+
for (size_t diskIdx = 0; diskIdx < state.Disks.size(); ++diskIdx) {
90+
state.Disks[diskIdx].IsSlow = false;
91+
}
92+
if (slowDiskSubgroupIdx >= 0) {
93+
state.Disks[slowDiskSubgroupIdx].IsSlow = true;
94+
}
95+
break;
9396
}
94-
break;
97+
case TBlackboard::AccelerationModeSkipMarked:
98+
// The slowest disk is already marked!
99+
break;
95100
}
96-
case TBlackboard::AccelerationModeSkipMarked:
97-
// The slowest disk is already marked!
98-
break;
99101
}
100102

101103
// create an array defining order in which we traverse the disks

ydb/core/blobstorage/dsproxy/dsproxy_strategy_restore.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,18 @@ class TRestoreStrategy : public TStrategyBase {
125125
return *res;
126126
}
127127

128-
// Find the slowest disk
129-
TDiskDelayPredictions worstDisks;
130-
state.GetWorstPredictedDelaysNs(info, *blackboard.GroupQueues,
131-
HandleClassToQueueId(blackboard.PutHandleClass), 1,
132-
&worstDisks);
133-
134-
// Check if the slowest disk exceptionally slow, or just not very fast
135128
TStackVec<ui32, 2> slowDiskSubgroupIdxs;
136-
if (worstDisks[1].PredictedNs > 0 && worstDisks[0].PredictedNs > worstDisks[1].PredictedNs * 2) {
137-
slowDiskSubgroupIdxs.push_back(worstDisks[0].DiskIdx);
129+
if (info.GetTotalVDisksNum() > 1) {
130+
// Find the slowest disk, if there are more than 1
131+
TDiskDelayPredictions worstDisks;
132+
state.GetWorstPredictedDelaysNs(info, *blackboard.GroupQueues,
133+
HandleClassToQueueId(blackboard.PutHandleClass), 1,
134+
&worstDisks);
135+
136+
// Check if the slowest disk exceptionally slow, or just not very fast
137+
if (worstDisks[1].PredictedNs > 0 && worstDisks[0].PredictedNs > worstDisks[1].PredictedNs * 2) {
138+
slowDiskSubgroupIdxs.push_back(worstDisks[0].DiskIdx);
139+
}
138140
}
139141

140142
bool isDone = false;

0 commit comments

Comments
 (0)