diff options
author | alexvru <alexvru@ydb.tech> | 2023-02-06 23:50:34 +0300 |
---|---|---|
committer | alexvru <alexvru@ydb.tech> | 2023-02-06 23:50:34 +0300 |
commit | 55249694bb14fef3f2773ef1381c4bb61ddfc1c8 (patch) | |
tree | c34f1589470969ca4e3047f0a55920bcc88bb6eb | |
parent | 8bc362b8ec58a193a5d8a2cbdc7ca351accf6047 (diff) | |
download | ydb-55249694bb14fef3f2773ef1381c4bb61ddfc1c8.tar.gz |
Disallow decommission of virtual groups
-rw-r--r-- | ydb/core/mind/bscontroller/virtual_group.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ydb/core/mind/bscontroller/virtual_group.cpp b/ydb/core/mind/bscontroller/virtual_group.cpp index 7a4a38f55af..f093eff1b6d 100644 --- a/ydb/core/mind/bscontroller/virtual_group.cpp +++ b/ydb/core/mind/bscontroller/virtual_group.cpp @@ -107,7 +107,13 @@ namespace NKikimr::NBsController { if (!group) { throw TExError() << "group not found" << TErrorParams::GroupId(groupId); } else if (group->DecommitStatus != NKikimrBlobStorage::TGroupDecommitStatus::NONE) { - throw TExError() << "group is already being decommitted" << TErrorParams::GroupId(groupId); + if (group->HiveId != cmd.GetHiveId()) { + throw TExError() << "different hive specified for decommitting group" << TErrorParams::GroupId(groupId); + } + // group is already being decommitted -- make this operation idempotent + continue; + } else if (group->VirtualGroupState) { + throw TExError() << "group is already virtual" << TErrorParams::GroupId(groupId); } group->DecommitStatus = NKikimrBlobStorage::TGroupDecommitStatus::PENDING; |