diff options
author | Alexey Efimov <xeno@prnwatch.com> | 2022-03-24 13:12:10 +0300 |
---|---|---|
committer | Alexey Efimov <xeno@prnwatch.com> | 2022-03-24 13:12:10 +0300 |
commit | d9fd72590079fc40db118f7993267f5fc8d1ce58 (patch) | |
tree | bd5c69f961caed35897512f480ab4924d5fc660b | |
parent | 43a2b5dd73d8a7aa80d4c1ba4ee70428fffbd17e (diff) | |
download | ydb-d9fd72590079fc40db118f7993267f5fc8d1ce58.tar.gz |
add setting CheckMoveExpediency KIKIMR-14538
ref:9c38920579dd2aea1af2226e66ea9971cfffc444
-rw-r--r-- | ydb/core/mind/hive/hive_impl.cpp | 8 | ||||
-rw-r--r-- | ydb/core/mind/hive/hive_impl.h | 4 | ||||
-rw-r--r-- | ydb/core/mind/hive/monitoring.cpp | 2 | ||||
-rw-r--r-- | ydb/core/protos/config.proto | 1 |
4 files changed, 14 insertions, 1 deletions
diff --git a/ydb/core/mind/hive/hive_impl.cpp b/ydb/core/mind/hive/hive_impl.cpp index bbe2f60200..9e85839722 100644 --- a/ydb/core/mind/hive/hive_impl.cpp +++ b/ydb/core/mind/hive/hive_impl.cpp @@ -1497,7 +1497,7 @@ TResourceNormalizedValues THive::GetStDevResourceValues() const { bool THive::IsTabletMoveExpedient(const TTabletInfo& tablet, const TNodeInfo& node) const { if (!tablet.IsAlive()) { - BLOG_TRACE("[TME] Move of tablet " << tablet.ToString() << " from " << tablet.NodeId << " to " << node.Id + BLOG_TRACE("[TME] Move of tablet " << tablet.ToString() << " to " << node.Id << " is expedient because the tablet is not alive"); return true; } @@ -1532,6 +1532,12 @@ bool THive::IsTabletMoveExpedient(const TTabletInfo& tablet, const TNodeInfo& no return true; } + if (!GetCheckMoveExpediency()) { + BLOG_TRACE("[TME] Move of tablet " << tablet.ToString() << " from " << tablet.NodeId << " to " << node.Id + << " is forcefully expedient because of the setting"); + return true; + } + TVector<TResourceNormalizedValues> values; std::size_t oldNode = std::numeric_limits<std::size_t>::max(); std::size_t newNode = std::numeric_limits<std::size_t>::max(); diff --git a/ydb/core/mind/hive/hive_impl.h b/ydb/core/mind/hive/hive_impl.h index cc1b642cad..a9034f9d17 100644 --- a/ydb/core/mind/hive/hive_impl.h +++ b/ydb/core/mind/hive/hive_impl.h @@ -739,6 +739,10 @@ public: return TDuration::MilliSeconds(CurrentConfig.GetPostponeStartPeriod()); } + bool GetCheckMoveExpediency() const { + return CurrentConfig.GetCheckMoveExpediency(); + } + const std::unordered_map<TTabletTypes::EType, NKikimrConfig::THiveTabletLimit>& GetTabletLimit() const { return TabletLimit; } diff --git a/ydb/core/mind/hive/monitoring.cpp b/ydb/core/mind/hive/monitoring.cpp index c42fd7fc16..3add5cbee0 100644 --- a/ydb/core/mind/hive/monitoring.cpp +++ b/ydb/core/mind/hive/monitoring.cpp @@ -727,6 +727,7 @@ public: UpdateConfig(db, "MinNodeUsageToBalance"); UpdateConfig(db, "MinPeriodBetweenReassign"); UpdateConfig(db, "NodeSelectStrategy"); + UpdateConfig(db, "CheckMoveExpediency"); if (ChangeRequest) { Self->BuildCurrentConfig(); @@ -913,6 +914,7 @@ public: ShowConfig(out, "MinPeriodBetweenBalance"); ShowConfig(out, "MaxMovementsOnAutoBalancer"); ShowConfig(out, "ContinueAutoBalancer"); + ShowConfig(out, "CheckMoveExpediency"); out << "<div class='row' style='margin-top:40px'>"; out << "<div class='col-sm-2' style='padding-top:30px;text-align:right'><label for='allowedMetrics'>AllowedMetrics:</label></div>"; diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index dc17fcf001..6b1257e319 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -1312,6 +1312,7 @@ message THiveConfig { optional uint64 TabletRestarsMaxCount = 43 [default = 2]; // number optional uint64 PostponeStartPeriod = 44 [default = 1000]; // milliseconds optional EHiveNodeSelectStrategy NodeSelectStrategy = 45 [default = HIVE_NODE_SELECT_STRATEGY_RANDOM_MIN_7P]; + optional bool CheckMoveExpediency = 46 [default = true]; } message TDataShardConfig { |