Skip to content

Commit 58ca62d

Browse files
committed
fixes
1 parent 77bb715 commit 58ca62d

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

ydb/core/mind/hive/hive_impl.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,12 @@ void THive::DeleteTabletWithoutStorage(TLeaderTabletInfo* tablet, TSideEffects&
176176
}
177177

178178
TInstant THive::GetAllowedBootingTime() {
179-
TDuration passed = LastConnect - StartTime();
180-
i64 connectedNodes = TabletCounters->Simple()[NHive::COUNTER_NODES_CONNECTED].Get();
179+
auto connectedNodes = TabletCounters->Simple()[NHive::COUNTER_NODES_CONNECTED].Get();
181180
BLOG_D(connectedNodes << " nodes connected out of " << ExpectedNodes);
182181
if (connectedNodes == 0) {
183182
return {};
184183
}
185-
TDuration avgConnectTime = passed / connectedNodes;
186-
TInstant result = LastConnect + avgConnectTime * std::max<i64>(ExpectedNodes - connectedNodes, 1);
184+
TInstant result = LastConnect + MaxTimeBetweenConnects * std::max<i64>(static_cast<i64>(ExpectedNodes) - static_cast<i64>(connectedNodes), 1);
187185
if (connectedNodes < ExpectedNodes) {
188186
result = std::max(result, StartTime() + GetMaxWarmUpPeriod());
189187
}

ydb/core/mind/hive/hive_impl.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,9 @@ class THive : public TActor<THive>, public TTabletExecutedFlat, public THiveShar
363363
bool ProcessBootQueuePostponed = false;
364364
TInstant LastConnect;
365365
TInstant ProcessBootQueuePostponedUntil;
366+
TDuration MaxTimeBetweenConnects;
366367
bool WarmUp;
367-
i64 ExpectedNodes;
368+
ui64 ExpectedNodes;
368369

369370
THashMap<ui32, TEvInterconnect::TNodeInfo> NodesInfo;
370371
TTabletCountersBase* TabletCounters;

ydb/core/mind/hive/monitoring.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1869,7 +1869,7 @@ function fillDataShort(result) {
18691869
if ("TotalTablets" in result) {
18701870
var percent = Math.floor(result.RunningTablets * 100 / result.TotalTablets) + '%';
18711871
var values = result.RunningTablets + ' of ' + result.TotalTablets;
1872-
var warmup = result.Warmup ? "<span class='glyphicon glyphicon-fire' style='color:red; margin-right:4px'></span>" : "";
1872+
var warmup = result.WarmUp ? "<span class='glyphicon glyphicon-fire' style='color:red; margin-right:4px'></span>" : "";
18731873
$('#runningTablets').html(warmup + percent + ' (' + values + ')');
18741874
$('#aliveNodes').html(result.AliveNodes);
18751875
$('#bootQueue').html(result.BootQueueSize);

ydb/core/mind/hive/tx__status.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ class TTxStatus : public TTransactionBase<THive> {
3333
}
3434
if (Self->WarmUp &&
3535
node.Statistics.RestartTimestampSize() < Self->GetNodeRestartsToIgnoreInWarmup()) {
36-
Self->LastConnect = TActivationContext::Now();
36+
TInstant now = TActivationContext::Now();
37+
if (Self->LastConnect != TInstant{}) {
38+
Self->MaxTimeBetweenConnects = std::max(Self->MaxTimeBetweenConnects, now - Self->LastConnect);
39+
}
40+
Self->LastConnect = now;
3741
}
3842
if (node.LocationAcquired) {
3943
NIceDb::TNiceDb db(txc.DB);

0 commit comments

Comments
 (0)