diff options
author | Alexey Efimov <xeno@prnwatch.com> | 2022-02-25 14:49:13 +0300 |
---|---|---|
committer | Alexey Efimov <xeno@prnwatch.com> | 2022-02-25 14:49:13 +0300 |
commit | 113f44b28701713a329a881ee5c3d404212cf375 (patch) | |
tree | d72312675bdfb0051f23f1398c176f9d924d0558 | |
parent | d620560edb76b61bf20a577af99d2780608aa28d (diff) | |
download | ydb-113f44b28701713a329a881ee5c3d404212cf375.tar.gz |
fix fail of follower promotion KIKIMR-14429
ref:c1b606a3f94bed893da279d7a6d7698d64e1da8d
-rw-r--r-- | ydb/core/mind/local.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ydb/core/mind/local.cpp b/ydb/core/mind/local.cpp index 09fc15f76dd..67616691246 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()); |