summaryrefslogtreecommitdiff
path: root/sql/service_wsrep.cc
diff options
context:
space:
mode:
authorsjaakola <seppo.jaakola@iki.fi>2021-12-09 18:12:20 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2021-12-17 09:38:23 +0200
commitc1846c4fcfb04cb628c73b95516deefeb8ee0e19 (patch)
tree80e1f43a6e7becd22cc28b43b3ac6d603c9bf630 /sql/service_wsrep.cc
parent20f22dfa2f2d5bb5a1511d42a5bb18fbf469e812 (diff)
downloadmariadb-git-c1846c4fcfb04cb628c73b95516deefeb8ee0e19.tar.gz
MDEV-26803 PA unsafety with FK cascade delete operation
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 <jan.lindstrom@mariadb.com>
Diffstat (limited to 'sql/service_wsrep.cc')
-rw-r--r--sql/service_wsrep.cc8
1 files changed, 8 insertions, 0 deletions
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");
+ }
+}