diff options
author | Alexander Rutkovsky <alexvru@ydb.tech> | 2025-03-26 12:49:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-26 12:49:45 +0300 |
commit | 0f63d39136f4076eedcd02421b60e196e3afd088 (patch) | |
tree | 744d544078f29a7748cff0e472ad44730dd9bd36 | |
parent | e0d998b70ed1b2506965ecc4c3667c07747b9663 (diff) | |
download | ydb-0f63d39136f4076eedcd02421b60e196e3afd088.tar.gz |
Fix node vanishing bug (#16224)
-rw-r--r-- | ydb/core/blobstorage/nodewarden/distconf.h | 1 | ||||
-rw-r--r-- | ydb/core/blobstorage/nodewarden/distconf_binding.cpp | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ydb/core/blobstorage/nodewarden/distconf.h b/ydb/core/blobstorage/nodewarden/distconf.h index c9ce2ce5fe..bd66d87ac8 100644 --- a/ydb/core/blobstorage/nodewarden/distconf.h +++ b/ydb/core/blobstorage/nodewarden/distconf.h @@ -227,6 +227,7 @@ namespace NKikimr::NStorage { // pending event queue std::deque<TAutoPtr<IEventHandle>> PendingEvents; std::vector<ui32> NodeIds; + THashSet<ui32> NodeIdsSet; TNodeIdentifier SelfNode; // scatter tasks diff --git a/ydb/core/blobstorage/nodewarden/distconf_binding.cpp b/ydb/core/blobstorage/nodewarden/distconf_binding.cpp index 46b7676b2d..bea763fc0e 100644 --- a/ydb/core/blobstorage/nodewarden/distconf_binding.cpp +++ b/ydb/core/blobstorage/nodewarden/distconf_binding.cpp @@ -58,6 +58,7 @@ namespace NKikimr::NStorage { // issue updates NodeIds = std::move(nodeIds); BindQueue.Update(NodeIds); + NodeIdsSet = {NodeIds.begin(), NodeIds.end()}; } void TDistributedConfigKeeper::IssueNextBindRequest() { @@ -323,7 +324,8 @@ namespace NKikimr::NStorage { const auto [it, inserted] = AllBoundNodes.try_emplace(std::move(nodeId)); TIndirectBoundNode& node = it->second; - if (inserted) { // disable this node from target binding set, this is the first mention of this node + if (inserted && NodeIdsSet.contains(it->first.NodeId())) { + // disable this node from target binding set, this is the first mention of this node BindQueue.Disable(it->first.NodeId()); } @@ -363,7 +365,9 @@ namespace NKikimr::NStorage { if (node.Refs.empty()) { AllBoundNodes.erase(it); - BindQueue.Enable(nodeId.NodeId()); + if (NodeIdsSet.contains(nodeId.NodeId())) { + BindQueue.Enable(nodeId.NodeId()); + } if (msg) { nodeId.Serialize(msg->Record.AddDeletedBoundNodeIds()); } |