mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-31792 Assertion fails in MDL_context::acquire_lock upon parallel replication of CREATE SEQUENCE
The assert's reason was in missed FL_DDL flagging of CREATE-or-REPLACE Query event. MDEV-27365 fixes covered only the non-pre-existing table execution branch so did not see a possibility of implicit commit in the middle of execution in a rollback branch when the being CREATEd sequence table is actually replaced. The pre-existing table branch cleared the DDL modification flag so the query lost FL_DDL in binlog and its parallel execution on slave may have ended up with the assert to indicate the query is raced by a following in binlog order event. Fixed with applying the MDEV-27365 pattern. An mtr test is added to cover the rollback situation. The description test [ pass ] with a generous number of mtr parallel reties.
This commit is contained in:
@ -82,6 +82,37 @@ SELECT @@global.gtid_binlog_state, @@global.gtid_slave_pos as "all through 101 h
|
||||
@@global.gtid_binlog_state all through 101 have been committed
|
||||
0-1-101 0-1-101
|
||||
connection slave;
|
||||
flush tables with read lock;
|
||||
connection master;
|
||||
CREATE OR REPLACE SEQUENCE s3 ENGINE=innodb;
|
||||
SELECT NEXT VALUE FOR s3 into @tmpvar;
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
unlock tables;
|
||||
include/sync_with_master_gtid.inc
|
||||
connection slave;
|
||||
flush tables with read lock;
|
||||
connection master;
|
||||
CREATE OR REPLACE SEQUENCE s3 ENGINE=innodb;
|
||||
SELECT NEXT VALUE FOR s3 into @tmpvar;
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
unlock tables;
|
||||
include/sync_with_master_gtid.inc
|
||||
connection slave;
|
||||
BEGIN /* slave local Trx */;
|
||||
select count(*) from s3;
|
||||
count(*)
|
||||
1
|
||||
connection master;
|
||||
CREATE OR REPLACE SEQUENCE s3 ENGINE=innodb;
|
||||
SELECT NEXT VALUE FOR s3 into @tmpvar;
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
connection slave;
|
||||
rollback /* Trx */;
|
||||
include/sync_with_master_gtid.inc
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET debug_sync = RESET;
|
||||
SET @@global.slave_parallel_threads= 0;
|
||||
@ -90,7 +121,7 @@ SET @@global.debug_dbug = "";
|
||||
SET @@global.gtid_strict_mode=0;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
DROP SEQUENCE s2;
|
||||
DROP SEQUENCE s2,s3;
|
||||
DROP TABLE ti;
|
||||
connection slave;
|
||||
include/rpl_end.inc
|
||||
|
Reference in New Issue
Block a user