Skip to content

Commit

Permalink
improve kick
Browse files Browse the repository at this point in the history
  • Loading branch information
vporyadke committed Jun 25, 2024
1 parent 3024b8c commit 1ae8810
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ydb/core/mind/hive/hive_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,19 @@ void THive::Handle(TEvPrivate::TEvKickTablet::TPtr &ev) {
}

BLOG_D("THive::Handle::TEvKickTablet TabletId=" << tabletId);
Execute(CreateRestartTablet(tabletId));
TBestNodeResult result = FindBestNode(*tablet);
if (std::holds_alternative<TTooManyTabletsStarting>(result)) {
if (tablet->Node == nullptr || !tablet->Node->IsAllowedToRunTablet(*tablet)) {
Execute(CreateRestartTablet(tabletId));
}
} else if (std::holds_alternative<TNodeInfo*>(result)) {
TNodeInfo* node = std::get<TNodeInfo*>(result);
if (node != tablet->Node && IsTabletMoveExpedient(*tablet, *node)) {
Execute(CreateRestartTablet(tabletId));
}
} else {
Execute(CreateRestartTablet(tabletId));
}
}

void THive::Handle(TEvHive::TEvInitiateBlockStorage::TPtr& ev) {
Expand Down

0 comments on commit 1ae8810

Please sign in to comment.