Skip to content

Commit 24c2d11

Browse files
authored
fix return tablet restart count (#12789)
1 parent d70ac47 commit 24c2d11

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

ydb/core/mind/hive/hive_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,7 @@ bool THive::IsTabletMoveExpedient(const TTabletInfo& tablet, const TNodeInfo& no
18661866
void THive::FillTabletInfo(NKikimrHive::TEvResponseHiveInfo& response, ui64 tabletId, const TLeaderTabletInfo *info, const NKikimrHive::TEvRequestHiveInfo &req) {
18671867
if (info) {
18681868
TInstant now = TActivationContext::Now();
1869-
TInstant restartsBarrierTime = now - GetTabletRestartsPeriod();
1869+
TInstant restartsBarrierTime = now - GetTabletRestartWatchPeriod();
18701870
auto& tabletInfo = *response.AddTablets();
18711871
tabletInfo.SetTabletID(tabletId);
18721872
tabletInfo.SetTabletType(info->Type);

ydb/core/mind/hive/hive_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ TTabletInfo* FindTabletEvenInDeleting(TTabletId tabletId, TFollowerId followerId
853853
return CurrentConfig.GetEnableFastTabletMove();
854854
}
855855

856-
TDuration GetTabletRestartsPeriod() const {
856+
TDuration GetTabletRestartsPeriodForPenalties() const {
857857
return TDuration::MilliSeconds(CurrentConfig.GetTabletRestartsPeriod());
858858
}
859859

ydb/core/mind/hive/tx__update_tablet_status.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class TTxUpdateTabletStatus : public TTransactionBase<THive> {
153153
if (Generation < leader.KnownGeneration) {
154154
return true;
155155
}
156-
if (leader.GetRestartsPerPeriod(now - Self->GetTabletRestartsPeriod()) >= Self->GetTabletRestartsMaxCount()) {
156+
if (leader.GetRestartsPerPeriod(now - Self->GetTabletRestartsPeriodForPenalties()) >= Self->GetTabletRestartsMaxCount()) {
157157
if (IsGoodStatusForPenalties()) {
158158
leader.PostponeStart(now + Self->GetPostponeStartPeriod());
159159
BLOG_D("THive::TTxUpdateTabletStatus::Execute for tablet " << tablet->ToString()

ydb/core/protos/config.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,14 +1628,14 @@ message THiveConfig {
16281628
optional bool ContinueAutoBalancer = 31 [default = true];
16291629
optional double MinNodeUsageToBalance = 32 [default = 0.1];
16301630
optional double MinPeriodBetweenReassign = 33 [default = 300.0]; // seconds
1631-
optional double TabletRestartWatchPeriod = 34 [default = 3600.0]; // seconds
1631+
optional double TabletRestartWatchPeriod = 34 [default = 3600.0]; // seconds, period used for statistics, not to be confused with TabletRestartsPeriod
16321632
optional double NodeRestartWatchPeriod = 35 [default = 3600.0]; // seconds
16331633
optional uint64 NodeDeletePeriod = 36 [default = 3600]; // seconds
16341634
repeated THiveTabletLimit DefaultTabletLimit = 37;
16351635
repeated THiveTabletPreference DefaultTabletPreference = 38;
16361636
optional uint64 SystemTabletCategoryId = 39 [default = 1];
16371637
optional bool EnableFastTabletMove = 40 [default = true];
1638-
optional uint64 TabletRestartsPeriod = 42 [default = 1000]; // milliseconds
1638+
optional uint64 TabletRestartsPeriod = 42 [default = 1000]; // milliseconds, period checked for penalties - not to be confused with TabletRestartWatchPeriod
16391639
optional uint64 TabletRestarsMaxCount = 43 [default = 2]; // deprecated, use TabletRestartsMaxCount instead
16401640
optional uint64 PostponeStartPeriod = 44 [default = 1000]; // milliseconds
16411641
optional EHiveNodeSelectStrategy NodeSelectStrategy = 45 [default = HIVE_NODE_SELECT_STRATEGY_RANDOM_MIN_7P];

0 commit comments

Comments
 (0)