fix(server): Change WaitForCallbacks mem order (#914)

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This commit is contained in:
Vladislav 2023-03-06 17:51:48 +03:00 committed by GitHub
parent 1fc7ef5eaa
commit 64e10f083e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -397,9 +397,7 @@ class Transaction {
void WaitForShardCallbacks() {
run_ec_.await([this] { return 0 == run_count_.load(std::memory_order_relaxed); });
// store operations below can not be ordered above the fence
std::atomic_thread_fence(std::memory_order_release);
seqlock_.fetch_add(1, std::memory_order_relaxed);
seqlock_.fetch_add(1, std::memory_order_acq_rel);
}
// Log command in shard's journal, if this is a write command with auto-journaling enabled.