diff options
author | Vasily Gerasimov <[email protected]> | 2022-03-05 19:04:44 +0300 |
---|---|---|
committer | Vasily Gerasimov <[email protected]> | 2022-03-05 19:04:44 +0300 |
commit | acf9fa8d5bc00b992d0bbe680cae7af40b173e08 (patch) | |
tree | d27d9882a8eb496cd67a501d72ba798499ac3a79 | |
parent | 5ac911f5d4d9401b561199d9114e70c47de952f1 (diff) |
YQ-934 Fix checkpoint coordinator crash
Fix checkpoint coordinator crash
ref:5901c73c4831c47e99558edd729866d3ea46035f
-rw-r--r-- | ydb/core/yq/libs/checkpointing/checkpoint_coordinator.cpp | 11 | ||||
-rw-r--r-- | ydb/core/yq/libs/checkpointing/pending_checkpoint.h | 3 |
2 files changed, 9 insertions, 5 deletions
diff --git a/ydb/core/yq/libs/checkpointing/checkpoint_coordinator.cpp b/ydb/core/yq/libs/checkpointing/checkpoint_coordinator.cpp index 2df1b6ec33f..beb8669ecfe 100644 --- a/ydb/core/yq/libs/checkpointing/checkpoint_coordinator.cpp +++ b/ydb/core/yq/libs/checkpointing/checkpoint_coordinator.cpp @@ -150,12 +150,13 @@ void TCheckpointCoordinator::Handle(const NYql::NDq::TEvDqCompute::TEvNewCheckpo return; } - Y_VERIFY(PendingInit); - PendingInit->OnNewCheckpointCoordinatorAck(); + if (PendingInit) { + PendingInit->OnNewCheckpointCoordinatorAck(); - if (PendingInit->CanInjectCheckpoint()) { - auto checkpointId = *PendingInit->CheckpointId; - InjectCheckpoint(checkpointId); + if (PendingInit->CanInjectCheckpoint()) { + auto checkpointId = *PendingInit->CheckpointId; + InjectCheckpoint(checkpointId); + } } } diff --git a/ydb/core/yq/libs/checkpointing/pending_checkpoint.h b/ydb/core/yq/libs/checkpointing/pending_checkpoint.h index bc42b48018b..6f888ad5e29 100644 --- a/ydb/core/yq/libs/checkpointing/pending_checkpoint.h +++ b/ydb/core/yq/libs/checkpointing/pending_checkpoint.h @@ -51,6 +51,9 @@ private: THashSet<NActors::TActorId> NotYetAcknowledged; }; +// Class for storing all variables that are needed to make coordinator know +// when it can inject zero checkpoint after its initialization process. +// If there is no need to inject zero checkpoint this struct can be freed. class TPendingInitCoordinator { public: explicit TPendingInitCoordinator(size_t actorsCount) |