summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnaury <[email protected]>2023-08-11 11:40:25 +0300
committersnaury <[email protected]>2023-08-11 12:35:15 +0300
commit4359573464bd608d0dc6e7318e2b35879095b54e (patch)
treeafd57baa1aa180521981c73da9ab83ebe32c9622
parentd42718465c618a3df963a4b49fb8026d3df6adee (diff)
Fix a state detach race on slower coordinator restart KIKIMR-18580
-rw-r--r--ydb/core/tx/coordinator/coordinator_state.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/ydb/core/tx/coordinator/coordinator_state.cpp b/ydb/core/tx/coordinator/coordinator_state.cpp
index a46b43b7107..03590194b87 100644
--- a/ydb/core/tx/coordinator/coordinator_state.cpp
+++ b/ydb/core/tx/coordinator/coordinator_state.cpp
@@ -29,12 +29,14 @@ void TCoordinatorStateActor::ConfirmPersistent() {
void TCoordinatorStateActor::OnTabletDestroyed() {
Y_VERIFY(Owner, "Unexpected OnTabletDestroyed from detached tablet");
+ Y_VERIFY(Owner->CoordinatorStateActor == nullptr, "OnTabletDestroyed called with state actor still attached");
PreserveState();
Owner = nullptr;
}
void TCoordinatorStateActor::OnTabletDead() {
Y_VERIFY(Owner, "Unexpected OnTabletDead from detached tablet");
+ Y_VERIFY(Owner->CoordinatorStateActor == nullptr, "OnTabletDead called with state actor still attached");
PreserveState();
Owner = nullptr;
@@ -93,6 +95,7 @@ void TCoordinatorStateActor::Handle(TEvTxCoordinator::TEvCoordinatorStateRequest
if (Owner) {
// New generation may request state before current tablet dies
+ Owner->DetachStateActor();
OnTabletDead();
}