diff options
author | serg-belyakov <serg-belyakov@yandex-team.com> | 2023-01-17 12:15:33 +0300 |
---|---|---|
committer | serg-belyakov <serg-belyakov@yandex-team.com> | 2023-01-17 12:15:33 +0300 |
commit | 0306d61aa24ae38e3ae8c16dabb3c71b258d7833 (patch) | |
tree | bdb3cb5a4b46f458943d0add2c884ccd355724a7 | |
parent | c6a4de456ce17e3dd24960e8f13a4459914e98f3 (diff) | |
download | ydb-0306d61aa24ae38e3ae8c16dabb3c71b258d7833.tar.gz |
Don't use sanitizer mechanism when all disks are reconfigured explicitly,
Don't use sanitizer mechanism when all disks are reconfigured explicitly
ErrorReason on empty MisplacedVDisks
-rw-r--r-- | ydb/core/mind/bscontroller/config_fit_groups.cpp | 2 | ||||
-rw-r--r-- | ydb/core/mind/bscontroller/group_geometry_info.h | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/ydb/core/mind/bscontroller/config_fit_groups.cpp b/ydb/core/mind/bscontroller/config_fit_groups.cpp index 802a20554b..be66cb9e2b 100644 --- a/ydb/core/mind/bscontroller/config_fit_groups.cpp +++ b/ydb/core/mind/bscontroller/config_fit_groups.cpp @@ -255,7 +255,7 @@ namespace NKikimr { } } } - if ((replacedDisks.empty() && sanitizingRequest) || (replacedDisks.size() == 1)) { + if ((replacedDisks.empty() && sanitizingRequest) || (replacedDisks.size() == 1 && hasMissingSlots)) { auto result = SanitizeGroup(groupId, group, std::move(forbid), requiredSpace, AllowUnusableDisks); if (replacedDisks.empty()) { diff --git a/ydb/core/mind/bscontroller/group_geometry_info.h b/ydb/core/mind/bscontroller/group_geometry_info.h index 748f9802fc..de7facb514 100644 --- a/ydb/core/mind/bscontroller/group_geometry_info.h +++ b/ydb/core/mind/bscontroller/group_geometry_info.h @@ -85,12 +85,16 @@ namespace NKikimr::NBsController { TGroupMapper::TForbiddenPDisks forbid, i64 requiredSpace) const { TString error; auto misplacedVDisks = mapper.FindMisplacedVDisks(group); - for (const bool requireOperational : {true, false}) { - for (const auto& replacedDisk : misplacedVDisks.Disks) { - TPDiskId pdiskId = group[replacedDisk.FailRealm][replacedDisk.FailDomain][replacedDisk.VDisk]; - if (mapper.TargetMisplacedVDisk(groupId, group, replacedDisk, forbid, requiredSpace, - requireOperational, error)) { - return {replacedDisk, pdiskId}; + if (misplacedVDisks.Disks.size() == 0) { + error = TStringBuilder() << "cannot find misplaced disks, fail level: " << (ui32)misplacedVDisks.FailLevel; + } else { + for (const bool requireOperational : {true, false}) { + for (const auto& replacedDisk : misplacedVDisks.Disks) { + TPDiskId pdiskId = group[replacedDisk.FailRealm][replacedDisk.FailDomain][replacedDisk.VDisk]; + if (mapper.TargetMisplacedVDisk(groupId, group, replacedDisk, forbid, requiredSpace, + requireOperational, error)) { + return {replacedDisk, pdiskId}; + } } } } |