Skip to content

Don't mark slow disks if there is only one #5340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ydb/core/blobstorage/dsproxy/dsproxy_get_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ ui64 TGetImpl::GetTimeToAccelerateNs(TLogContext &logCtx, NKikimrBlobStorage::EV
Blackboard.GetWorstPredictedDelaysNs(
*Info, *Blackboard.GroupQueues, queueId, nthWorst, &worstDisks);
}
nthWorst = std::min(nthWorst, (ui32)worstDisks.size() - 1);
return worstDisks[nthWorst].PredictedNs;
}

Expand Down
4 changes: 4 additions & 0 deletions ydb/core/blobstorage/dsproxy/dsproxy_strategy_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ void TStrategyBase::Prepare3dcPartPlacement(const TBlobState &state,

ui32 TStrategyBase::MakeSlowSubgroupDiskMask(TBlobState &state, const TBlobStorageGroupInfo &info, TBlackboard &blackboard,
bool isPut) {
if (info.GetTotalVDisksNum() == 1) {
// when there is only one disk, we consider it not slow
return 0;
}
// Find the slowest disk
switch (blackboard.AccelerationMode) {
case TBlackboard::AccelerationModeSkipOneSlowest: {
Expand Down
48 changes: 25 additions & 23 deletions ydb/core/blobstorage/dsproxy/dsproxy_strategy_get_m3dc_basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,34 @@ namespace NKikimr {
// issue request for a specific disk; returns true if the request was issued and not yet completed, otherwise
// false

// find the slowest disk and mark it
switch (blackboard.AccelerationMode) {
case TBlackboard::AccelerationModeSkipOneSlowest: {
TDiskDelayPredictions worstDisks;
state.GetWorstPredictedDelaysNs(info, *blackboard.GroupQueues,
HandleClassToQueueId(blackboard.GetHandleClass), 1,
&worstDisks);

// Check if the slowest disk exceptionally slow, or just not very fast
i32 slowDiskSubgroupIdx = -1;
if (worstDisks[1].PredictedNs > 0 && worstDisks[0].PredictedNs > worstDisks[1].PredictedNs * 2) {
slowDiskSubgroupIdx = worstDisks[1].DiskIdx;
}
if (info.GetTotalVDisksNum() > 1) {
// find the slowest disk and mark it
switch (blackboard.AccelerationMode) {
case TBlackboard::AccelerationModeSkipOneSlowest: {
TDiskDelayPredictions worstDisks;
state.GetWorstPredictedDelaysNs(info, *blackboard.GroupQueues,
HandleClassToQueueId(blackboard.GetHandleClass), 1,
&worstDisks);

// Check if the slowest disk exceptionally slow, or just not very fast
i32 slowDiskSubgroupIdx = -1;
if (worstDisks[1].PredictedNs > 0 && worstDisks[0].PredictedNs > worstDisks[1].PredictedNs * 2) {
slowDiskSubgroupIdx = worstDisks[1].DiskIdx;
}

// Mark single slow disk
for (size_t diskIdx = 0; diskIdx < state.Disks.size(); ++diskIdx) {
state.Disks[diskIdx].IsSlow = false;
}
if (slowDiskSubgroupIdx >= 0) {
state.Disks[slowDiskSubgroupIdx].IsSlow = true;
// Mark single slow disk
for (size_t diskIdx = 0; diskIdx < state.Disks.size(); ++diskIdx) {
state.Disks[diskIdx].IsSlow = false;
}
if (slowDiskSubgroupIdx >= 0) {
state.Disks[slowDiskSubgroupIdx].IsSlow = true;
}
break;
}
break;
case TBlackboard::AccelerationModeSkipMarked:
// The slowest disk is already marked!
break;
}
case TBlackboard::AccelerationModeSkipMarked:
// The slowest disk is already marked!
break;
}

// create an array defining order in which we traverse the disks
Expand Down
20 changes: 11 additions & 9 deletions ydb/core/blobstorage/dsproxy/dsproxy_strategy_restore.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,18 @@ class TRestoreStrategy : public TStrategyBase {
return *res;
}

// Find the slowest disk
TDiskDelayPredictions worstDisks;
state.GetWorstPredictedDelaysNs(info, *blackboard.GroupQueues,
HandleClassToQueueId(blackboard.PutHandleClass), 1,
&worstDisks);

// Check if the slowest disk exceptionally slow, or just not very fast
TStackVec<ui32, 2> slowDiskSubgroupIdxs;
if (worstDisks[1].PredictedNs > 0 && worstDisks[0].PredictedNs > worstDisks[1].PredictedNs * 2) {
slowDiskSubgroupIdxs.push_back(worstDisks[0].DiskIdx);
if (info.GetTotalVDisksNum() > 1) {
// Find the slowest disk, if there are more than 1
TDiskDelayPredictions worstDisks;
state.GetWorstPredictedDelaysNs(info, *blackboard.GroupQueues,
HandleClassToQueueId(blackboard.PutHandleClass), 1,
&worstDisks);

// Check if the slowest disk exceptionally slow, or just not very fast
if (worstDisks[1].PredictedNs > 0 && worstDisks[0].PredictedNs > worstDisks[1].PredictedNs * 2) {
slowDiskSubgroupIdxs.push_back(worstDisks[0].DiskIdx);
}
}

bool isDone = false;
Expand Down
Loading