aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Efimov <xeno@prnwatch.com>2022-02-28 17:07:59 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-28 17:07:59 +0300
commit4531da9beb698966823ea272d1561d5f843d511c (patch)
treea334571687605e5557ee4d3280d56b13a05bf018
parentd552a8fa6623c4e1a0f4d1e10c6165449f63e4b4 (diff)
downloadydb-4531da9beb698966823ea272d1561d5f843d511c.tar.gz
fix fail of follower promotion KIKIMR-14429
REVIEW: 2353684 x-ydb-stable-ref: bec0b8fbcd3c02f44c986a45894bd799e45fa076
-rw-r--r--ydb/core/mind/local.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/ydb/core/mind/local.cpp b/ydb/core/mind/local.cpp
index 09fc15f76d..6761669124 100644
--- a/ydb/core/mind/local.cpp
+++ b/ydb/core/mind/local.cpp
@@ -439,6 +439,15 @@ class TLocalNodeRegistrar : public TActorBootstrapped<TLocalNodeRegistrar> {
}
}
+ if (record.GetBootMode() == NKikimrLocal::EBootMode::BOOT_MODE_LEADER && tabletId.second != 0) {
+ LOG_WARN_S(ctx, NKikimrServices::LOCAL,
+ "TLocalNodeRegistrar: unsuccessful attempt to promote follower "
+ << "tabletId: " << tabletId << " suggestedGen: " << suggestedGen);
+ tabletId.second = 0; // we change tabletid to leader because it was unsuccessful attempt to boot leader, not a follower
+ ctx.Send(ev->Sender, new TEvLocal::TEvTabletStatus(TEvLocal::TEvTabletStatus::StatusFailed, tabletId, suggestedGen));
+ return;
+ }
+
TTabletEntry &entry = InbootTablets[tabletId];
if (entry.Tablet && entry.Generation != suggestedGen) {
ctx.Send(entry.Tablet, new TEvents::TEvPoisonPill());