From 5f66b76b4f0dc8efb67d1d72a2fa3ed4d63351dc Mon Sep 17 00:00:00 2001 From: Roman Gershman Date: Tue, 19 Nov 2024 23:26:04 +0200 Subject: [PATCH] fix: test_replication_all failure Fixes #4150. The failure can be reproduced with high probability on ARM via `pytest dragonfly/replication_test.py -k test_replication_all[df_factory0-mode0-8-t_replicas3-seeder_config3-2000-False]` Not sure why this barrier is needed but #4146 removes the barrier which breaks a gentle balance in the code in unexpected way. Signed-off-by: Roman Gershman --- src/server/journal/executor.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/journal/executor.cc b/src/server/journal/executor.cc index f8c85e8eb7f8..bc43095c0c6d 100644 --- a/src/server/journal/executor.cc +++ b/src/server/journal/executor.cc @@ -83,6 +83,11 @@ void JournalExecutor::SelectDb(DbIndex dbid) { auto cmd = BuildFromParts("SELECT", dbid); Execute(cmd); ensured_dbs_[dbid] = true; + + // TODO: This is a temporary fix for #4146. + // For some reason without this the replication breaks in regtests. + auto cb = [](EngineShard* shard) { return OpStatus::OK; }; + shard_set->RunBriefInParallel(std::move(cb)); } else { conn_context_.conn_state.db_index = dbid; }