@@ -836,13 +836,17 @@ void TPersQueue::ReadTxInfo(const NKikimrClient::TKeyValueResponse::TReadResult&
836
836
return ;
837
837
}
838
838
839
- LOG_DEBUG_S (ctx, NKikimrServices::PERSQUEUE, " Tablet " << TabletID () << " LastStep " << LastStep << " LastTxId " << LastTxId);
839
+ PQ_LOG_D (" PlanStep " << PlanStep << " , PlanTxId " << PlanTxId <<
840
+ " , ExecStep " << ExecStep << " , ExecTxId " << ExecTxId);
840
841
}
841
842
842
843
void TPersQueue::InitPlanStep (const NKikimrPQ::TTabletTxInfo& info)
843
844
{
844
- LastStep = info.GetLastStep ();
845
- LastTxId = info.GetLastTxId ();
845
+ PlanStep = info.GetPlanStep ();
846
+ PlanTxId = info.GetPlanTxId ();
847
+
848
+ ExecStep = info.GetExecStep ();
849
+ ExecTxId = info.GetExecTxId ();
846
850
}
847
851
848
852
void TPersQueue::ReadTxWrites (const NKikimrClient::TKeyValueResponse::TReadResult& read,
@@ -3582,7 +3586,7 @@ void TPersQueue::ProcessPlanStepQueue(const TActorContext& ctx)
3582
3586
txAcks[ActorIdFromProto (tx.GetAckTo ())].push_back (tx.GetTxId ());
3583
3587
}
3584
3588
3585
- if (step >= LastStep ) {
3589
+ if (step >= PlanStep ) {
3586
3590
ui64 lastPlannedTxId = 0 ;
3587
3591
3588
3592
for (ui64 txId : txIds) {
@@ -3617,13 +3621,15 @@ void TPersQueue::ProcessPlanStepQueue(const TActorContext& ctx)
3617
3621
lastPlannedTxId = txId;
3618
3622
}
3619
3623
3620
- LastStep = step;
3621
- LastTxId = lastPlannedTxId;
3624
+ PlanStep = step;
3625
+ PlanTxId = lastPlannedTxId;
3626
+
3627
+ PQ_LOG_D (" PlanStep " << PlanStep << " , PlanTxId " << PlanTxId);
3622
3628
} else {
3623
3629
LOG_ERROR_S (ctx, NKikimrServices::PERSQUEUE,
3624
3630
" Tablet " << TabletID () <<
3625
3631
" Old plan step " << step <<
3626
- " , LastStep : " << LastStep );
3632
+ " , PlanStep : " << PlanStep );
3627
3633
}
3628
3634
3629
3635
SchedulePlanStepAck (step, txAcks);
@@ -3699,8 +3705,11 @@ void TPersQueue::AddCmdWriteTabletTxInfo(NKikimrClient::TKeyValueRequest& reques
3699
3705
3700
3706
void TPersQueue::SavePlanStep (NKikimrPQ::TTabletTxInfo& info)
3701
3707
{
3702
- info.SetLastStep (LastStep);
3703
- info.SetLastTxId (LastTxId);
3708
+ info.SetPlanStep (PlanStep);
3709
+ info.SetPlanTxId (PlanTxId);
3710
+
3711
+ info.SetExecStep (ExecStep);
3712
+ info.SetExecTxId (ExecTxId);
3704
3713
}
3705
3714
3706
3715
void TPersQueue::SaveTxWrites (NKikimrPQ::TTabletTxInfo& info)
@@ -4032,6 +4041,9 @@ void TPersQueue::CheckTxState(const TActorContext& ctx,
4032
4041
" , (!TxQueue.empty())=" << !TxQueue.empty ());
4033
4042
4034
4043
if (!TxQueue.empty () && (TxQueue.front ().second == tx.TxId )) {
4044
+ std::tie (ExecStep, ExecTxId) = TxQueue.front ();
4045
+ PQ_LOG_D (" ExecStep " << ExecStep << " , ExecTxId " << ExecTxId);
4046
+
4035
4047
switch (tx.Kind ) {
4036
4048
case NKikimrPQ::TTransaction::KIND_DATA:
4037
4049
SendEvTxCalcPredicateToPartitions (ctx, tx);
@@ -4111,8 +4123,6 @@ void TPersQueue::CheckTxState(const TActorContext& ctx,
4111
4123
" , tx.HaveParticipantsDecision()=" << tx.HaveParticipantsDecision ());
4112
4124
4113
4125
if (tx.HaveParticipantsDecision ()) {
4114
- SendEvProposeTransactionResult (ctx, tx);
4115
-
4116
4126
if (tx.GetDecision () == NKikimrTx::TReadSetData::DECISION_COMMIT) {
4117
4127
SendEvTxCommitToPartitions (ctx, tx);
4118
4128
} else {
@@ -4136,6 +4146,8 @@ void TPersQueue::CheckTxState(const TActorContext& ctx,
4136
4146
Y_ABORT_UNLESS (!TxQueue.empty ());
4137
4147
Y_ABORT_UNLESS (TxQueue.front ().second == tx.TxId );
4138
4148
4149
+ SendEvProposeTransactionResult (ctx, tx);
4150
+
4139
4151
switch (tx.Kind ) {
4140
4152
case NKikimrPQ::TTransaction::KIND_DATA:
4141
4153
SendEvReadSetAckToSenders (ctx, tx);
@@ -4380,7 +4392,7 @@ void TPersQueue::InitTransactions(const NKikimrClient::TKeyValueResponse::TReadR
4380
4392
Txs.emplace (tx.GetTxId (), tx);
4381
4393
4382
4394
if (tx.HasStep ()) {
4383
- if (std::make_pair (tx.GetStep (), tx.GetTxId ()) >= std::make_pair (LastStep, LastTxId )) {
4395
+ if (std::make_pair (tx.GetStep (), tx.GetTxId ()) >= std::make_pair (ExecStep, ExecTxId )) {
4384
4396
plannedTxs.emplace_back (tx.GetStep (), tx.GetTxId ());
4385
4397
}
4386
4398
}
@@ -4420,7 +4432,7 @@ void TPersQueue::OnInitComplete(const TActorContext& ctx)
4420
4432
4421
4433
ui64 TPersQueue::GetAllowedStep () const
4422
4434
{
4423
- return Max (LastStep + 1 ,
4435
+ return Max (PlanStep + 1 ,
4424
4436
MediatorTimeCastEntry ? MediatorTimeCastEntry->Get (TabletID ()) : TAppData::TimeProvider->Now ().MilliSeconds ());
4425
4437
}
4426
4438
0 commit comments