mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 02:15:45 +02:00
fix(transaction): Replace with armed sync point (#2708)
1. Replaces run_barrier as a synchronization point with is_armed + an embedded blocking counter for awaiting running jobs 2. Replaces IsArmedInShard + GetLocalMask + is_armed.exchange chain with a single DisarmInShard() / DisarmInShardWhen Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This commit is contained in:
parent
7e0536fd4c
commit
9c6e6a96b7
6 changed files with 103 additions and 128 deletions
|
@ -123,7 +123,7 @@ void BlockingController::FinalizeWatched(ArgSlice args, Transaction* tx) {
|
|||
VLOG(1) << "FinalizeBlocking [" << owner_->shard_id() << "]" << tx->DebugId();
|
||||
|
||||
bool removed = awakened_transactions_.erase(tx);
|
||||
DCHECK(!removed || (tx->GetLocalMask(owner_->shard_id()) & Transaction::AWAKED_Q));
|
||||
DCHECK(!removed || (tx->DEBUG_GetLocalMask(owner_->shard_id()) & Transaction::AWAKED_Q));
|
||||
|
||||
auto dbit = watched_dbs_.find(tx->GetDbIndex());
|
||||
|
||||
|
@ -138,7 +138,7 @@ void BlockingController::FinalizeWatched(ArgSlice args, Transaction* tx) {
|
|||
for (string_view key : args) {
|
||||
bool removed_awakened = wt.UnwatchTx(key, tx);
|
||||
CHECK(!removed_awakened || removed)
|
||||
<< tx->DebugId() << " " << key << " " << tx->GetLocalMask(owner_->shard_id());
|
||||
<< tx->DebugId() << " " << key << " " << tx->DEBUG_GetLocalMask(owner_->shard_id());
|
||||
}
|
||||
|
||||
if (wt.queue_map.empty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue