Skip to content

Commit

Permalink
rollback-buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
nikvas0 committed Dec 27, 2024
1 parent a131f66 commit 527525e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ydb/core/kqp/runtime/kqp_write_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1987,9 +1987,7 @@ class TKqpBufferWriteActor :public TActorBootstrapped<TKqpBufferWriteActor>, pub
}

if (!TxManager->NeedCommit()) {
Rollback();
State = EState::FINISHED;
Send<ESendingType::Tail>(ExecuterActorId, new TEvKqpBuffer::TEvResult{});
RollbackAndDie();
} else if (TxManager->IsSingleShard() && !TxManager->HasOlapTable() && (!WriteInfos.empty() || TxManager->HasTopics())) {
TxManager->StartExecute();
ImmediateCommit();
Expand All @@ -2001,9 +1999,14 @@ class TKqpBufferWriteActor :public TActorBootstrapped<TKqpBufferWriteActor>, pub

void Handle(TEvKqpBuffer::TEvRollback::TPtr& ev) {
ExecuterActorId = ev->Get()->ExecuterActorId;
RollbackAndDie();
}

void RollbackAndDie() {
Rollback();
State = EState::FINISHED;
Send<ESendingType::Tail>(ExecuterActorId, new TEvKqpBuffer::TEvResult{});
PassAway();
}

void Handle(NKikimr::NEvents::TDataEvents::TEvWriteResult::TPtr& ev) {
Expand Down Expand Up @@ -2287,6 +2290,7 @@ class TKqpBufferWriteActor :public TActorBootstrapped<TKqpBufferWriteActor>, pub
});
ExecuterActorId = {};
Y_ABORT_UNLESS(GetTotalMemory() == 0);
PassAway();
return;
}
}
Expand Down

0 comments on commit 527525e

Please sign in to comment.