Skip to content

Commit efda3d4

Browse files
authored
Fix node vanishing bug (merge from main #16224) (#16325)
1 parent cf2bd88 commit efda3d4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ydb/core/blobstorage/nodewarden/distconf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ namespace NKikimr::NStorage {
227227
// pending event queue
228228
std::deque<TAutoPtr<IEventHandle>> PendingEvents;
229229
std::vector<ui32> NodeIds;
230+
THashSet<ui32> NodeIdsSet;
230231
TNodeIdentifier SelfNode;
231232

232233
// scatter tasks

ydb/core/blobstorage/nodewarden/distconf_binding.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ namespace NKikimr::NStorage {
5858
// issue updates
5959
NodeIds = std::move(nodeIds);
6060
BindQueue.Update(NodeIds);
61+
NodeIdsSet = {NodeIds.begin(), NodeIds.end()};
6162
}
6263

6364
void TDistributedConfigKeeper::IssueNextBindRequest() {
@@ -323,7 +324,8 @@ namespace NKikimr::NStorage {
323324
const auto [it, inserted] = AllBoundNodes.try_emplace(std::move(nodeId));
324325
TIndirectBoundNode& node = it->second;
325326

326-
if (inserted) { // disable this node from target binding set, this is the first mention of this node
327+
if (inserted && NodeIdsSet.contains(it->first.NodeId())) {
328+
// disable this node from target binding set, this is the first mention of this node
327329
BindQueue.Disable(it->first.NodeId());
328330
}
329331

@@ -363,7 +365,9 @@ namespace NKikimr::NStorage {
363365

364366
if (node.Refs.empty()) {
365367
AllBoundNodes.erase(it);
366-
BindQueue.Enable(nodeId.NodeId());
368+
if (NodeIdsSet.contains(nodeId.NodeId())) {
369+
BindQueue.Enable(nodeId.NodeId());
370+
}
367371
if (msg) {
368372
nodeId.Serialize(msg->Record.AddDeletedBoundNodeIds());
369373
}

0 commit comments

Comments
 (0)