Skip to content

Commit

Permalink
fix(server): Fix multi tx cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
  • Loading branch information
dranikpg committed Jan 24, 2023
1 parent 2069280 commit 31e9cf0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/server/transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1103,15 +1103,15 @@ void Transaction::UnlockMultiShardCb(const std::vector<KeyList>& sharded_keys, E

// It does not have to be that all shards in multi transaction execute this tx.
// Hence it could stay in the tx queue. We perform the necessary cleanup and remove it from
// there.
// there. The transaction is not guaranteed to be at front.
if (sd.pq_pos != TxQueue::kEnd) {
DVLOG(1) << "unlockmulti: TxPopFront " << DebugId();
DVLOG(1) << "unlockmulti: TxRemove " << DebugId();

TxQueue* txq = shard->txq();
DCHECK(!txq->Empty());
Transaction* trans = absl::get<Transaction*>(txq->Front());
DCHECK(trans == this) << "Front: " << trans->DebugId();
txq->PopFront();
DCHECK_EQ(absl::get<Transaction*>(txq->At(sd.pq_pos)), this);

txq->Remove(sd.pq_pos);
sd.pq_pos = TxQueue::kEnd;
}

Expand Down

0 comments on commit 31e9cf0

Please sign in to comment.