mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
fix(bug): access invalid prime table iterator (#2300)
The bug: When running dragonfly in cache mode we bump up items on dash table when we find them. If we access few items on the callback that reside next to each other we will invalidate the first found iterator. The fix: After we bump up entry we insert the prime table ref to bump set. When checking if we can bump down an item we check the item is not in this set. Once we finish running the transaction callback we clear the set. Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
parent
6c32c8004d
commit
6398a73942
6 changed files with 74 additions and 16 deletions
|
@ -497,6 +497,7 @@ bool Transaction::RunInShard(EngineShard* shard, bool txq_ooo) {
|
|||
if (is_concluding) // Check last hop
|
||||
LogAutoJournalOnShard(shard);
|
||||
|
||||
shard->db_slice().OnCbFinish();
|
||||
// at least the coordinator thread owns the reference.
|
||||
DCHECK_GE(GetUseCount(), 1u);
|
||||
|
||||
|
@ -950,7 +951,7 @@ void Transaction::RunQuickie(EngineShard* shard) {
|
|||
} catch (std::exception& e) {
|
||||
LOG(FATAL) << "Unexpected exception " << e.what();
|
||||
}
|
||||
|
||||
shard->db_slice().OnCbFinish();
|
||||
LogAutoJournalOnShard(shard);
|
||||
|
||||
sd.is_armed.store(false, memory_order_relaxed);
|
||||
|
@ -1238,6 +1239,7 @@ OpStatus Transaction::RunSquashedMultiCb(RunnableType cb) {
|
|||
DCHECK_EQ(unique_shard_cnt_, 1u);
|
||||
auto* shard = EngineShard::tlocal();
|
||||
auto status = cb(this, shard);
|
||||
shard->db_slice().OnCbFinish();
|
||||
LogAutoJournalOnShard(shard);
|
||||
return status;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue