Skip to content

Commit

Permalink
fix drain compatability (#6613)
Browse files Browse the repository at this point in the history
  • Loading branch information
vporyadke authored Jul 15, 2024
1 parent 191c2a6 commit 9b05e80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ydb/core/mind/hive/tx__load_everything.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ class TTxLoadEverything : public TTransactionBase<THive> {
node.Statistics = nodeRowset.GetValueOrDefault<Schema::Node::Statistics>();
node.Name = nodeRowset.GetValueOrDefault<Schema::Node::Name>();
node.BecomeUpOnRestart = nodeRowset.GetValueOrDefault<Schema::Node::BecomeUpOnRestart>(false);
if (node.BecomeUpOnRestart) {
// If a node must become up on restart, it must have been down
// That was not persisted to avoid issues with downgrades
node.Down = true;
}
if (nodeRowset.HaveValue<Schema::Node::Location>()) {
auto location = nodeRowset.GetValue<Schema::Node::Location>();
if (location.HasDataCenter()) {
Expand Down
5 changes: 4 additions & 1 deletion ydb/core/mind/hive/tx__switch_drain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ class TTxSwitchDrainOn : public TTransactionBase<THive> {
}
node->SetDown(true);
if (Settings.Persist) {
db.Table<Schema::Node>().Key(NodeId).Update<Schema::Node::Down, Schema::Node::BecomeUpOnRestart>(true, node->BecomeUpOnRestart);
db.Table<Schema::Node>().Key(NodeId).Update<Schema::Node::BecomeUpOnRestart>(node->BecomeUpOnRestart);
if (Settings.DownPolicy == NKikimrHive::DRAIN_POLICY_KEEP_DOWN) {
db.Table<Schema::Node>().Key(NodeId).Update<Schema::Node::Down>(true);
}
}
}
Self->StartHiveDrain(NodeId, std::move(Settings));
Expand Down

0 comments on commit 9b05e80

Please sign in to comment.