Wrong binlog order on concurrent DROP schema and CREATE function
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
New
|
Low
|
Kristian Nielsen |
Bug Description
Also filed as http://
Concurrent execution of DROP DATABASE and CREATE FUNCTION | PROCEDURE | EVENT causes a wrong order of events in the binary log and, consequently, replication failure.
Provided MTR test case is non-deterministic, so I am also adding an RQG grammar to reproduce.
The problem is that on master CREATE FUNCTION gets executed without an error, but in the binlog DROP DATABASE is written before CREATE FUNCTION.
Reproducible on maria/5.5 revno 3413, mysql-5.5 revno 3737, mysql-trunk revno 3827.
Could not reproduce on maria/5.3, although due to the non-deterministic nature of the test there is no guarantee the problem is not present there.
# MTR test case t1.test
# run as perl ./mtr --mysqld=
--source include/
DROP DATABASE IF EXISTS db1;
CREATE DATABASE db1;
CREATE FUNCTION db1.f1() RETURNS INT RETURN 1;
--send
DROP DATABASE db1;
--connection master1
--error 0,ER_BAD_DB_ERROR
CREATE FUNCTION db1.f2() RETURNS INT RETURN 1;
--connection master
--reap
SHOW BINLOG EVENTS;
--sync_
# End of MTR test case
# Binlog contents:
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-
slave-relay-
slave-relay-
slave-relay-
slave-relay-
slave-relay-
RETURN 1
slave-relay-
slave-relay-
RETURN 1
# RQG grammar t1.yy
query:
CREATE DATABASE IF NOT EXISTS db1; CREATE FUNCTION db1.f1() RETURNS INT RETURN 1; DROP DATABASE db1;
thread1:
CREATE FUNCTION db1.f2() RETURNS INT RETURN 1; DROP FUNCTION db1.f2;
# End of RQG grammar
# RQG command line:
perl runall.pl \
--queries=100M \
--threads=2 \
--duration=600 \
--grammar=t1.yy \
--rpl_mode=mixed \
--basedir1=<your basedir> \
--vardir1=<your vardir>
description: | updated |