mariadb/mysql-test/suite/rpl
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
..
extension Change a couple of permissions that cause lintian warnings in .deb packaging and don't really hurt to fix. 2014-08-13 15:46:39 +02:00
include MDEV-6926: innodb_rows_updated is misleading on slav 2014-10-26 07:22:51 +02:00
r MDEV-7668: Intermediate master groups CREATE TEMPORARY with INSERT, causing parallel replication failure 2015-04-13 14:08:57 +02:00
t MDEV-7668: Intermediate master groups CREATE TEMPORARY with INSERT, causing parallel replication failure 2015-04-13 14:08:57 +02:00
disabled.def Bug#17638477 UNINSTALL AND INSTALL SEMI-SYNC PLUGIN CAUSES SLAVES TO BREAK 2014-08-03 12:45:14 +02:00
my.cnf
README
rpl_1slave_base.cnf merge with 5.3 2011-10-19 21:45:18 +02:00

How to run.
===========

./mysql-test-run.pl --suite=rpl --mysqld=--binlog-format=mixed