From c1846c4fcfb04cb628c73b95516deefeb8ee0e19 Mon Sep 17 00:00:00 2001 From: sjaakola Date: Thu, 9 Dec 2021 18:12:20 +0200 Subject: MDEV-26803 PA unsafety with FK cascade delete operation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit has a mtr test where two two transactions delete a row from two separate tables, which will cascade a FK delete for the same row in a third table. Second replica node is configured with 2 applier threads, and the test will fail if these two transactions are applied in parallel. The actual fix, in this commit, is to mark a transaction as unsafe for parallel applying when it traverses into cascade delete operation. Reviewed-by: Jan Lindström --- sql/service_wsrep.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sql/service_wsrep.cc') diff --git a/sql/service_wsrep.cc b/sql/service_wsrep.cc index 18067a4d0ec..fd2a5c301f2 100644 --- a/sql/service_wsrep.cc +++ b/sql/service_wsrep.cc @@ -381,3 +381,11 @@ extern "C" void wsrep_report_bf_lock_wait(const THD *thd, wsrep_thd_query(thd)); } } + +extern "C" void wsrep_thd_set_PA_unsafe(THD *thd) +{ + if (thd && thd->wsrep_cs().mark_transaction_pa_unsafe()) + { + WSREP_DEBUG("session does not have active transaction, can not mark as PA unsafe"); + } +} -- cgit v1.2.1