Skip to content

Commit d062db6

Browse files
committed
fix(transaction): Fix schedule queues
1 parent 287f066 commit d062db6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/server/transaction.cc

+2-6
Original file line numberDiff line numberDiff line change
@@ -759,11 +759,7 @@ void Transaction::ScheduleInternal() {
759759

760760
ScheduleContext schedule_ctx{this, optimistic_exec};
761761

762-
// TODO: this optimization is disabled due to a issue #4648 revealing this code can
763-
// lead to transaction not being scheduled.
764-
// To reproduce the bug remove the false in the condition and run
765-
// ./list_family_test --gtest_filter=*AwakeMulti on alpine machine
766-
if (false && unique_shard_cnt_ == 1) {
762+
if (unique_shard_cnt_ == 1) {
767763
// Single shard optimization. Note: we could apply the same optimization
768764
// to multi-shard transactions as well by creating a vector of ScheduleContext.
769765
schedule_queues[unique_shard_id_].queue.Push(&schedule_ctx);
@@ -1212,7 +1208,7 @@ void Transaction::ScheduleBatchInShard() {
12121208
// We do this to avoid the situation where we have a data race, where
12131209
// a transaction is added to the queue, we've checked that sq.armed is true and skipped
12141210
// adding the callback that fetches the transaction.
1215-
sq.armed.store(false, memory_order_release);
1211+
sq.armed.exchange(false, memory_order_acq_rel);
12161212
}
12171213
}
12181214

0 commit comments

Comments
 (0)