Skip to content

Commit

Permalink
The PQ tablet crashes after restarting (#9281)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alek5andr-Kotov authored Sep 17, 2024
1 parent 32f54d3 commit 90e3198
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ydb/core/persqueue/pq_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,11 @@ void TPersQueue::ReadConfig(const NKikimrClient::TKeyValueResponse::TReadResult&

PQ_LOG_D("Load tx " << tx.ShortDebugString());

if (tx.GetState() == NKikimrPQ::TTransaction::CALCULATED) {
PQ_LOG_D("fix tx state");
tx.SetState(NKikimrPQ::TTransaction::PLANNED);
}

Txs.emplace(tx.GetTxId(), tx);

if (tx.HasStep()) {
Expand Down Expand Up @@ -4284,10 +4289,6 @@ void TPersQueue::CheckTxState(const TActorContext& ctx,
break;

case NKikimrPQ::TTransaction::CALCULATED:
Y_ABORT_UNLESS(tx.WriteInProgress,
"PQ %" PRIu64 ", TxId %" PRIu64,
TabletID(), tx.TxId);

tx.State = NKikimrPQ::TTransaction::WAIT_RS;
PQ_LOG_D("TxId " << tx.TxId <<
", NewState " << NKikimrPQ::TTransaction_EState_Name(tx.State));
Expand Down

0 comments on commit 90e3198

Please sign in to comment.