aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshmel1k <shmel1k@ydb.tech>2023-08-09 07:48:02 +0300
committershmel1k <shmel1k@ydb.tech>2023-08-09 08:12:27 +0300
commit2b4c121c5b1f0a9234dbdbca882266513b6aecb9 (patch)
tree7055ade43d94d0355844fb163aedeccb7f7fb257
parent0d19892e44c1e2c43f86a9380e1e83af79245155 (diff)
downloadydb-2b4c121c5b1f0a9234dbdbca882266513b6aecb9.tar.gz
add message for non-existing nodeid on verify
-rw-r--r--ydb/core/cms/cluster_info.cpp12
-rw-r--r--ydb/core/cms/cluster_info.h20
2 files changed, 23 insertions, 9 deletions
diff --git a/ydb/core/cms/cluster_info.cpp b/ydb/core/cms/cluster_info.cpp
index f9f078f1f82..3dfa3c73aed 100644
--- a/ydb/core/cms/cluster_info.cpp
+++ b/ydb/core/cms/cluster_info.cpp
@@ -401,7 +401,7 @@ void TClusterInfo::SetNodeState(ui32 nodeId, NKikimrCms::EState state, const NKi
}
}
- node.UpdateNodeState();
+ node.UpdateNodeState();
}
void TClusterInfo::ClearNode(ui32 nodeId)
@@ -895,7 +895,7 @@ void TClusterInfo::ApplyStateStorageInfo(TIntrusiveConstPtr<TStateStorageInfo> i
ringInfo->SetDisabled();
for(auto replica : ring.Replicas) {
- Y_VERIFY(HasNode(replica.NodeId()));
+ CheckNodeExistenceWithVerify(replica.NodeId());
ringInfo->AddNode(Nodes[replica.NodeId()]);
StateStorageReplicas.insert(replica.NodeId());
StateStorageNodeToRingId[replica.NodeId()] = ringId;
@@ -918,9 +918,15 @@ void TClusterInfo::GenerateTenantNodesCheckers() {
void TClusterInfo::GenerateSysTabletsNodesCheckers() {
for (auto tablet : BootstrapConfig.GetTablet()) {
- SysNodesCheckers[tablet.GetType()] = TSimpleSharedPtr<TSysTabletsNodesCounter>(new TSysTabletsNodesCounter(tablet.GetType()));
+ SysNodesCheckers[tablet.GetType()] = TSimpleSharedPtr<TSysTabletsNodesCounter>(new TSysTabletsNodesCounter(tablet.GetType()));
for (auto nodeId : tablet.GetNode()) {
+ if (!HasNode(nodeId)) {
+ BLOG_ERROR(TStringBuilder() << "Got node " << nodeId
+ << " with system tablet, which exists in configuration, "
+ "but does not exist in cluster.");
+ continue;
+ }
NodeToTabletTypes[nodeId].push_back(tablet.GetType());
NodeRef(nodeId).AddNodeGroup(SysNodesCheckers[tablet.GetType()]);
}
diff --git a/ydb/core/cms/cluster_info.h b/ydb/core/cms/cluster_info.h
index 12424eafabf..33d1fd495b8 100644
--- a/ydb/core/cms/cluster_info.h
+++ b/ydb/core/cms/cluster_info.h
@@ -695,6 +695,14 @@ public:
return StateStorageNodeToRingId[nodeId];
}
+ void CheckNodeExistenceWithVerify(ui32 nodeId) const {
+ Y_VERIFY(HasNode(nodeId), "%s",
+ (TStringBuilder()
+ << "Node " << nodeId
+ << " does not exist in cluster, but exists in configuration.")
+ .c_str());
+ }
+
bool HasNode(ui32 nodeId) const {
return Nodes.contains(nodeId);
}
@@ -708,7 +716,7 @@ public:
}
const TNodeInfo &Node(ui32 nodeId) const {
- Y_VERIFY(HasNode(nodeId));
+ CheckNodeExistenceWithVerify(nodeId);
return *Nodes.find(nodeId)->second;
}
@@ -726,7 +734,7 @@ public:
auto pr = HostNameToNodeId.equal_range(hostName);
for (auto it = pr.first; it != pr.second; ++it) {
nodeId = it->second;
- Y_VERIFY(HasNode(nodeId));
+ CheckNodeExistenceWithVerify(nodeId);
nodes.push_back(Nodes.find(nodeId)->second.Get());
}
@@ -739,7 +747,7 @@ public:
auto pr = TenantToNodeId.equal_range(tenant);
for (auto it = pr.first; it != pr.second; ++it) {
const ui32 nodeId = it->second;
- Y_VERIFY(HasNode(nodeId));
+ CheckNodeExistenceWithVerify(nodeId);
nodes.push_back(Nodes.find(nodeId)->second.Get());
}
@@ -928,7 +936,7 @@ public:
private:
TNodeInfo &NodeRef(ui32 nodeId) const {
- Y_VERIFY(HasNode(nodeId));
+ CheckNodeExistenceWithVerify(nodeId);
return *Nodes.find(nodeId)->second;
}
@@ -947,7 +955,7 @@ private:
for (auto it = range.first; it != range.second; ++it) {
nodeId = it->second;
- Y_VERIFY(HasNode(nodeId));
+ CheckNodeExistenceWithVerify(nodeId);
auto &node = NodeRef(nodeId);
if (filterByServices && !(node.Services & filterByServices)) {
@@ -989,7 +997,7 @@ private:
auto pr = HostNameToNodeId.equal_range(hostName);
for (auto it = pr.first; it != pr.second; ++it) {
const ui32 nodeId = it->second;
- Y_VERIFY(HasNode(nodeId));
+ CheckNodeExistenceWithVerify(nodeId);
const auto &node = Node(nodeId);
for (const auto &id : node.PDisks) {
Y_VERIFY(HasPDisk(id));