mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.11 into 11.0
This commit is contained in:
75
mysql-test/suite/rpl/include/create_or_drop_sync_func.inc
Normal file
75
mysql-test/suite/rpl/include/create_or_drop_sync_func.inc
Normal file
@@ -0,0 +1,75 @@
|
||||
# Creates or drops a stored function as a part of debug-sync based
|
||||
# synchronization mechanism between replication servers.
|
||||
#
|
||||
# Parameters:
|
||||
# $create_or_drop= [create]
|
||||
# $server_master = [master]
|
||||
# $server_slave = [slave]
|
||||
if (!$create_or_drop)
|
||||
{
|
||||
--let $create_or_drop=create
|
||||
}
|
||||
|
||||
if (`select strcmp('$create_or_drop', 'create') = 0`)
|
||||
{
|
||||
if (!$server_master)
|
||||
{
|
||||
--let $server_master=master
|
||||
}
|
||||
if (!$server_slave)
|
||||
{
|
||||
--let $server_slave=slave
|
||||
}
|
||||
|
||||
--connection $server_master
|
||||
# Use a stored function to inject a debug_sync into the appropriate THD.
|
||||
# The function does nothing on the master, and on the slave it injects the
|
||||
# desired debug_sync action(s).
|
||||
SET sql_log_bin=0;
|
||||
--delimiter ||
|
||||
CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
|
||||
RETURNS INT DETERMINISTIC
|
||||
BEGIN
|
||||
RETURN x;
|
||||
END
|
||||
||
|
||||
--delimiter ;
|
||||
SET sql_log_bin=1;
|
||||
|
||||
--connection $server_slave
|
||||
|
||||
SET sql_log_bin=0;
|
||||
--delimiter ||
|
||||
CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
|
||||
RETURNS INT DETERMINISTIC
|
||||
BEGIN
|
||||
IF d1 != '' THEN
|
||||
SET debug_sync = d1;
|
||||
END IF;
|
||||
IF d2 != '' THEN
|
||||
SET debug_sync = d2;
|
||||
END IF;
|
||||
RETURN x;
|
||||
END
|
||||
||
|
||||
--delimiter ;
|
||||
SET sql_log_bin=1;
|
||||
}
|
||||
|
||||
if (`select strcmp('$create_or_drop', 'drop') = 0`)
|
||||
{
|
||||
if (!$server_slave)
|
||||
{
|
||||
--let $server_slave=slave=
|
||||
}
|
||||
if (!$server_master)
|
||||
{
|
||||
--let $server_master=master
|
||||
}
|
||||
--connection $server_slave
|
||||
SET DEBUG_SYNC='RESET';
|
||||
|
||||
--connection $server_master
|
||||
SET DEBUG_SYNC='RESET';
|
||||
DROP FUNCTION foo;
|
||||
}
|
@@ -8,6 +8,8 @@ connection master;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = innodb;
|
||||
INSERT INTO t1 VALUES(100);
|
||||
connection slave;
|
||||
call mtr.add_suppression("Deadlock found when trying to get lock");
|
||||
call mtr.add_suppression("Commit failed due to failure of an earlier commit");
|
||||
include/stop_slave.inc
|
||||
SET @old_parallel_threads= @@GLOBAL.slave_parallel_threads;
|
||||
SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode;
|
||||
@@ -31,6 +33,167 @@ connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/diff_tables.inc [master:t1,slave:t1]
|
||||
# MDEV-30423: dealock XA COMMIT vs BACKUP
|
||||
#
|
||||
# Normal XA COMMIT
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
connection master;
|
||||
connection aux_slave;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (102);
|
||||
connection master;
|
||||
XA START '1';
|
||||
INSERT INTO t1 VALUES (101);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (102);
|
||||
connection master;
|
||||
XA COMMIT '1';
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
# Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
formatID gtrid_length bqual_length data
|
||||
1 1 0 1
|
||||
connection backup_slave;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/sync_with_master_gtid.inc
|
||||
include/stop_slave.inc
|
||||
#
|
||||
# Normal XA ROLLBACK
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
Warnings:
|
||||
Note 1255 Slave already has been stopped
|
||||
connection master;
|
||||
connection aux_slave;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (104);
|
||||
connection master;
|
||||
XA START '1';
|
||||
INSERT INTO t1 VALUES (103);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (104);
|
||||
connection master;
|
||||
XA ROLLBACK '1';
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
# Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
formatID gtrid_length bqual_length data
|
||||
1 1 0 1
|
||||
connection backup_slave;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/sync_with_master_gtid.inc
|
||||
include/stop_slave.inc
|
||||
#
|
||||
# Errored out XA COMMIT
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
Warnings:
|
||||
Note 1255 Slave already has been stopped
|
||||
connection master;
|
||||
connection aux_slave;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (106);
|
||||
connection master;
|
||||
XA START '1';
|
||||
INSERT INTO t1 VALUES (105);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (106);
|
||||
connection master;
|
||||
XA COMMIT '1';
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
SET @sav_innodb_lock_wait_timeout = @@global.innodb_lock_wait_timeout;
|
||||
SET @sav_slave_transaction_retries = @@global.slave_transaction_retries;
|
||||
SET @@global.innodb_lock_wait_timeout =1;
|
||||
SET @@global.slave_transaction_retries=0;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
# Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
formatID gtrid_length bqual_length data
|
||||
1 1 0 1
|
||||
connection backup_slave;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @@global.innodb_lock_wait_timeout = @sav_innodb_lock_wait_timeout;
|
||||
SET @@global.slave_transaction_retries= @sav_slave_transaction_retries;
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
include/sync_with_master_gtid.inc
|
||||
#
|
||||
# Errored out XA ROLLBACK
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
connection master;
|
||||
connection aux_slave;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (108);
|
||||
connection master;
|
||||
XA START '1';
|
||||
INSERT INTO t1 VALUES (107);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (108);
|
||||
connection master;
|
||||
XA ROLLBACK '1';
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
SET @sav_innodb_lock_wait_timeout = @@global.innodb_lock_wait_timeout;
|
||||
SET @sav_slave_transaction_retries = @@global.slave_transaction_retries;
|
||||
SET @@global.innodb_lock_wait_timeout =1;
|
||||
SET @@global.slave_transaction_retries=0;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
# Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
formatID gtrid_length bqual_length data
|
||||
1 1 0 1
|
||||
connection backup_slave;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @@global.innodb_lock_wait_timeout = @sav_innodb_lock_wait_timeout;
|
||||
SET @@global.slave_transaction_retries= @sav_slave_transaction_retries;
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
include/sync_with_master_gtid.inc
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @@global.slave_parallel_threads= @old_parallel_threads;
|
||||
|
207
mysql-test/suite/rpl/r/parallel_backup_lsu_off.result
Normal file
207
mysql-test/suite/rpl/r/parallel_backup_lsu_off.result
Normal file
@@ -0,0 +1,207 @@
|
||||
# Specialized --log-slave-updates = 0 version of parallel_backup test.
|
||||
# MDEV-21953: deadlock between BACKUP STAGE BLOCK_COMMIT and parallel
|
||||
# MDEV-30423: dealock XA COMMIT vs BACKUP
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
#
|
||||
# MDEV-21953: deadlock between BACKUP STAGE BLOCK_COMMIT and parallel
|
||||
# replication
|
||||
#
|
||||
connection master;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = innodb;
|
||||
INSERT INTO t1 VALUES(100);
|
||||
connection slave;
|
||||
call mtr.add_suppression("Deadlock found when trying to get lock");
|
||||
call mtr.add_suppression("Commit failed due to failure of an earlier commit");
|
||||
include/stop_slave.inc
|
||||
SET @old_parallel_threads= @@GLOBAL.slave_parallel_threads;
|
||||
SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode;
|
||||
SET @@global.slave_parallel_threads= 2;
|
||||
SET @@global.slave_parallel_mode = 'optimistic';
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
connect aux_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
connect backup_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/diff_tables.inc [master:t1,slave:t1]
|
||||
# MDEV-30423: dealock XA COMMIT vs BACKUP
|
||||
#
|
||||
# Normal XA COMMIT
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
connection master;
|
||||
connection aux_slave;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (102);
|
||||
connection master;
|
||||
XA START '1';
|
||||
INSERT INTO t1 VALUES (101);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (102);
|
||||
connection master;
|
||||
XA COMMIT '1';
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
# Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
formatID gtrid_length bqual_length data
|
||||
1 1 0 1
|
||||
connection backup_slave;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/sync_with_master_gtid.inc
|
||||
include/stop_slave.inc
|
||||
#
|
||||
# Normal XA ROLLBACK
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
Warnings:
|
||||
Note 1255 Slave already has been stopped
|
||||
connection master;
|
||||
connection aux_slave;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (104);
|
||||
connection master;
|
||||
XA START '1';
|
||||
INSERT INTO t1 VALUES (103);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (104);
|
||||
connection master;
|
||||
XA ROLLBACK '1';
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
# Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
formatID gtrid_length bqual_length data
|
||||
1 1 0 1
|
||||
connection backup_slave;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/sync_with_master_gtid.inc
|
||||
include/stop_slave.inc
|
||||
#
|
||||
# Errored out XA COMMIT
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
Warnings:
|
||||
Note 1255 Slave already has been stopped
|
||||
connection master;
|
||||
connection aux_slave;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (106);
|
||||
connection master;
|
||||
XA START '1';
|
||||
INSERT INTO t1 VALUES (105);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (106);
|
||||
connection master;
|
||||
XA COMMIT '1';
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
SET @sav_innodb_lock_wait_timeout = @@global.innodb_lock_wait_timeout;
|
||||
SET @sav_slave_transaction_retries = @@global.slave_transaction_retries;
|
||||
SET @@global.innodb_lock_wait_timeout =1;
|
||||
SET @@global.slave_transaction_retries=0;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
# Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
formatID gtrid_length bqual_length data
|
||||
1 1 0 1
|
||||
connection backup_slave;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @@global.innodb_lock_wait_timeout = @sav_innodb_lock_wait_timeout;
|
||||
SET @@global.slave_transaction_retries= @sav_slave_transaction_retries;
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
include/sync_with_master_gtid.inc
|
||||
#
|
||||
# Errored out XA ROLLBACK
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
connection master;
|
||||
connection aux_slave;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (108);
|
||||
connection master;
|
||||
XA START '1';
|
||||
INSERT INTO t1 VALUES (107);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (108);
|
||||
connection master;
|
||||
XA ROLLBACK '1';
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
SET @sav_innodb_lock_wait_timeout = @@global.innodb_lock_wait_timeout;
|
||||
SET @sav_slave_transaction_retries = @@global.slave_transaction_retries;
|
||||
SET @@global.innodb_lock_wait_timeout =1;
|
||||
SET @@global.slave_transaction_retries=0;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
# Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
formatID gtrid_length bqual_length data
|
||||
1 1 0 1
|
||||
connection backup_slave;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @@global.innodb_lock_wait_timeout = @sav_innodb_lock_wait_timeout;
|
||||
SET @@global.slave_transaction_retries= @sav_slave_transaction_retries;
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
include/sync_with_master_gtid.inc
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @@global.slave_parallel_threads= @old_parallel_threads;
|
||||
SET @@global.slave_parallel_mode = @old_parallel_mode;
|
||||
include/start_slave.inc
|
||||
connection server_1;
|
||||
DROP TABLE t1;
|
||||
include/rpl_end.inc
|
207
mysql-test/suite/rpl/r/parallel_backup_slave_binlog_off.result
Normal file
207
mysql-test/suite/rpl/r/parallel_backup_slave_binlog_off.result
Normal file
@@ -0,0 +1,207 @@
|
||||
# Specialized --skip-log-bin slave version of parallel_backup test.
|
||||
# MDEV-21953: deadlock between BACKUP STAGE BLOCK_COMMIT and parallel
|
||||
# MDEV-30423: dealock XA COMMIT vs BACKUP
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
#
|
||||
# MDEV-21953: deadlock between BACKUP STAGE BLOCK_COMMIT and parallel
|
||||
# replication
|
||||
#
|
||||
connection master;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = innodb;
|
||||
INSERT INTO t1 VALUES(100);
|
||||
connection slave;
|
||||
call mtr.add_suppression("Deadlock found when trying to get lock");
|
||||
call mtr.add_suppression("Commit failed due to failure of an earlier commit");
|
||||
include/stop_slave.inc
|
||||
SET @old_parallel_threads= @@GLOBAL.slave_parallel_threads;
|
||||
SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode;
|
||||
SET @@global.slave_parallel_threads= 2;
|
||||
SET @@global.slave_parallel_mode = 'optimistic';
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
connect aux_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
connect backup_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/diff_tables.inc [master:t1,slave:t1]
|
||||
# MDEV-30423: dealock XA COMMIT vs BACKUP
|
||||
#
|
||||
# Normal XA COMMIT
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
connection master;
|
||||
connection aux_slave;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (102);
|
||||
connection master;
|
||||
XA START '1';
|
||||
INSERT INTO t1 VALUES (101);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (102);
|
||||
connection master;
|
||||
XA COMMIT '1';
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
# Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
formatID gtrid_length bqual_length data
|
||||
1 1 0 1
|
||||
connection backup_slave;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/sync_with_master_gtid.inc
|
||||
include/stop_slave.inc
|
||||
#
|
||||
# Normal XA ROLLBACK
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
Warnings:
|
||||
Note 1255 Slave already has been stopped
|
||||
connection master;
|
||||
connection aux_slave;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (104);
|
||||
connection master;
|
||||
XA START '1';
|
||||
INSERT INTO t1 VALUES (103);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (104);
|
||||
connection master;
|
||||
XA ROLLBACK '1';
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
# Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
formatID gtrid_length bqual_length data
|
||||
1 1 0 1
|
||||
connection backup_slave;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/sync_with_master_gtid.inc
|
||||
include/stop_slave.inc
|
||||
#
|
||||
# Errored out XA COMMIT
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
Warnings:
|
||||
Note 1255 Slave already has been stopped
|
||||
connection master;
|
||||
connection aux_slave;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (106);
|
||||
connection master;
|
||||
XA START '1';
|
||||
INSERT INTO t1 VALUES (105);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (106);
|
||||
connection master;
|
||||
XA COMMIT '1';
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
SET @sav_innodb_lock_wait_timeout = @@global.innodb_lock_wait_timeout;
|
||||
SET @sav_slave_transaction_retries = @@global.slave_transaction_retries;
|
||||
SET @@global.innodb_lock_wait_timeout =1;
|
||||
SET @@global.slave_transaction_retries=0;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
# Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
formatID gtrid_length bqual_length data
|
||||
1 1 0 1
|
||||
connection backup_slave;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @@global.innodb_lock_wait_timeout = @sav_innodb_lock_wait_timeout;
|
||||
SET @@global.slave_transaction_retries= @sav_slave_transaction_retries;
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
include/sync_with_master_gtid.inc
|
||||
#
|
||||
# Errored out XA ROLLBACK
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
connection master;
|
||||
connection aux_slave;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (108);
|
||||
connection master;
|
||||
XA START '1';
|
||||
INSERT INTO t1 VALUES (107);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (108);
|
||||
connection master;
|
||||
XA ROLLBACK '1';
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
SET @sav_innodb_lock_wait_timeout = @@global.innodb_lock_wait_timeout;
|
||||
SET @sav_slave_transaction_retries = @@global.slave_transaction_retries;
|
||||
SET @@global.innodb_lock_wait_timeout =1;
|
||||
SET @@global.slave_transaction_retries=0;
|
||||
include/start_slave.inc
|
||||
connection aux_slave;
|
||||
# Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
formatID gtrid_length bqual_length data
|
||||
1 1 0 1
|
||||
connection backup_slave;
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
connection aux_slave;
|
||||
ROLLBACK;
|
||||
connection backup_slave;
|
||||
BACKUP STAGE END;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @@global.innodb_lock_wait_timeout = @sav_innodb_lock_wait_timeout;
|
||||
SET @@global.slave_transaction_retries= @sav_slave_transaction_retries;
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
include/sync_with_master_gtid.inc
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @@global.slave_parallel_threads= @old_parallel_threads;
|
||||
SET @@global.slave_parallel_mode = @old_parallel_mode;
|
||||
include/start_slave.inc
|
||||
connection server_1;
|
||||
DROP TABLE t1;
|
||||
include/rpl_end.inc
|
@@ -4,9 +4,7 @@ connection master;
|
||||
SET GLOBAL LOG_WARNINGS=2;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO MASTER_USE_GTID=current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
"Test Case 1: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(1), gtid('')"
|
||||
|
72
mysql-test/suite/rpl/r/rpl_delayed_parallel_slave_sbm.result
Normal file
72
mysql-test/suite/rpl/r/rpl_delayed_parallel_slave_sbm.result
Normal file
@@ -0,0 +1,72 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
change master to master_delay=3, master_use_gtid=Slave_Pos;
|
||||
set @@GLOBAL.slave_parallel_threads=2;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
create table t1 (a int);
|
||||
include/sync_slave_sql_with_master.inc
|
||||
#
|
||||
# Pt 1) Ensure SBM is updated immediately upon arrival of the next event
|
||||
# Lock t1 on slave so the first received transaction does not complete/commit
|
||||
connection slave;
|
||||
LOCK TABLES t1 WRITE;
|
||||
connection master;
|
||||
# Sleep 2 to allow a buffer between events for SBM check
|
||||
insert into t1 values (0);
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
# Waiting for transaction to arrive on slave and begin SQL Delay..
|
||||
# Validating SBM is updated on event arrival..
|
||||
# ..done
|
||||
connection slave;
|
||||
UNLOCK TABLES;
|
||||
include/sync_with_master_gtid.inc
|
||||
#
|
||||
# Pt 2) If the SQL thread has not entered an idle state, ensure
|
||||
# following events do not update SBM
|
||||
# Stop slave IO thread so it receives both events together on restart
|
||||
connection slave;
|
||||
include/stop_slave_io.inc
|
||||
connection master;
|
||||
# Sleep 2 to allow a buffer between events for SBM check
|
||||
insert into t1 values (1);
|
||||
# Sleep 3 to create gap between events
|
||||
insert into t1 values (2);
|
||||
include/save_master_pos.inc
|
||||
connection slave;
|
||||
LOCK TABLES t1 WRITE;
|
||||
SET @@global.debug_dbug="+d,pause_sql_thread_on_next_event";
|
||||
START SLAVE IO_THREAD;
|
||||
# Before we start processing the events, we ensure both transactions
|
||||
# were written into the relay log. Otherwise, if the IO thread takes too
|
||||
# long to queue the events, the sql thread can think it has caught up
|
||||
# too quickly.
|
||||
SET DEBUG_SYNC='now WAIT_FOR paused_on_event';
|
||||
include/sync_io_with_master.inc
|
||||
SET @@global.debug_dbug="-d,pause_sql_thread_on_next_event";
|
||||
SET DEBUG_SYNC='now SIGNAL sql_thread_continue';
|
||||
# Wait for first transaction to complete SQL delay and begin execution..
|
||||
# Validate SBM calculation doesn't use the second transaction because SQL thread shouldn't have gone idle..
|
||||
# ..and that SBM wasn't calculated using prior committed transactions
|
||||
# ..done
|
||||
connection slave;
|
||||
UNLOCK TABLES;
|
||||
#
|
||||
# Cleanup
|
||||
# Reset master_delay
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO master_delay=0;
|
||||
set @@GLOBAL.slave_parallel_threads=4;
|
||||
SET @@global.debug_dbug="";
|
||||
SET DEBUG_SYNC='RESET';
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
include/sync_with_master_gtid.inc
|
||||
include/rpl_end.inc
|
||||
# End of rpl_delayed_parallel_slave_sbm.test
|
@@ -14,9 +14,7 @@ call mtr.add_suppression('Master command COM_REGISTER_SLAVE failed: failed regis
|
||||
SET sql_log_bin=1;
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
connection server_1;
|
||||
INSERT INTO t1 VALUES (2,1);
|
||||
INSERT INTO t1 VALUES (3,1);
|
||||
|
@@ -3,9 +3,7 @@ include/master-slave.inc
|
||||
CREATE TABLE t1 (i INT);
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO MASTER_USE_GTID= current_pos, MASTER_DELAY= 10;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
CHANGE MASTER TO MASTER_DELAY= 10;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
@@ -16,7 +14,7 @@ connection slave;
|
||||
# Asserted this: One row shoule be found in table t1.
|
||||
"======= Clean up ========"
|
||||
STOP SLAVE;
|
||||
CHANGE MASTER TO MASTER_USE_GTID=no, MASTER_DELAY=0;
|
||||
CHANGE MASTER TO MASTER_DELAY=0;
|
||||
START SLAVE;
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
|
@@ -12,24 +12,12 @@ RETURN s;
|
||||
END|
|
||||
connection server_2;
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
connection server_3;
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
connection server_4;
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
connection server_5;
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
connection server_1;
|
||||
SET gtid_domain_id= 1;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
@@ -347,9 +335,7 @@ a b
|
||||
*** Now let the old master join up as slave. ***
|
||||
connection server_1;
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
|
||||
master_user = "root", master_use_gtid = current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
master_user = "root", master_use_gtid = slave_pos, master_demote_to_slave=1;
|
||||
include/start_slave.inc
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
@@ -387,8 +373,6 @@ a b
|
||||
connection server_1;
|
||||
include/stop_slave.inc
|
||||
RESET SLAVE ALL;
|
||||
Warnings:
|
||||
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos'
|
||||
connection server_2;
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1;
|
||||
include/start_slave.inc
|
||||
|
@@ -12,9 +12,7 @@ include/wait_for_slave_to_stop.inc
|
||||
reset slave all;
|
||||
connection server_1;
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
|
||||
master_user='root', MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
master_user='root', MASTER_USE_GTID=SLAVE_POS, master_demote_to_slave=1;
|
||||
include/start_slave.inc
|
||||
include/wait_for_slave_to_start.inc
|
||||
connection server_2;
|
||||
@@ -24,9 +22,7 @@ insert into t1 values (4);
|
||||
flush logs;
|
||||
connection server_3;
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
include/start_slave.inc
|
||||
select * from t1 order by n;
|
||||
n
|
||||
@@ -57,20 +53,14 @@ connection server_1;
|
||||
include/stop_slave.inc
|
||||
include/wait_for_slave_to_stop.inc
|
||||
reset slave all;
|
||||
Warnings:
|
||||
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos'
|
||||
connection server_2;
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1,
|
||||
master_user = 'root', MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
master_user = 'root', MASTER_USE_GTID=SLAVE_POS, master_demote_to_slave=1;
|
||||
include/start_slave.inc
|
||||
connection server_3;
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
include/start_slave.inc
|
||||
connection server_1;
|
||||
drop table t1;
|
||||
|
@@ -9,9 +9,6 @@ include/stop_slave.inc
|
||||
SET sql_log_bin= 0;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SET sql_log_bin= 1;
|
||||
CHANGE MASTER TO master_use_gtid= current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
connection master;
|
||||
CREATE TEMPORARY TABLE t2 LIKE t1;
|
||||
INSERT INTO t2 VALUE (1);
|
||||
|
@@ -21,9 +21,7 @@ a b
|
||||
include/stop_slave.inc
|
||||
connection server_1;
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT,
|
||||
master_user = 'root', master_use_gtid = current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
master_user = 'root';
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
connection server_2;
|
||||
@@ -48,16 +46,11 @@ a b
|
||||
4 2
|
||||
include/stop_slave.inc
|
||||
RESET SLAVE;
|
||||
Warnings:
|
||||
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos'
|
||||
INSERT INTO t1 VALUES (5, 1);
|
||||
INSERT INTO t1 VALUES (6, 1);
|
||||
include/save_master_gtid.inc
|
||||
connection server_2;
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
|
||||
master_use_gtid = current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT;
|
||||
START SLAVE;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
@@ -1,10 +1,4 @@
|
||||
include/rpl_init.inc [topology=1->2]
|
||||
connection server_2;
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid= current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
include/start_slave.inc
|
||||
connection server_1;
|
||||
CREATE TABLE t1 (a INT);
|
||||
FLUSH LOGS;
|
||||
|
@@ -58,9 +58,7 @@ SHOW VARIABLES LIKE 'gtid_binlog_state';
|
||||
Variable_name Value
|
||||
gtid_binlog_state
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
include/start_slave.inc
|
||||
SHOW VARIABLES LIKE 'gtid_binlog_pos';
|
||||
Variable_name Value
|
||||
|
@@ -11,9 +11,7 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
connection server_2;
|
||||
SET GLOBAL gtid_slave_pos="";
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
include/start_slave.inc
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
@@ -35,9 +33,7 @@ master-bin.000003 #
|
||||
connection server_2;
|
||||
SET GLOBAL gtid_slave_pos="";
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
START SLAVE;
|
||||
include/wait_for_slave_io_error.inc [errno=1236]
|
||||
include/stop_slave.inc
|
||||
@@ -59,9 +55,7 @@ include/save_master_gtid.inc
|
||||
connection server_2;
|
||||
SET GLOBAL gtid_slave_pos='0-1-3';
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
include/start_slave.inc
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 ORDER by a;
|
||||
@@ -96,16 +90,12 @@ connection server_2;
|
||||
connection server_2;
|
||||
include/stop_slave.inc
|
||||
RESET SLAVE ALL;
|
||||
Warnings:
|
||||
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos'
|
||||
RESET MASTER;
|
||||
connection server_1;
|
||||
RESET MASTER;
|
||||
connection server_2;
|
||||
SET GLOBAL gtid_slave_pos='';
|
||||
CHANGE MASTER TO master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root', master_use_gtid=current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
CHANGE MASTER TO master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root', master_use_gtid=slave_pos;
|
||||
include/start_slave.inc
|
||||
connection server_1;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY);
|
||||
@@ -129,8 +119,6 @@ connection server_2;
|
||||
include/stop_slave.inc
|
||||
DROP TABLE t1;
|
||||
RESET SLAVE;
|
||||
Warnings:
|
||||
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos'
|
||||
SET GLOBAL gtid_slave_pos="";
|
||||
Warnings:
|
||||
Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-4. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
|
||||
@@ -162,9 +150,7 @@ Using_Gtid = 'No'
|
||||
START SLAVE;
|
||||
include/wait_for_slave_sql_error.inc [errno=1050]
|
||||
STOP SLAVE IO_THREAD;
|
||||
CHANGE MASTER TO MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS;
|
||||
include/start_slave.inc
|
||||
connection server_1;
|
||||
INSERT INTO t1 VALUES(3);
|
||||
@@ -223,9 +209,9 @@ include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
10
|
||||
SELECT 'Current_Pos' AS Using_Gtid;
|
||||
SELECT 'Slave_Pos' AS Using_Gtid;
|
||||
Using_Gtid
|
||||
Current_Pos
|
||||
Slave_Pos
|
||||
SELECT '0-1-2' AS Gtid_Slave_Pos;
|
||||
Gtid_Slave_Pos
|
||||
0-1-2
|
||||
@@ -252,8 +238,6 @@ connection server_2;
|
||||
include/stop_slave.inc
|
||||
DROP TABLE t1;
|
||||
RESET SLAVE ALL;
|
||||
Warnings:
|
||||
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos'
|
||||
CHANGE MASTER TO MASTER_USE_GTID=NO;
|
||||
RESET MASTER;
|
||||
SET GLOBAL gtid_slave_pos= "";
|
||||
|
@@ -7,9 +7,6 @@ connection server_2;
|
||||
include/stop_slave.inc
|
||||
Master_Log_File = 'master-bin.000001'
|
||||
Using_Gtid = 'Slave_Pos'
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
FLUSH LOGS;
|
||||
connection server_1;
|
||||
FLUSH LOGS;
|
||||
|
@@ -29,9 +29,7 @@ ERROR HY000: Slave is already running
|
||||
include/stop_slave_io.inc
|
||||
START SLAVE UNTIL master_gtid_pos = "";
|
||||
ERROR HY000: START SLAVE UNTIL master_gtid_pos requires that slave is using GTID
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
CHANGE MASTER TO master_use_gtid=slave_pos;
|
||||
connection server_1;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
@@ -60,7 +58,7 @@ a
|
||||
include/stop_slave.inc
|
||||
START SLAVE UNTIL master_gtid_pos = "1-10-100,2-20-200,0-1-300";
|
||||
include/wait_for_slave_to_start.inc
|
||||
Using_Gtid = 'Current_Pos'
|
||||
Using_Gtid = 'Slave_Pos'
|
||||
Until_Condition = 'Gtid'
|
||||
connection server_1;
|
||||
INSERT INTO t1 VALUES (3);
|
||||
@@ -205,8 +203,6 @@ include/start_slave.inc
|
||||
connection server_2;
|
||||
include/stop_slave.inc
|
||||
RESET SLAVE ALL;
|
||||
Warnings:
|
||||
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos'
|
||||
RESET MASTER;
|
||||
SET GLOBAL gtid_slave_pos='';
|
||||
connection server_1;
|
||||
@@ -219,9 +215,7 @@ RESET MASTER;
|
||||
INSERT INTO t1 VALUES (10);
|
||||
connection server_2;
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1,
|
||||
master_user = "root", master_use_gtid = current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
master_user = "root", master_use_gtid = slave_pos;
|
||||
START SLAVE UNTIL master_gtid_pos = '0-1-2';
|
||||
include/wait_for_slave_to_start.inc
|
||||
connection server_1;
|
||||
|
@@ -10,9 +10,6 @@ SET sql_log_bin= 0;
|
||||
CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
|
||||
INSERT INTO t1 VALUES (1, 2);
|
||||
SET sql_log_bin= 1;
|
||||
CHANGE MASTER TO master_use_gtid= current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
Contents on slave before:
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b
|
||||
|
76
mysql-test/suite/rpl/r/rpl_parallel_analyze.result
Normal file
76
mysql-test/suite/rpl/r/rpl_parallel_analyze.result
Normal file
@@ -0,0 +1,76 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
# Initialize
|
||||
connection slave;
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
# Setup data
|
||||
connection master;
|
||||
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE ta (a int);
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
include/sync_with_master_gtid.inc
|
||||
connection master;
|
||||
SET sql_log_bin=0;
|
||||
CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
|
||||
RETURNS INT DETERMINISTIC
|
||||
BEGIN
|
||||
RETURN x;
|
||||
END
|
||||
||
|
||||
SET sql_log_bin=1;
|
||||
connection slave;
|
||||
SET sql_log_bin=0;
|
||||
CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
|
||||
RETURNS INT DETERMINISTIC
|
||||
BEGIN
|
||||
IF d1 != '' THEN
|
||||
SET debug_sync = d1;
|
||||
END IF;
|
||||
IF d2 != '' THEN
|
||||
SET debug_sync = d2;
|
||||
END IF;
|
||||
RETURN x;
|
||||
END
|
||||
||
|
||||
SET sql_log_bin=1;
|
||||
include/stop_slave.inc
|
||||
SET @old_parallel_threads =@@GLOBAL.slave_parallel_threads;
|
||||
SET @old_parallel_mode =@@GLOBAL.slave_parallel_mode;
|
||||
SET @old_gtid_strict_mode =@@GLOBAL.gtid_strict_mode;
|
||||
SET GLOBAL slave_parallel_threads=10;
|
||||
SET GLOBAL slave_parallel_mode=conservative;
|
||||
SET GLOBAL gtid_strict_mode=ON;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
SET @old_format= @@SESSION.binlog_format;
|
||||
SET binlog_format=statement;
|
||||
INSERT INTO t1 VALUES (foo(1, 'rpl_parallel_after_mark_start_commit WAIT_FOR sig_go', ''));
|
||||
ANALYZE TABLE ta;
|
||||
Table Op Msg_type Msg_text
|
||||
test.ta analyze status Engine-independent statistics collected
|
||||
test.ta analyze status Table is already up to date
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
SELECT info FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit";
|
||||
info
|
||||
ANALYZE TABLE ta
|
||||
set @@debug_sync="now signal sig_go";
|
||||
include/sync_with_master_gtid.inc
|
||||
# Cleanup
|
||||
connection master;
|
||||
DROP TABLE t1,ta;
|
||||
connection slave;
|
||||
SET DEBUG_SYNC='RESET';
|
||||
connection master;
|
||||
SET DEBUG_SYNC='RESET';
|
||||
DROP FUNCTION foo;
|
||||
include/save_master_gtid.inc
|
||||
connection slave;
|
||||
include/sync_with_master_gtid.inc
|
||||
include/stop_slave.inc
|
||||
SET @@GLOBAL.slave_parallel_threads=@old_parallel_threads;
|
||||
SET @@GLOBAL.slave_parallel_mode =@old_parallel_mode;
|
||||
SET @@GLOBAL.gtid_strict_mode =@old_gtid_strict_mode;
|
||||
include/start_slave.inc
|
||||
include/rpl_end.inc
|
@@ -4,9 +4,6 @@ connection server_2;
|
||||
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
|
||||
include/stop_slave.inc
|
||||
SET GLOBAL slave_parallel_threads=10;
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
include/start_slave.inc
|
||||
*** MDEV-6589: Incorrect relay log start position when restarting SQL thread after error in parallel replication ***
|
||||
connection server_1;
|
||||
|
@@ -17,16 +17,10 @@ SET GLOBAL binlog_commit_wait_usec=2000000;
|
||||
SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates;
|
||||
SET GLOBAL binlog_direct_non_transactional_updates=OFF;
|
||||
SET SESSION binlog_direct_non_transactional_updates=OFF;
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
connection server_3;
|
||||
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
|
||||
include/stop_slave.inc
|
||||
SET GLOBAL slave_parallel_threads=10;
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
connection server_1;
|
||||
BEGIN;
|
||||
CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=MEMORY;
|
||||
|
@@ -4,9 +4,6 @@ connection server_2;
|
||||
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
|
||||
include/stop_slave.inc
|
||||
SET GLOBAL slave_parallel_threads=5;
|
||||
CHANGE MASTER TO master_use_gtid= current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
include/start_slave.inc
|
||||
connection server_1;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(100) CHARACTER SET utf8);
|
||||
|
@@ -4,9 +4,6 @@ connection master;
|
||||
set global binlog_alter_two_phase=true;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
change master to master_use_gtid= current_pos;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
set global gtid_strict_mode=1;
|
||||
# Legacy Master Slave
|
||||
connect master_node,127.0.0.1,root,,$db_name, $M_port;
|
||||
|
@@ -3,9 +3,6 @@ include/master-slave.inc
|
||||
*** MDEV-9383: Server fails to read master.info after upgrade 10.0 -> 10.1 ***
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
include/rpl_stop_server.inc [server_number=2]
|
||||
include/rpl_start_server.inc [server_number=2]
|
||||
connection master;
|
||||
|
@@ -15,6 +15,9 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = innodb;
|
||||
INSERT INTO t1 VALUES(100);
|
||||
|
||||
--sync_slave_with_master
|
||||
call mtr.add_suppression("Deadlock found when trying to get lock");
|
||||
call mtr.add_suppression("Commit failed due to failure of an earlier commit");
|
||||
|
||||
--source include/stop_slave.inc
|
||||
SET @old_parallel_threads= @@GLOBAL.slave_parallel_threads;
|
||||
SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode;
|
||||
@@ -64,6 +67,32 @@ BACKUP STAGE END;
|
||||
--let $diff_tables= master:t1,slave:t1
|
||||
--source include/diff_tables.inc
|
||||
|
||||
#
|
||||
--echo # MDEV-30423: dealock XA COMMIT vs BACKUP
|
||||
# Prove XA "COMPLETE" 'xid' does not dealock similary to the normal trx case.
|
||||
# The slave binlog group commit leader is blocked by a local trx like in
|
||||
# the above normal trx case.
|
||||
# [Notice a reuse of t1,aux_conn from above.]
|
||||
#
|
||||
--let $complete = COMMIT
|
||||
--source parallel_backup_xa.inc
|
||||
--let $complete = ROLLBACK
|
||||
--source parallel_backup_xa.inc
|
||||
|
||||
--let $slave_ooo_error = 1
|
||||
--let $complete = COMMIT
|
||||
--source parallel_backup_xa.inc
|
||||
--connection slave
|
||||
--source include/start_slave.inc
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
--let $slave_ooo_error = 1
|
||||
--let $complete = ROLLBACK
|
||||
--source parallel_backup_xa.inc
|
||||
--connection slave
|
||||
--source include/start_slave.inc
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
|
||||
# Clean up.
|
||||
--connection slave
|
||||
|
2
mysql-test/suite/rpl/t/parallel_backup_lsu_off-slave.opt
Normal file
2
mysql-test/suite/rpl/t/parallel_backup_lsu_off-slave.opt
Normal file
@@ -0,0 +1,2 @@
|
||||
--log-slave-updates=0
|
||||
|
7
mysql-test/suite/rpl/t/parallel_backup_lsu_off.test
Normal file
7
mysql-test/suite/rpl/t/parallel_backup_lsu_off.test
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
--echo # Specialized --log-slave-updates = 0 version of parallel_backup test.
|
||||
#
|
||||
--echo # MDEV-21953: deadlock between BACKUP STAGE BLOCK_COMMIT and parallel
|
||||
--echo # MDEV-30423: dealock XA COMMIT vs BACKUP
|
||||
--let $rpl_skip_reset_master_and_slave = 1
|
||||
--source parallel_backup.test
|
@@ -0,0 +1 @@
|
||||
--skip-log-bin
|
@@ -0,0 +1,7 @@
|
||||
#
|
||||
--echo # Specialized --skip-log-bin slave version of parallel_backup test.
|
||||
#
|
||||
--echo # MDEV-21953: deadlock between BACKUP STAGE BLOCK_COMMIT and parallel
|
||||
--echo # MDEV-30423: dealock XA COMMIT vs BACKUP
|
||||
--let $rpl_server_skip_log_bin= 1
|
||||
--source parallel_backup.test
|
79
mysql-test/suite/rpl/t/parallel_backup_xa.inc
Normal file
79
mysql-test/suite/rpl/t/parallel_backup_xa.inc
Normal file
@@ -0,0 +1,79 @@
|
||||
# Invoked from parallel_backup.test
|
||||
# Parameters:
|
||||
# $complete = COMMIT or ROLLBACK
|
||||
# $slave_ooo_error = 1 means slave group commit did not succeed
|
||||
#
|
||||
--let $kind = Normal
|
||||
if ($slave_ooo_error)
|
||||
{
|
||||
--let $kind = Errored out
|
||||
}
|
||||
--echo #
|
||||
--echo # $kind XA $complete
|
||||
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connection master
|
||||
# val_0 is the first value to insert on master in prepared xa
|
||||
# val_1 is the next one to insert which is the value to block on slave
|
||||
--let $val_0 = `SELECT max(a)+1 FROM t1`
|
||||
--let $val_1 = $val_0
|
||||
--inc $val_1
|
||||
|
||||
--connection aux_slave
|
||||
BEGIN;
|
||||
--eval INSERT INTO t1 VALUES ($val_1)
|
||||
|
||||
--connection master
|
||||
XA START '1';
|
||||
--eval INSERT INTO t1 VALUES ($val_0)
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
--connection master1
|
||||
--eval INSERT INTO t1 VALUES ($val_1)
|
||||
--connection master
|
||||
--eval XA $complete '1'
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
--connection slave
|
||||
if ($slave_ooo_error)
|
||||
{
|
||||
SET @sav_innodb_lock_wait_timeout = @@global.innodb_lock_wait_timeout;
|
||||
SET @sav_slave_transaction_retries = @@global.slave_transaction_retries;
|
||||
SET @@global.innodb_lock_wait_timeout =1;
|
||||
SET @@global.slave_transaction_retries=0;
|
||||
}
|
||||
--source include/start_slave.inc
|
||||
--connection aux_slave
|
||||
--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit"
|
||||
--source include/wait_condition.inc
|
||||
--echo # Xid '1' must be in the output:
|
||||
XA RECOVER;
|
||||
--connection backup_slave
|
||||
BACKUP STAGE START;
|
||||
--send BACKUP STAGE BLOCK_COMMIT
|
||||
--connection aux_slave
|
||||
--sleep 1
|
||||
if ($slave_ooo_error)
|
||||
{
|
||||
--let $wait_condition= SELECT COUNT(*) = 0 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit"
|
||||
--source include/wait_condition.inc
|
||||
}
|
||||
ROLLBACK;
|
||||
--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state = "Waiting for backup lock"
|
||||
--source include/wait_condition.inc
|
||||
--connection backup_slave
|
||||
--reap
|
||||
BACKUP STAGE END;
|
||||
--connection slave
|
||||
if (!$slave_ooo_error)
|
||||
{
|
||||
--source include/sync_with_master_gtid.inc
|
||||
}
|
||||
--source include/stop_slave.inc
|
||||
if ($slave_ooo_error)
|
||||
{
|
||||
SET @@global.innodb_lock_wait_timeout = @sav_innodb_lock_wait_timeout;
|
||||
SET @@global.slave_transaction_retries= @sav_slave_transaction_retries;
|
||||
}
|
@@ -8,7 +8,7 @@
|
||||
# Steps:
|
||||
# 0 - Have LOG_WARNINGS=2
|
||||
# 1 - On a fresh slave server which has not replicated any GTIDs execute
|
||||
# "CHANGE MASTER TO MASTER_USE_GTID=current_pos;" command. Start the
|
||||
# "CHANGE MASTER TO MASTER_USE_GTID=slave_pos;" command. Start the
|
||||
# slave.
|
||||
# 2 - In Master error log verify that pattern "using_gtid(1), gtid('')" is
|
||||
# present.
|
||||
@@ -43,7 +43,7 @@ SET GLOBAL LOG_WARNINGS=2;
|
||||
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO MASTER_USE_GTID=current_pos;
|
||||
CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
|
@@ -0,0 +1 @@
|
||||
--slave-parallel-threads=4
|
150
mysql-test/suite/rpl/t/rpl_delayed_parallel_slave_sbm.test
Normal file
150
mysql-test/suite/rpl/t/rpl_delayed_parallel_slave_sbm.test
Normal file
@@ -0,0 +1,150 @@
|
||||
#
|
||||
# This test ensures that after a delayed parallel slave has idled, i.e.
|
||||
# executed everything in its relay log, the next event group that the SQL
|
||||
# thread reads from the relay log will immediately be used in the
|
||||
# Seconds_Behind_Master. In particular, it ensures that the calculation for
|
||||
# Seconds_Behind_Master is based on the timestamp of the new transaction,
|
||||
# rather than the last committed transaction.
|
||||
#
|
||||
# References:
|
||||
# MDEV-29639: Seconds_Behind_Master is incorrect for Delayed, Parallel
|
||||
# Replicas
|
||||
#
|
||||
|
||||
--source include/master-slave.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
--let $old_debug_dbug= `SELECT @@global.debug_dbug`
|
||||
--let $master_delay= 3
|
||||
--eval change master to master_delay=$master_delay, master_use_gtid=Slave_Pos
|
||||
--let $old_slave_threads= `SELECT @@GLOBAL.slave_parallel_threads`
|
||||
set @@GLOBAL.slave_parallel_threads=2;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
create table t1 (a int);
|
||||
--source include/sync_slave_sql_with_master.inc
|
||||
|
||||
--echo #
|
||||
--echo # Pt 1) Ensure SBM is updated immediately upon arrival of the next event
|
||||
|
||||
--echo # Lock t1 on slave so the first received transaction does not complete/commit
|
||||
--connection slave
|
||||
LOCK TABLES t1 WRITE;
|
||||
|
||||
--connection master
|
||||
--echo # Sleep 2 to allow a buffer between events for SBM check
|
||||
sleep 2;
|
||||
|
||||
--let $ts_trx_before_ins= `SELECT UNIX_TIMESTAMP()`
|
||||
--let insert_ctr= 0
|
||||
--eval insert into t1 values ($insert_ctr)
|
||||
--inc $insert_ctr
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
--connection slave
|
||||
|
||||
--echo # Waiting for transaction to arrive on slave and begin SQL Delay..
|
||||
--let $wait_condition= SELECT count(*) FROM information_schema.processlist WHERE state LIKE 'Waiting until MASTER_DELAY seconds after master executed event';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--echo # Validating SBM is updated on event arrival..
|
||||
--let $sbm_trx1_arrive= query_get_value(SHOW SLAVE STATUS, Seconds_Behind_Master, 1)
|
||||
--let $seconds_since_idling= `SELECT UNIX_TIMESTAMP() - $ts_trx_before_ins`
|
||||
if (`SELECT $sbm_trx1_arrive > ($seconds_since_idling + 1)`)
|
||||
{
|
||||
--echo # SBM was $sbm_trx1_arrive yet shouldn't have been larger than $seconds_since_idling + 1 (for possible negative clock_diff_with_master)
|
||||
--die Seconds_Behind_Master should reset after idling
|
||||
}
|
||||
--echo # ..done
|
||||
|
||||
--connection slave
|
||||
UNLOCK TABLES;
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
--echo #
|
||||
--echo # Pt 2) If the SQL thread has not entered an idle state, ensure
|
||||
--echo # following events do not update SBM
|
||||
|
||||
--echo # Stop slave IO thread so it receives both events together on restart
|
||||
--connection slave
|
||||
--source include/stop_slave_io.inc
|
||||
|
||||
--connection master
|
||||
|
||||
--echo # Sleep 2 to allow a buffer between events for SBM check
|
||||
sleep 2;
|
||||
--let $ts_trxpt2_before_ins= `SELECT UNIX_TIMESTAMP()`
|
||||
--eval insert into t1 values ($insert_ctr)
|
||||
--inc $insert_ctr
|
||||
--echo # Sleep 3 to create gap between events
|
||||
sleep 3;
|
||||
--eval insert into t1 values ($insert_ctr)
|
||||
--inc $insert_ctr
|
||||
--let $ts_trx_after_ins= `SELECT UNIX_TIMESTAMP()`
|
||||
--source include/save_master_pos.inc
|
||||
|
||||
--connection slave
|
||||
LOCK TABLES t1 WRITE;
|
||||
|
||||
SET @@global.debug_dbug="+d,pause_sql_thread_on_next_event";
|
||||
|
||||
START SLAVE IO_THREAD;
|
||||
|
||||
--echo # Before we start processing the events, we ensure both transactions
|
||||
--echo # were written into the relay log. Otherwise, if the IO thread takes too
|
||||
--echo # long to queue the events, the sql thread can think it has caught up
|
||||
--echo # too quickly.
|
||||
SET DEBUG_SYNC='now WAIT_FOR paused_on_event';
|
||||
--source include/sync_io_with_master.inc
|
||||
SET @@global.debug_dbug="-d,pause_sql_thread_on_next_event";
|
||||
SET DEBUG_SYNC='now SIGNAL sql_thread_continue';
|
||||
|
||||
--echo # Wait for first transaction to complete SQL delay and begin execution..
|
||||
--let $wait_condition= SELECT count(*) FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock%' AND command LIKE 'Slave_Worker';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--echo # Validate SBM calculation doesn't use the second transaction because SQL thread shouldn't have gone idle..
|
||||
--let $sbm_after_trx_no_idle= query_get_value(SHOW SLAVE STATUS, Seconds_Behind_Master, 1)
|
||||
--let $timestamp_trxpt2_arrive= `SELECT UNIX_TIMESTAMP()`
|
||||
if (`SELECT $sbm_after_trx_no_idle < $timestamp_trxpt2_arrive - $ts_trx_after_ins`)
|
||||
{
|
||||
--let $cmpv= `SELECT $timestamp_trxpt2_arrive - $ts_trx_after_ins`
|
||||
--echo # SBM $sbm_after_trx_no_idle was more recent than time since last transaction ($cmpv seconds)
|
||||
--die Seconds_Behind_Master should not have used second transaction timestamp
|
||||
}
|
||||
--let $seconds_since_idling= `SELECT ($timestamp_trxpt2_arrive - $ts_trxpt2_before_ins)`
|
||||
--echo # ..and that SBM wasn't calculated using prior committed transactions
|
||||
if (`SELECT $sbm_after_trx_no_idle > ($seconds_since_idling + 1)`)
|
||||
{
|
||||
--echo # SBM was $sbm_after_trx_no_idle yet shouldn't have been larger than $seconds_since_idling + 1 (for possible negative clock_diff_with_master)
|
||||
--die Seconds_Behind_Master calculation should not have used prior committed transaction
|
||||
}
|
||||
--echo # ..done
|
||||
|
||||
--connection slave
|
||||
UNLOCK TABLES;
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup
|
||||
|
||||
--echo # Reset master_delay
|
||||
--source include/stop_slave.inc
|
||||
--eval CHANGE MASTER TO master_delay=0
|
||||
--eval set @@GLOBAL.slave_parallel_threads=$old_slave_threads
|
||||
--eval SET @@global.debug_dbug="$old_debug_dbug"
|
||||
SET DEBUG_SYNC='RESET';
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
--connection slave
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
--source include/rpl_end.inc
|
||||
--echo # End of rpl_delayed_parallel_slave_sbm.test
|
@@ -27,7 +27,7 @@ SET sql_log_bin=1;
|
||||
--source include/stop_slave.inc
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
|
||||
--connection server_1
|
||||
INSERT INTO t1 VALUES (2,1);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# Steps:
|
||||
# 0 - Stop the slave and execute CHANGE MASTER command with
|
||||
# master_use_gtid= curren_pos and master_delay= 10
|
||||
# master_delay= 10
|
||||
# 1 - On slave introduce a sleep of 15 seconds and check that the
|
||||
# Seconds_Behind_Master is within specified master_delay limit. It should
|
||||
# not be more that "10" seconds.
|
||||
@@ -23,7 +23,7 @@ CREATE TABLE t1 (i INT);
|
||||
--sync_slave_with_master
|
||||
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO MASTER_USE_GTID= current_pos, MASTER_DELAY= 10;
|
||||
CHANGE MASTER TO MASTER_DELAY= 10;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
@@ -47,7 +47,7 @@ INSERT INTO t1 VALUES (1);
|
||||
|
||||
--echo "======= Clean up ========"
|
||||
STOP SLAVE;
|
||||
CHANGE MASTER TO MASTER_USE_GTID=no, MASTER_DELAY=0;
|
||||
CHANGE MASTER TO MASTER_DELAY=0;
|
||||
START SLAVE;
|
||||
|
||||
--connection master
|
||||
|
@@ -31,22 +31,18 @@ delimiter ;|
|
||||
--connection server_2
|
||||
--sync_with_master
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
|
||||
--connection server_3
|
||||
--sync_with_master
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
|
||||
--connection server_4
|
||||
--sync_with_master
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
|
||||
--connection server_5
|
||||
--sync_with_master
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
|
||||
|
||||
# Create three separate replication streams on master server_1.
|
||||
@@ -225,7 +221,7 @@ SELECT * FROM t4 ORDER BY a,b;
|
||||
--connection server_1
|
||||
--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2,
|
||||
master_user = "root", master_use_gtid = current_pos;
|
||||
master_user = "root", master_use_gtid = slave_pos, master_demote_to_slave=1;
|
||||
--source include/start_slave.inc
|
||||
--sync_with_master
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
@@ -24,7 +24,7 @@ reset slave all;
|
||||
connection server_1;
|
||||
--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2,
|
||||
master_user='root', MASTER_USE_GTID=CURRENT_POS;
|
||||
master_user='root', MASTER_USE_GTID=SLAVE_POS, master_demote_to_slave=1;
|
||||
source include/start_slave.inc;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
|
||||
@@ -38,7 +38,7 @@ save_master_pos;
|
||||
connection server_3;
|
||||
--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
source include/start_slave.inc;
|
||||
sync_with_master;
|
||||
|
||||
@@ -56,14 +56,14 @@ reset slave all;
|
||||
connection server_2;
|
||||
--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_1,
|
||||
master_user = 'root', MASTER_USE_GTID=CURRENT_POS;
|
||||
master_user = 'root', MASTER_USE_GTID=SLAVE_POS, master_demote_to_slave=1;
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection server_3;
|
||||
source include/stop_slave.inc;
|
||||
--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_1,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection server_1;
|
||||
|
@@ -13,7 +13,6 @@ CREATE TABLE t1 (a INT PRIMARY KEY);
|
||||
SET sql_log_bin= 0;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SET sql_log_bin= 1;
|
||||
CHANGE MASTER TO master_use_gtid= current_pos;
|
||||
|
||||
--connection master
|
||||
|
||||
|
@@ -25,7 +25,7 @@ SELECT * FROM t1 ORDER BY a;
|
||||
--connection server_1
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT,
|
||||
master_user = 'root', master_use_gtid = current_pos;
|
||||
master_user = 'root';
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
@@ -49,8 +49,7 @@ INSERT INTO t1 VALUES (6, 1);
|
||||
|
||||
--connection server_2
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
|
||||
master_use_gtid = current_pos;
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT;
|
||||
START SLAVE;
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
|
@@ -4,11 +4,6 @@
|
||||
--source include/have_debug.inc
|
||||
|
||||
|
||||
--connection server_2
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid= current_pos;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection server_1
|
||||
CREATE TABLE t1 (a INT);
|
||||
FLUSH LOGS;
|
||||
|
@@ -47,7 +47,7 @@ SHOW VARIABLES LIKE 'gtid_slave_pos';
|
||||
SHOW VARIABLES LIKE 'gtid_binlog_state';
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
--source include/start_slave.inc
|
||||
--sync_with_master
|
||||
SHOW VARIABLES LIKE 'gtid_binlog_pos';
|
||||
|
@@ -19,7 +19,7 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
SET GLOBAL gtid_slave_pos="";
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
--source include/start_slave.inc
|
||||
--sync_with_master
|
||||
SELECT * FROM t1;
|
||||
@@ -46,7 +46,7 @@ INSERT INTO t1 VALUES (2);
|
||||
SET GLOBAL gtid_slave_pos="";
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
START SLAVE;
|
||||
--let $slave_io_errno= 1236
|
||||
--source include/wait_for_slave_io_error.inc
|
||||
@@ -73,7 +73,7 @@ INSERT INTO t1 VALUES(3);
|
||||
SET GLOBAL gtid_slave_pos='0-1-3';
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
--source include/start_slave.inc
|
||||
--source include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 ORDER by a;
|
||||
@@ -118,7 +118,7 @@ RESET MASTER;
|
||||
--connection server_2
|
||||
SET GLOBAL gtid_slave_pos='';
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$MASTER_MYPORT, master_user='root', master_use_gtid=current_pos;
|
||||
eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$MASTER_MYPORT, master_user='root', master_use_gtid=slave_pos;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection server_1
|
||||
@@ -199,7 +199,7 @@ START SLAVE;
|
||||
|
||||
# Going back to using GTID should fix things.
|
||||
STOP SLAVE IO_THREAD;
|
||||
CHANGE MASTER TO MASTER_USE_GTID=CURRENT_POS;
|
||||
CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection server_1
|
||||
|
@@ -21,7 +21,6 @@ INSERT INTO t1 VALUES (1);
|
||||
--let $status_items= Master_Log_File,Using_Gtid
|
||||
--source include/show_slave_status.inc
|
||||
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
|
||||
# Now try to restart the slave mysqld server without starting the slave first
|
||||
# threads after the CHANGE MASTER.
|
||||
|
@@ -45,7 +45,7 @@ START SLAVE UNTIL master_gtid_pos = "";
|
||||
--error ER_UNTIL_REQUIRES_USING_GTID
|
||||
START SLAVE UNTIL master_gtid_pos = "";
|
||||
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
CHANGE MASTER TO master_use_gtid=slave_pos;
|
||||
|
||||
--connection server_1
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
@@ -224,7 +224,7 @@ INSERT INTO t1 VALUES (10);
|
||||
--connection server_2
|
||||
--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_1,
|
||||
master_user = "root", master_use_gtid = current_pos;
|
||||
master_user = "root", master_use_gtid = slave_pos;
|
||||
eval START SLAVE UNTIL master_gtid_pos = '$until_condition';
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
|
@@ -13,7 +13,6 @@ SET sql_log_bin= 0;
|
||||
CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
|
||||
INSERT INTO t1 VALUES (1, 2);
|
||||
SET sql_log_bin= 1;
|
||||
CHANGE MASTER TO master_use_gtid= current_pos;
|
||||
--echo Contents on slave before:
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
|
84
mysql-test/suite/rpl/t/rpl_parallel_analyze.test
Normal file
84
mysql-test/suite/rpl/t/rpl_parallel_analyze.test
Normal file
@@ -0,0 +1,84 @@
|
||||
# The test file is created to prove fixes to
|
||||
# MDEV-30323 Some DDLs like ANALYZE can complete on parallel slave out of order
|
||||
# Debug-sync tests aiming at parallel replication of ADMIN commands
|
||||
# are welcome here.
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--echo # Initialize
|
||||
--connection slave
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
|
||||
--echo # Setup data
|
||||
--connection master
|
||||
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE ta (a int);
|
||||
--let $pre_load_gtid=`SELECT @@last_gtid`
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
--connection slave
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
--source suite/rpl/include/create_or_drop_sync_func.inc
|
||||
|
||||
# configure MDEV-30323 slave
|
||||
--source include/stop_slave.inc
|
||||
SET @old_parallel_threads =@@GLOBAL.slave_parallel_threads;
|
||||
SET @old_parallel_mode =@@GLOBAL.slave_parallel_mode;
|
||||
SET @old_gtid_strict_mode =@@GLOBAL.gtid_strict_mode;
|
||||
SET GLOBAL slave_parallel_threads=10;
|
||||
SET GLOBAL slave_parallel_mode=conservative;
|
||||
SET GLOBAL gtid_strict_mode=ON;
|
||||
--source include/start_slave.inc
|
||||
|
||||
# MDEV-30323 setup needs two group of events the first of which is a DML
|
||||
# and ANALYZE is the 2nd.
|
||||
# The latter is made to race in slave execution over the DML thanks
|
||||
# to a DML latency simulation.
|
||||
# In the fixed case the race-over should not be a problem: ultimately
|
||||
# ANALYZE must wait for its turn to update slave@@global.gtid_binlog_pos.
|
||||
# Otherwise the reported OOO error must be issued.
|
||||
|
||||
--connection master
|
||||
SET @old_format= @@SESSION.binlog_format;
|
||||
SET binlog_format=statement;
|
||||
INSERT INTO t1 VALUES (foo(1, 'rpl_parallel_after_mark_start_commit WAIT_FOR sig_go', ''));
|
||||
|
||||
ANALYZE TABLE ta;
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
--connection slave
|
||||
--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit"
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT info FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit";
|
||||
if (`select strcmp(@@global.gtid_binlog_pos, '$pre_load_gtid') <> 0 or strcmp(@@global.gtid_slave_pos, '$pre_load_gtid') <> 0`)
|
||||
{
|
||||
--let $bs=`SELECT @@global.gtid_binlog_pos`
|
||||
--let $es=`SELECT @@global.gtid_slave_pos`
|
||||
--echo Mismatch between expected $pre_load_gtid state and the actual binlog state " @@global.gtid_binlog_pos = $bs or/and slave execution state @@global.gtid_slave_pos = $es.
|
||||
--die
|
||||
}
|
||||
|
||||
set @@debug_sync="now signal sig_go";
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
--echo # Cleanup
|
||||
--connection master
|
||||
DROP TABLE t1,ta;
|
||||
--let $create_or_drop=drop
|
||||
--source suite/rpl/include/create_or_drop_sync_func.inc
|
||||
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
--connection slave
|
||||
--source include/sync_with_master_gtid.inc
|
||||
--source include/stop_slave.inc
|
||||
SET @@GLOBAL.slave_parallel_threads=@old_parallel_threads;
|
||||
SET @@GLOBAL.slave_parallel_mode =@old_parallel_mode;
|
||||
SET @@GLOBAL.gtid_strict_mode =@old_gtid_strict_mode;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--source include/rpl_end.inc
|
@@ -7,7 +7,6 @@
|
||||
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
|
||||
--source include/stop_slave.inc
|
||||
SET GLOBAL slave_parallel_threads=10;
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
--source include/start_slave.inc
|
||||
|
||||
|
||||
|
@@ -25,7 +25,6 @@ SET GLOBAL binlog_commit_wait_usec=2000000;
|
||||
SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates;
|
||||
SET GLOBAL binlog_direct_non_transactional_updates=OFF;
|
||||
SET SESSION binlog_direct_non_transactional_updates=OFF;
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
|
||||
--connection server_3
|
||||
--sync_with_master
|
||||
@@ -33,7 +32,6 @@ CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
|
||||
--source include/stop_slave.inc
|
||||
SET GLOBAL slave_parallel_threads=10;
|
||||
CHANGE MASTER TO master_use_gtid=current_pos;
|
||||
|
||||
|
||||
--connection server_1
|
||||
|
@@ -12,7 +12,6 @@
|
||||
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
|
||||
--source include/stop_slave.inc
|
||||
SET GLOBAL slave_parallel_threads=5;
|
||||
CHANGE MASTER TO master_use_gtid= current_pos;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection server_1
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# Start Alter with binlog applied using mysqlbinlog
|
||||
# single maser with only one domain id
|
||||
# single master with only one domain id
|
||||
#
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
@@ -10,7 +10,6 @@
|
||||
set global binlog_alter_two_phase=true;
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
change master to master_use_gtid= current_pos;
|
||||
set global gtid_strict_mode=1;
|
||||
|
||||
--echo # Legacy Master Slave
|
||||
|
@@ -4,7 +4,6 @@
|
||||
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=CURRENT_POS;
|
||||
--let $datadir= `SELECT @@datadir`
|
||||
|
||||
--let $rpl_server_number= 2
|
||||
|
Reference in New Issue
Block a user