mariadb/mysql-test/suite
Kristian Nielsen c47fe0e9db MDEV-7668: Intermediate master groups CREATE TEMPORARY with INSERT, causing parallel replication failure
[This commit cherry-picked to be able to merge MDEV-7936, of which it
is a pre-requisite, into both 10.0 and 10.1.]

Parallel replication depends on locking (table locks, row locks, etc.) to
prevent two conflicting transactions from running and committing in parallel.
But temporary tables are designed to be visible only to one thread, and have
no such locking.

In the concrete issue, an intermediate master could commit a CREATE TEMPORARY
TABLE in the same group commit as in INSERT into that table. Thus, a
lower-level master could attempt to run them in parallel and get an error.

More generally, we need protection from parallel replication trying to run
transactions in parallel that access a common temporary table.

This patch simply causes use of a temporary table from parallel replication
to wait for all previous transactions to commit, serialising the replication
at that point.

(A more fine-grained locking could be added later, possibly. However,
using temporary tables in statement-based replication is in any case
normally undesirable; for example a restart of the server will lose
temporary tables and can break replication).

Note that row-based replication is not affected, as it does not do any
temporary tables on the slave-side.

This patch also cleans up the locking around protecting the list of
temporary tables in Relay_log_info. This used to take the
rli->data_lock at the end of every statement, which is very bad for
concurrency. With this patch, the lock is not taken unless temporary
tables (with statement-based binlogging) are in use on the slave.
2015-04-13 14:08:57 +02:00
..
archive 5.5.39 merge 2014-08-07 18:06:56 +02:00
binlog Merge branch '5.5' into 10.0 2015-02-18 15:16:27 +01:00
csv
engines Run engines tests for MyISAM and in-built InnoDB 2014-12-05 14:23:24 +04:00
federated
funcs_1 MDEV-6528 review debian patches for mysql 2014-10-02 11:58:24 +02:00
funcs_2
handler
heap 5.5.40+ merge 2014-10-09 10:30:11 +02:00
innodb MDEV-7910: innodb.binlog_consistent fails sporadically in buildbot 2015-04-08 15:08:53 +02:00
innodb_fts MDEV-6047: Make exists_to_in optimization ON by default 2014-06-09 13:42:21 +03:00
innodb_zip
jp
large_tests
manual
maria 5.5 merge 2015-01-21 12:03:02 +01:00
mtr/t
mtr2
multi_source MDEV-7037: MariaDB 10.0 does not build on Debian / kfreebsd-i386/amd64 due to MTR failure: multi_source.gtid 2014-11-27 09:34:41 +01:00
optimizer_unfixed_bugs MDEV-4447 MariaDB sources should have unix-style line endings everywhere 2014-02-27 12:00:16 +01:00
parts 5.5 merge 2014-05-09 12:35:11 +02:00
percona
perfschema P_S 5.6.22 2015-01-21 14:53:40 +01:00
perfschema_stress perfschema 5.6.10 initial commit. 2014-05-06 23:20:50 +02:00
plugins Merge branch '5.5' into 10.0 2015-02-18 15:16:27 +01:00
roles MDEV-6401 SET ROLE returning ERROR 1959 Invalid role specification for valid role 2014-06-27 09:32:55 +02:00
rpl MDEV-7668: Intermediate master groups CREATE TEMPORARY with INSERT, causing parallel replication failure 2015-04-13 14:08:57 +02:00
storage_engine 5.5 merge 2014-11-19 17:23:39 +01:00
stress
sys_vars 5.5 merge 2015-01-21 12:03:02 +01:00
unit
vcol 5.5 merge 2014-11-19 17:23:39 +01:00