diff --git a/ydb/core/health_check/health_check.cpp b/ydb/core/health_check/health_check.cpp index 35134daebd03..15e0c4ded08d 100644 --- a/ydb/core/health_check/health_check.cpp +++ b/ydb/core/health_check/health_check.cpp @@ -191,7 +191,7 @@ class TSelfCheckRequest : public TActorBootstrapped { && info.has_lastalivetimestamp() && (info.lastalivetimestamp() != 0 && TInstant::MilliSeconds(info.lastalivetimestamp()) < settings.AliveBarrier) && info.tabletbootmode() == NKikimrHive::TABLET_BOOT_MODE_DEFAULT - && (info.generation() > 0 || info.volatilestate() != NKikimrHive::TABLET_VOLATILE_STATE_BOOTING)) { + && (info.generation() > 0 || info.volatilestate() != NKikimrHive::TABLET_VOLATILE_STATE_BOOTING || info.inwaitqueue())) { State = ETabletState::Dead; } else if (info.restartsperperiod() >= settings.MaxRestartsPerPeriod) { State = ETabletState::RestartsTooOften; diff --git a/ydb/core/mind/hive/hive_impl.cpp b/ydb/core/mind/hive/hive_impl.cpp index 0fd9e799aa34..f8322e255956 100644 --- a/ydb/core/mind/hive/hive_impl.cpp +++ b/ydb/core/mind/hive/hive_impl.cpp @@ -237,6 +237,7 @@ void THive::ExecuteProcessBootQueue(NIceDb::TNiceDb&, TSideEffects& sideEffects) if (tablet == nullptr) { continue; } + tablet->InWaitQueue = false; if (tablet->IsAlive()) { BLOG_D("tablet " << record.TabletId << " already alive, skipping"); continue; @@ -258,7 +259,7 @@ void THive::ExecuteProcessBootQueue(NIceDb::TNiceDb&, TSideEffects& sideEffects) } tablet->ActorsToNotifyOnRestart.clear(); BootQueue.AddToWaitQueue(record); // waiting for new node - tablet->ChangeVolatileState(TTabletInfo::EVolatileState::TABLET_VOLATILE_STATE_WAITING); + tablet->InWaitQueue = true; continue; } } @@ -1879,6 +1880,9 @@ void THive::FillTabletInfo(NKikimrHive::TEvResponseHiveInfo& response, ui64 tabl if (req.GetReturnMetrics()) { tabletInfo.MutableMetrics()->CopyFrom(info->GetResourceValues()); } + if (info->InWaitQueue) { + tabletInfo.SetInWaitQueue(true); + } if (req.GetReturnChannelHistory()) { for (const auto& channel : info->TabletStorageInfo->Channels) { auto& tabletChannel = *tabletInfo.AddTabletChannels(); diff --git a/ydb/core/mind/hive/tablet_info.cpp b/ydb/core/mind/hive/tablet_info.cpp index a5ebd0ed87e4..b0047634e440 100644 --- a/ydb/core/mind/hive/tablet_info.cpp +++ b/ydb/core/mind/hive/tablet_info.cpp @@ -138,10 +138,7 @@ bool TTabletInfo::IsReadyToStart(TInstant now) const { return false; } } - return NodeId == 0 && - (VolatileState == EVolatileState::TABLET_VOLATILE_STATE_BOOTING - || VolatileState == EVolatileState::TABLET_VOLATILE_STATE_WAITING) && - now >= PostponedStart; + return NodeId == 0 && VolatileState == EVolatileState::TABLET_VOLATILE_STATE_BOOTING && now >= PostponedStart; } bool TTabletInfo::IsStarting() const { diff --git a/ydb/core/mind/hive/tablet_info.h b/ydb/core/mind/hive/tablet_info.h index e80a21336bc8..d620baf710c9 100644 --- a/ydb/core/mind/hive/tablet_info.h +++ b/ydb/core/mind/hive/tablet_info.h @@ -117,7 +117,6 @@ struct TTabletInfo { case EVolatileState::TABLET_VOLATILE_STATE_STARTING: return "Starting"; case EVolatileState::TABLET_VOLATILE_STATE_RUNNING: return "Running"; case EVolatileState::_TABLET_VOLATILE_STATE_BLOCKED: return "Blocked"; - case EVolatileState::TABLET_VOLATILE_STATE_WAITING: return "Waiting"; default: return Sprintf("%d", static_cast(value)); } } @@ -165,6 +164,7 @@ struct TTabletInfo { TNodeId FailedNodeId = 0; // last time we tried to start the tablet, we failed on this node TInstant BootTime; TNodeFilter NodeFilter; + bool InWaitQueue = false; TTabletInfo(ETabletRole role, THive& hive); TTabletInfo(const TTabletInfo&) = delete; diff --git a/ydb/core/protos/hive.proto b/ydb/core/protos/hive.proto index c8d2d869207a..954495792e3e 100644 --- a/ydb/core/protos/hive.proto +++ b/ydb/core/protos/hive.proto @@ -38,7 +38,6 @@ enum ETabletVolatileState { TABLET_VOLATILE_STATE_STARTING = 3; TABLET_VOLATILE_STATE_RUNNING = 4; _TABLET_VOLATILE_STATE_BLOCKED = 5; // deprecated - TABLET_VOLATILE_STATE_WAITING = 6; } enum EMigrationState { @@ -496,6 +495,7 @@ message TTabletInfo { optional uint32 RestartsPerPeriod = 22; optional uint64 LastAliveTimestamp = 23; optional EBalancerPolicy BalancerPolicy = 24; + optional bool InWaitQueue = 25; } message TEvSeizeTabletsReply { diff --git a/ydb/core/viewer/viewer.cpp b/ydb/core/viewer/viewer.cpp index af8ec394af32..b32cc5c0eaad 100644 --- a/ydb/core/viewer/viewer.cpp +++ b/ydb/core/viewer/viewer.cpp @@ -760,7 +760,6 @@ NKikimrViewer::EFlag GetFlagFromTabletState(NKikimrHive::ETabletVolatileState st NKikimrViewer::EFlag flag = NKikimrViewer::EFlag::Grey; switch (state) { case NKikimrHive::ETabletVolatileState::TABLET_VOLATILE_STATE_STOPPED: - case NKikimrHive::ETabletVolatileState::TABLET_VOLATILE_STATE_WAITING: flag = NKikimrViewer::EFlag::Red; break; case NKikimrHive::ETabletVolatileState::TABLET_VOLATILE_STATE_BOOTING: