summaryrefslogtreecommitdiff
path: root/include/mysql
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 /include/mysql
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 'include/mysql')
-rw-r--r--include/mysql/service_wsrep.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mysql/service_wsrep.h b/include/mysql/service_wsrep.h
index 10c70c790e9..1e6aaa1b9b9 100644
--- a/include/mysql/service_wsrep.h
+++ b/include/mysql/service_wsrep.h
@@ -88,6 +88,7 @@ extern struct wsrep_service_st {
unsigned long long trx_id);
void (*wsrep_thd_kill_LOCK_func)(const MYSQL_THD thd);
void (*wsrep_thd_kill_UNLOCK_func)(const MYSQL_THD thd);
+ void (*wsrep_thd_set_wsrep_PA_unsafe_func)(MYSQL_THD thd);
} *wsrep_service;
#define MYSQL_SERVICE_WSREP_INCLUDED
@@ -131,6 +132,7 @@ extern struct wsrep_service_st {
#define wsrep_thd_is_applying(T) wsrep_service->wsrep_thd_is_applying_func(T)
#define wsrep_thd_set_wsrep_aborter(T) wsrep_service->wsrep_thd_set_wsrep_aborter_func(T1, T2)
#define wsrep_report_bf_lock_wait(T,I) wsrep_service->wsrep_report_bf_lock_wait(T,I)
+#define wsrep_thd_set_PA_unsafe(T) wsrep_service->wsrep_thd_set_PA_unsafe_func(T)
#else
#define MYSQL_SERVICE_WSREP_STATIC_INCLUDED
@@ -229,5 +231,7 @@ extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd);
extern "C" bool wsrep_thd_set_wsrep_aborter(MYSQL_THD bf_thd, MYSQL_THD victim_thd);
extern "C" void wsrep_report_bf_lock_wait(const THD *thd,
unsigned long long trx_id);
+/* declare parallel applying unsafety for the THD */
+extern "C" void wsrep_thd_set_PA_unsafe(MYSQL_THD thd);
#endif
#endif /* MYSQL_SERVICE_WSREP_INCLUDED */