aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Shakhov <pixcc@ydb.tech>2024-06-19 23:07:45 +0300
committerGitHub <noreply@github.com>2024-06-19 23:07:45 +0300
commit20230b56f0fefaa72a87378372b1482a0730468c (patch)
tree04d37c9380f67c92303e2668dc507683751fc5c5
parent285cc51f9451ee3981e98da5e70972f2f8873870 (diff)
downloadydb-20230b56f0fefaa72a87378372b1482a0730468c.tar.gz
Rename term to stable node names (#5749)
-rw-r--r--ydb/core/mind/node_broker.cpp12
-rw-r--r--ydb/core/mind/node_broker__register_node.cpp6
-rw-r--r--ydb/core/mind/node_broker_impl.h6
-rw-r--r--ydb/core/mind/node_broker_ut.cpp2
-rw-r--r--ydb/core/protos/feature_flags.proto2
-rw-r--r--ydb/core/protos/node_broker.proto2
6 files changed, 15 insertions, 15 deletions
diff --git a/ydb/core/mind/node_broker.cpp b/ydb/core/mind/node_broker.cpp
index 4ae895c103..27f96e66ca 100644
--- a/ydb/core/mind/node_broker.cpp
+++ b/ydb/core/mind/node_broker.cpp
@@ -64,7 +64,7 @@ void TNodeBroker::OnActivateExecutor(const TActorContext &ctx)
MinDynamicId = Max(MaxStaticId + 1, (ui64)Min(appData->DynamicNameserviceConfig->MinDynamicNodeId, TActorId::MaxNodeId));
MaxDynamicId = Max(MinDynamicId, (ui64)Min(appData->DynamicNameserviceConfig->MaxDynamicNodeId, TActorId::MaxNodeId));
- EnableDynamicNodeNameGeneration = appData->FeatureFlags.GetEnableDynamicNodeNameGeneration();
+ EnableStableNodeNames = appData->FeatureFlags.GetEnableStableNodeNames();
ClearState();
@@ -107,7 +107,7 @@ bool TNodeBroker::OnRenderAppHtmlPage(NMon::TEvRemoteHttpInfo::TPtr ev,
<< " MaxStaticNodeId: " << AppData(ctx)->DynamicNameserviceConfig->MaxStaticNodeId << Endl
<< " MaxDynamicNodeId: " << AppData(ctx)->DynamicNameserviceConfig->MaxDynamicNodeId << Endl
<< " EpochDuration: " << EpochDuration << Endl
- << " NodeNamePrefix: " << NodeNamePrefix << Endl
+ << " StableNodeNamePrefix: " << StableNodeNamePrefix << Endl
<< " BannedIds:";
for (auto &pr : BannedIds)
str << " [" << pr.first << ", " << pr.second << "]";
@@ -346,8 +346,8 @@ void TNodeBroker::FillNodeInfo(const TNodeInfo &node,
void TNodeBroker::FillNodeName(const std::optional<ui32> &slotIndex,
NKikimrNodeBroker::TNodeInfo &info) const
{
- if (EnableDynamicNodeNameGeneration && slotIndex.has_value()) {
- const TString name = TStringBuilder() << NodeNamePrefix << slotIndex.value();
+ if (EnableStableNodeNames && slotIndex.has_value()) {
+ const TString name = TStringBuilder() << StableNodeNamePrefix << slotIndex.value();
info.SetName(name);
}
}
@@ -488,7 +488,7 @@ void TNodeBroker::LoadConfigFromProto(const NKikimrNodeBroker::TConfig &config)
EpochDuration = MIN_LEASE_DURATION;
}
- NodeNamePrefix = config.GetNodeNamePrefix();
+ StableNodeNamePrefix = config.GetStableNodeNamePrefix();
BannedIds.clear();
for (auto &banned : config.GetBannedNodeIds())
@@ -792,7 +792,7 @@ void TNodeBroker::Handle(TEvConsole::TEvConfigNotificationRequest::TPtr &ev,
{
const auto& appConfig = ev->Get()->Record.GetConfig();
if (appConfig.HasFeatureFlags()) {
- EnableDynamicNodeNameGeneration = appConfig.GetFeatureFlags().GetEnableDynamicNodeNameGeneration();
+ EnableStableNodeNames = appConfig.GetFeatureFlags().GetEnableStableNodeNames();
}
if (ev->Get()->Record.HasLocal() && ev->Get()->Record.GetLocal()) {
diff --git a/ydb/core/mind/node_broker__register_node.cpp b/ydb/core/mind/node_broker__register_node.cpp
index 1d9a5fc46c..1b4ea33e47 100644
--- a/ydb/core/mind/node_broker__register_node.cpp
+++ b/ydb/core/mind/node_broker__register_node.cpp
@@ -62,7 +62,7 @@ public:
ctx);
}
- if (Self->EnableDynamicNodeNameGeneration && rec.HasPath() && ServicedSubDomain == InvalidSubDomainKey) {
+ if (Self->EnableStableNodeNames && rec.HasPath() && ServicedSubDomain == InvalidSubDomainKey) {
return Error(TStatus::ERROR,
TStringBuilder() << "Cannot resolve subdomain key for path " << rec.GetPath(),
ctx);
@@ -100,7 +100,7 @@ public:
}
node.AuthorizedByCertificate = rec.GetAuthorizedByCertificate();
- if (Self->EnableDynamicNodeNameGeneration) {
+ if (Self->EnableStableNodeNames) {
if (ServicedSubDomain != node.ServicedSubDomain) {
if (node.SlotIndex.has_value()) {
Self->SlotIndexesPools[node.ServicedSubDomain].Release(node.SlotIndex.value());
@@ -131,7 +131,7 @@ public:
Node->Lease = 1;
Node->Expire = expire;
- if (Self->EnableDynamicNodeNameGeneration) {
+ if (Self->EnableStableNodeNames) {
Node->ServicedSubDomain = ServicedSubDomain;
Node->SlotIndex = Self->SlotIndexesPools[Node->ServicedSubDomain].AcquireLowestFreeIndex();
}
diff --git a/ydb/core/mind/node_broker_impl.h b/ydb/core/mind/node_broker_impl.h
index bf611c494f..9efe587947 100644
--- a/ydb/core/mind/node_broker_impl.h
+++ b/ydb/core/mind/node_broker_impl.h
@@ -303,7 +303,7 @@ private:
TDynBitMap FreeIds;
// Maps tenant to its slot indexes pool.
std::unordered_map<TSubDomainKey, TSlotIndexesPool, THash<TSubDomainKey>> SlotIndexesPools;
- bool EnableDynamicNodeNameGeneration = false;
+ bool EnableStableNodeNames = false;
// Epoch info.
TEpochInfo Epoch;
// Current config.
@@ -314,7 +314,7 @@ private:
TDuration EpochDuration;
TVector<std::pair<ui32, ui32>> BannedIds;
ui64 ConfigSubscriptionId;
- TString NodeNamePrefix;
+ TString StableNodeNamePrefix;
// Events collected during initialization phase.
TMultiMap<ui64, TEvNodeBroker::TEvListNodes::TPtr> DelayedListNodesRequests;
@@ -329,7 +329,7 @@ public:
, TTabletExecutedFlat(info, tablet, new NMiniKQL::TMiniKQLFactory)
, EpochDuration(TDuration::Hours(1))
, ConfigSubscriptionId(0)
- , NodeNamePrefix("slot-")
+ , StableNodeNamePrefix("slot-")
, TxProcessor(new TTxProcessor(*this, "root", NKikimrServices::NODE_BROKER))
{
}
diff --git a/ydb/core/mind/node_broker_ut.cpp b/ydb/core/mind/node_broker_ut.cpp
index e7619676b8..33156cd3af 100644
--- a/ydb/core/mind/node_broker_ut.cpp
+++ b/ydb/core/mind/node_broker_ut.cpp
@@ -173,7 +173,7 @@ void SetupServices(TTestActorRuntime &runtime,
dnConfig->MinDynamicNodeId = 1024;
dnConfig->MaxDynamicNodeId = 1024 + (maxDynNodes - 1);
runtime.GetAppData().FeatureFlags.SetEnableNodeBrokerSingleDomainMode(true);
- runtime.GetAppData().FeatureFlags.SetEnableDynamicNodeNameGeneration(true);
+ runtime.GetAppData().FeatureFlags.SetEnableStableNodeNames(true);
if (!runtime.IsRealThreads()) {
TDispatchOptions options;
diff --git a/ydb/core/protos/feature_flags.proto b/ydb/core/protos/feature_flags.proto
index 097379a385..0e9999af4b 100644
--- a/ydb/core/protos/feature_flags.proto
+++ b/ydb/core/protos/feature_flags.proto
@@ -134,7 +134,7 @@ message TFeatureFlags {
optional bool EnableLocalDBFlatIndex = 119 [default = true];
optional bool ExtendedVDiskCounters = 120 [default = true];
optional bool ExtendedPDiskSensors = 121 [default = true];
- optional bool EnableDynamicNodeNameGeneration = 122 [default = false];
+ optional bool EnableStableNodeNames = 122 [default = false];
optional bool EnableBackupService = 123 [default = false];
optional bool EnableVolatileTransactionArbiters = 124 [default = false];
optional bool EnableGraphShard = 125 [default = false];
diff --git a/ydb/core/protos/node_broker.proto b/ydb/core/protos/node_broker.proto
index f94dd5fcc3..e126492b4e 100644
--- a/ydb/core/protos/node_broker.proto
+++ b/ydb/core/protos/node_broker.proto
@@ -102,7 +102,7 @@ message TConfig {
optional uint64 EpochDuration = 1 [default = 3600000000];
// Don't allocate and extend lease for IDs from banned intervals.
repeated TNodeIds BannedNodeIds = 2;
- optional string NodeNamePrefix = 3 [default = "slot-"];
+ optional string StableNodeNamePrefix = 3 [default = "slot-"];
}
message TGetConfigRequest {