diff options
author | hor911 <hor911@ydb.tech> | 2022-07-13 13:07:18 +0300 |
---|---|---|
committer | hor911 <hor911@ydb.tech> | 2022-07-13 13:07:18 +0300 |
commit | 131ad00e53ba8cccaafd2d64dac4e32ba9c4b64b (patch) | |
tree | 628f87fa235b4e2efd476394e7e97120715f2827 | |
parent | 6157257b248ac6fd5eaa1b37b2b808ae3b815d3d (diff) | |
download | ydb-131ad00e53ba8cccaafd2d64dac4e32ba9c4b64b.tar.gz |
Always publish own DC (especially if is is not used)
-rw-r--r-- | ydb/core/yq/libs/actors/nodes_manager.cpp | 8 | ||||
-rw-r--r-- | ydb/core/yq/libs/actors/nodes_manager.h | 1 | ||||
-rw-r--r-- | ydb/core/yq/libs/init/init.cpp | 3 |
3 files changed, 9 insertions, 3 deletions
diff --git a/ydb/core/yq/libs/actors/nodes_manager.cpp b/ydb/core/yq/libs/actors/nodes_manager.cpp index 7edd6962f78..692ec6a8e06 100644 --- a/ydb/core/yq/libs/actors/nodes_manager.cpp +++ b/ydb/core/yq/libs/actors/nodes_manager.cpp @@ -42,6 +42,7 @@ public: const ::NYql::NCommon::TServiceCounters& serviceCounters, const NConfig::TPrivateApiConfig& privateApiConfig, const ui32& icPort, + bool useDataCenter, const TString& dataCenter, const TString& tenant, ui64 mkqlInitialMemoryLimit) @@ -54,6 +55,7 @@ public: , MkqlInitialMemoryLimit(mkqlInitialMemoryLimit) , YqSharedResources(yqSharedResources) , IcPort(icPort) + , UseDataCenter(useDataCenter) , DataCenter(dataCenter) , InternalServiceId(MakeInternalServiceActorId()) @@ -110,7 +112,7 @@ private: NextPeer = 0; } - if ( (DataCenter.empty() || nextNode.DataCenter.empty() || DataCenter == nextNode.DataCenter) // non empty DC must match + if ( (!UseDataCenter || DataCenter.empty() || nextNode.DataCenter.empty() || DataCenter == nextNode.DataCenter) // non empty DC must match && ( nextNode.MemoryLimit == 0 // memory is NOT limited || nextNode.MemoryLimit >= nextNode.MemoryAllocated + MkqlInitialMemoryLimit) // or enough ) { @@ -272,6 +274,7 @@ private: NYq::TYqSharedResources::TPtr YqSharedResources; const ui32 IcPort; // Interconnect Port + bool UseDataCenter; TString DataCenter; struct TPeer { @@ -303,11 +306,12 @@ IActor* CreateNodesManager( const NYq::TYqSharedResources::TPtr& yqSharedResources, const ui32& icPort, const TString& dataCenter, + bool useDataCenter, const TString& tenant, ui64 mkqlInitialMemoryLimit) { return new TNodesManagerActor(yqSharedResources, workerManagerCounters, timeProvider, randomProvider, - serviceCounters, privateApiConfig, icPort, dataCenter, tenant, mkqlInitialMemoryLimit); + serviceCounters, privateApiConfig, icPort, useDataCenter, dataCenter, tenant, mkqlInitialMemoryLimit); } } // namespace NYq diff --git a/ydb/core/yq/libs/actors/nodes_manager.h b/ydb/core/yq/libs/actors/nodes_manager.h index 4a9b47f8b9b..302e7c57538 100644 --- a/ydb/core/yq/libs/actors/nodes_manager.h +++ b/ydb/core/yq/libs/actors/nodes_manager.h @@ -29,6 +29,7 @@ IActor* CreateNodesManager( const NYq::TYqSharedResources::TPtr& yqSharedResources, const ui32& icPort, const TString& dataCenter = "", + bool useDataCenter = false, const TString& tenant = "", ui64 mkqlInitialMemoryLimit = 0); diff --git a/ydb/core/yq/libs/init/init.cpp b/ydb/core/yq/libs/init/init.cpp index 9decec3291b..c0ee749a8f9 100644 --- a/ydb/core/yq/libs/init/init.cpp +++ b/ydb/core/yq/libs/init/init.cpp @@ -207,7 +207,8 @@ void Init( protoConfig.GetPrivateApi(), yqSharedResources, icPort, - protoConfig.GetNodesManager().GetUseDataCenter() ? protoConfig.GetNodesManager().GetDataCenter() : "", + protoConfig.GetNodesManager().GetDataCenter(), + protoConfig.GetNodesManager().GetUseDataCenter(), tenant, mkqlInitialMemoryLimit); |