diff --git a/ydb/core/mind/hive/tx__load_everything.cpp b/ydb/core/mind/hive/tx__load_everything.cpp index 88967b806b4b..f8a2e3ef74d8 100644 --- a/ydb/core/mind/hive/tx__load_everything.cpp +++ b/ydb/core/mind/hive/tx__load_everything.cpp @@ -318,6 +318,11 @@ class TTxLoadEverything : public TTransactionBase { node.Statistics = nodeRowset.GetValueOrDefault(); node.Name = nodeRowset.GetValueOrDefault(); node.BecomeUpOnRestart = nodeRowset.GetValueOrDefault(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()) { auto location = nodeRowset.GetValue(); if (location.HasDataCenter()) { diff --git a/ydb/core/mind/hive/tx__switch_drain.cpp b/ydb/core/mind/hive/tx__switch_drain.cpp index 1e87a70b1e49..e665b58e2d95 100644 --- a/ydb/core/mind/hive/tx__switch_drain.cpp +++ b/ydb/core/mind/hive/tx__switch_drain.cpp @@ -38,7 +38,10 @@ class TTxSwitchDrainOn : public TTransactionBase { } node->SetDown(true); if (Settings.Persist) { - db.Table().Key(NodeId).Update(true, node->BecomeUpOnRestart); + db.Table().Key(NodeId).Update(node->BecomeUpOnRestart); + if (Settings.DownPolicy == NKikimrHive::DRAIN_POLICY_KEEP_DOWN) { + db.Table().Key(NodeId).Update(true); + } } } Self->StartHiveDrain(NodeId, std::move(Settings));