summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2014-03-21 13:30:55 +0100
committerunknown <knielsen@knielsen-hq.org>2014-03-21 13:30:55 +0100
commitb35296911886143267ea471530e701169e5f7f56 (patch)
treec5a824c6e873a0ce46a0058aed3d00fbdbebf3d4 /sql/sql_class.cc
parenta5418c5540f06e2ec4016734e9f1cc5c50c01de0 (diff)
downloadmariadb-git-b35296911886143267ea471530e701169e5f7f56.tar.gz
MDEV-5914: Parallel replication deadlock due to InnoDB lock conflicts
Due to how gap locks work, two transactions could group commit together on the master, but get lock conflicts and then deadlock due to different thread scheduling order on slave. For now, remove these deadlocks by running the parallel slave in READ COMMITTED mode. And let InnoDB/XtraDB allow statement-based binlogging for the parallel slave in READ COMMITTED. We are also investigating a different solution long-term, which is based on relaxing the gap locks only between the transactions running in parallel for one slave, but not against possibly external transactions.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 8a4a7006c63..e85a7d74851 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -4234,6 +4234,12 @@ extern "C" int thd_slave_thread(const MYSQL_THD thd)
return(thd->slave_thread);
}
+/* Returns true for a worker thread in parallel replication. */
+extern "C" int thd_rpl_is_parallel(const MYSQL_THD thd)
+{
+ return thd->rgi_slave && thd->rgi_slave->is_parallel_exec;
+}
+
extern "C" int thd_non_transactional_update(const MYSQL_THD thd)
{
return(thd->transaction.all.modified_non_trans_table);