Skip to content

Commit bd62478

Browse files
committed
ensure that there aren't 2 locals on 1 node in 1 hive (#19583)
1 parent 0f0d954 commit bd62478

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ydb/core/mind/local.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ class TDomainLocal : public TActorBootstrapped<TDomainLocal> {
10221022
TRegistrationInfo Info;
10231023
TVector<TActorId> Locals;
10241024
TActorId Subscriber;
1025-
TVector<TTabletId> HiveIds;
1025+
std::set<TTabletId> HiveIds;
10261026
THashMap<TString, TString> Attributes;
10271027
TSubDomainKey DomainKey;
10281028
};
@@ -1144,7 +1144,7 @@ class TDomainLocal : public TActorBootstrapped<TDomainLocal> {
11441144

11451145
void RegisterAsSubDomain(const NKikimrScheme::TEvDescribeSchemeResult &rec,
11461146
const TResolveTask &task,
1147-
const TVector<TTabletId> hiveIds,
1147+
const std::set<TTabletId> hiveIds,
11481148
const TActorContext &ctx)
11491149
{
11501150
const auto &domainDesc = rec.GetPathDescription().GetDomainDescription();
@@ -1265,14 +1265,14 @@ class TDomainLocal : public TActorBootstrapped<TDomainLocal> {
12651265
const auto &domainDesc = rec.GetPathDescription().GetDomainDescription();
12661266
Y_ABORT_UNLESS(domainDesc.GetDomainKey().GetSchemeShard() == SchemeRoot);
12671267

1268-
TVector<TTabletId> hiveIds(HiveIds);
1268+
std::set<TTabletId> hiveIds(HiveIds.begin(), HiveIds.end());
12691269
TTabletId hiveId = domainDesc.GetProcessingParams().GetHive();
12701270
if (hiveId) {
1271-
hiveIds.emplace_back(hiveId);
1271+
hiveIds.emplace(hiveId);
12721272
}
12731273
TTabletId sharedHiveId = domainDesc.GetSharedHive();
12741274
if (sharedHiveId) {
1275-
hiveIds.emplace_back(sharedHiveId);
1275+
hiveIds.emplace(sharedHiveId);
12761276
}
12771277
RegisterAsSubDomain(rec, task, hiveIds, ctx);
12781278

@@ -1303,7 +1303,7 @@ class TDomainLocal : public TActorBootstrapped<TDomainLocal> {
13031303
TTenantInfo& tenant = itTenant->second;
13041304
TTabletId hiveId = ev->Get()->DescribeSchemeResult.GetPathDescription().GetDomainDescription().GetProcessingParams().GetHive();
13051305
if (hiveId) {
1306-
auto itHiveId = Find(tenant.HiveIds, hiveId);
1306+
auto itHiveId = tenant.HiveIds.find(hiveId);
13071307
if (itHiveId == tenant.HiveIds.end()) {
13081308
const auto &domainDesc = ev->Get()->DescribeSchemeResult.GetPathDescription().GetDomainDescription();
13091309
TVector<TSubDomainKey> servicedDomains = {TSubDomainKey(domainDesc.GetDomainKey())};
@@ -1313,7 +1313,7 @@ class TDomainLocal : public TActorBootstrapped<TDomainLocal> {
13131313
<< " to hive " << hiveId
13141314
<< " (allocated resources: " << tenant.Info.ResourceLimit.ShortDebugString() << ")");
13151315
RegisterLocalNode(tenant.Info.TenantName, tenant.Info.ResourceLimit, hiveId, servicedDomains, ctx);
1316-
tenant.HiveIds.emplace_back(hiveId);
1316+
tenant.HiveIds.emplace(hiveId);
13171317
}
13181318
}
13191319
}

0 commit comments

Comments
 (0)