diff options
Diffstat (limited to 'mysql-test/suite/rpl/r')
51 files changed, 1020 insertions, 234 deletions
diff --git a/mysql-test/suite/rpl/r/parallel_backup.result b/mysql-test/suite/rpl/r/parallel_backup.result index 83c7a916..36183892 100644 --- a/mysql-test/suite/rpl/r/parallel_backup.result +++ b/mysql-test/suite/rpl/r/parallel_backup.result @@ -125,7 +125,7 @@ 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.innodb_lock_wait_timeout =5; SET @@global.slave_transaction_retries=0; include/start_slave.inc connection aux_slave; @@ -168,7 +168,7 @@ 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.innodb_lock_wait_timeout =5; SET @@global.slave_transaction_retries=0; include/start_slave.inc connection aux_slave; diff --git a/mysql-test/suite/rpl/r/parallel_backup_lsu_off.result b/mysql-test/suite/rpl/r/parallel_backup_lsu_off.result index e1fd7701..08955a77 100644 --- a/mysql-test/suite/rpl/r/parallel_backup_lsu_off.result +++ b/mysql-test/suite/rpl/r/parallel_backup_lsu_off.result @@ -128,7 +128,7 @@ 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.innodb_lock_wait_timeout =5; SET @@global.slave_transaction_retries=0; include/start_slave.inc connection aux_slave; @@ -171,7 +171,7 @@ 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.innodb_lock_wait_timeout =5; SET @@global.slave_transaction_retries=0; include/start_slave.inc connection aux_slave; diff --git a/mysql-test/suite/rpl/r/parallel_backup_slave_binlog_off.result b/mysql-test/suite/rpl/r/parallel_backup_slave_binlog_off.result index 9e29e5a3..bb00bf9c 100644 --- a/mysql-test/suite/rpl/r/parallel_backup_slave_binlog_off.result +++ b/mysql-test/suite/rpl/r/parallel_backup_slave_binlog_off.result @@ -128,7 +128,7 @@ 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.innodb_lock_wait_timeout =5; SET @@global.slave_transaction_retries=0; include/start_slave.inc connection aux_slave; @@ -171,7 +171,7 @@ 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.innodb_lock_wait_timeout =5; SET @@global.slave_transaction_retries=0; include/start_slave.inc connection aux_slave; diff --git a/mysql-test/suite/rpl/r/rpl_auditing.result b/mysql-test/suite/rpl/r/rpl_auditing.result new file mode 100644 index 00000000..1861beb4 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_auditing.result @@ -0,0 +1,64 @@ +include/master-slave.inc +[connection master] +drop table if exists t1; +connection slave; +reset master; +CREATE TABLE IF NOT EXISTS mysql.server_audit_filters ( +filtername char(80) COLLATE utf8_bin NOT NULL DEFAULT '', +rule longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'true' CHECK (json_valid(rule)), +CONSTRAINT c_filtername UNIQUE (filtername) +) ENGINE=Aria; +CREATE TABLE IF NOT EXISTS mysql.server_audit_users (host char(60) COLLATE utf8_bin NOT NULL DEFAULT '', +user char(80) COLLATE utf8_bin NOT NULL DEFAULT '', +filtername char(80) NOT NULL DEFAULT '', +CONSTRAINT c_host_user UNIQUE (host, user) +) ENGINE=Aria; +INSERT INTO mysql.server_audit_filters VALUES ('ignore_sys', '{"ignore_tables" : "mysql.*"}'); +INSERT INTO mysql.server_audit_users VALUES ('%','<replication_slave>','ignore_sys'); +INSERT INTO mysql.server_audit_users VALUES ('%','root','ignore_sys'); +install plugin server_audit soname 'server_audit2'; +set global server_audit_logging=on; +connection master; +create table t1 (a int); +insert into t1 values (1); +truncate t1; +drop table t1; +connection slave; +set global server_audit_logging=off; +truncate mysql.server_audit_filters; +truncate mysql.server_audit_users; +INSERT INTO mysql.server_audit_filters VALUES ('no_logging','false'); +INSERT INTO mysql.server_audit_users VALUES ('%','<replication_slave>','no_logging'); +set global server_audit_logging=on; +connection master; +create table t1 (a int); +insert into t1 values (1); +truncate t1; +drop table t1; +connection slave; +set global server_audit_logging=off; +uninstall plugin server_audit; +Warnings: +Warning 1620 Plugin is busy and will be uninstalled on shutdown +truncate mysql.server_audit_filters; +truncate mysql.server_audit_users; +TIME,HOSTNAME,,,0,0,AUDIT_CONFIG,,file_path=server_audit.log,0 +TIME,HOSTNAME,,,0,0,AUDIT_CONFIG,,rotate_size=1000000,0 +TIME,HOSTNAME,,,0,0,AUDIT_CONFIG,,file_rotations=9,0 +TIME,HOSTNAME,root,localhost,ID,0,AUDIT_CONFIG,test,logging=ON,0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_logging=on',0 +TIME,HOSTNAME,<replication_slave>,,ID,ID,CREATE,test,t1, +TIME,HOSTNAME,<replication_slave>,,ID,ID,WRITE,test,t1, +TIME,HOSTNAME,<replication_slave>,,ID,ID,CREATE,test,t1, +TIME,HOSTNAME,<replication_slave>,,ID,ID,DROP,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select master_pos_wait(\'master-bin.#', POS, 300, \'\')',0 +TIME,HOSTNAME,root,localhost,ID,0,AUDIT_CONFIG,test,logging=OFF,0 +TIME,HOSTNAME,,,0,0,AUDIT_CONFIG,,file_path=server_audit.log,0 +TIME,HOSTNAME,,,0,0,AUDIT_CONFIG,,rotate_size=1000000,0 +TIME,HOSTNAME,,,0,0,AUDIT_CONFIG,,file_rotations=9,0 +TIME,HOSTNAME,root,localhost,ID,0,AUDIT_CONFIG,test,logging=ON,0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_logging=on',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select master_pos_wait(\'master-bin.#', POS, 300, \'\')',0 +TIME,HOSTNAME,root,localhost,ID,0,AUDIT_CONFIG,test,logging=OFF,0 +connection master; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_binlog_dump_slave_gtid_state_info.result b/mysql-test/suite/rpl/r/rpl_binlog_dump_slave_gtid_state_info.result index af79b482..20dd9076 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_dump_slave_gtid_state_info.result +++ b/mysql-test/suite/rpl/r/rpl_binlog_dump_slave_gtid_state_info.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] connection master; +SET @org_log_warnings=@@GLOBAL.LOG_WARNINGS; SET GLOBAL LOG_WARNINGS=2; connection slave; include/stop_slave.inc @@ -41,11 +42,11 @@ connection master; include/wait_for_pattern_in_file.inc FOUND 1 /using_gtid\(1\), gtid\(\'0-1-2,10-1-1\'\).*/ in mysqld.1.err "===== Clean up =====" +SET GLOBAL LOG_WARNINGS=@org_log_warnings; connection slave; include/stop_slave.inc CHANGE MASTER TO MASTER_USE_GTID=no; include/start_slave.inc connection master; DROP TABLE t; -SET GLOBAL LOG_WARNINGS=default; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_change_master.result b/mysql-test/suite/rpl/r/rpl_change_master.result index 88801b07..48cec72d 100644 --- a/mysql-test/suite/rpl/r/rpl_change_master.result +++ b/mysql-test/suite/rpl/r/rpl_change_master.result @@ -26,9 +26,4 @@ connection master; CHANGE MASTER TO MASTER_USER='root', MASTER_SSL=0, MASTER_SSL_CA='', MASTER_SSL_CERT='', MASTER_SSL_KEY='', MASTER_SSL_CRL='', MASTER_SSL_CRLPATH=''; CHANGE MASTER TO MASTER_USER='root', MASTER_PASSWORD='', MASTER_SSL=0; -"Usage of CURRENT_POS in CHANGE MASTER MASTER_USE_GTID is dreprecated. -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/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_change_master_demote.result b/mysql-test/suite/rpl/r/rpl_change_master_demote.result index 70d141ef..2114ac4a 100644 --- a/mysql-test/suite/rpl/r/rpl_change_master_demote.result +++ b/mysql-test/suite/rpl/r/rpl_change_master_demote.result @@ -683,6 +683,23 @@ connection master; CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=Slave_Pos, master_demote_to_slave=invalid; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'invalid' at line 1 # +# MDEV-31768 +# Ensure MASTER_DEMOTE_TO_REPLICA aliases MASTER_DEMOTE_TO_SLAVE +# +connection slave; +RESET MASTER; +include/reset_slave.inc +CREATE TABLE t_mdev_31768 (a int); +CHANGE MASTER TO master_use_gtid=Replica_Pos, master_demote_to_replica=1; +# Validating alias MASTER_DEMOTE_TO_REPLICA provides intended behavior.. +# ..success +DROP TABLE t_mdev_31768; +RESET MASTER; +include/reset_slave.inc +# Clear primary binlog state to match replica +connection master; +RESET MASTER; +# # Cleanup # connection master; diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result index 5250c4bb..9d3b2ccd 100644 --- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result +++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result @@ -11,6 +11,7 @@ SELECT * FROM t1; i 1 connection slave; +include/save_master_gtid.inc connection slave; call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*"); # Case 0 : Start slave with IGNORE_DOMAIN_IDS=(), then restart @@ -24,6 +25,7 @@ DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos; include/start_slave.inc +include/sync_with_master_gtid.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : SET @saved_dbug = @@GLOBAL.debug_dbug; @@ -33,6 +35,7 @@ START TRANSACTION; INSERT INTO t1 VALUES(2); INSERT INTO t1 VALUES(3); COMMIT; +include/save_master_gtid.inc SELECT * FROM t1; i 1 @@ -46,6 +49,7 @@ i SET @@global.debug_dbug=@saved_dbug; START SLAVE io_thread; include/wait_for_slave_io_to_start.inc +include/sync_with_master_gtid.inc SELECT * FROM t1; i 1 @@ -59,6 +63,7 @@ DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos; include/start_slave.inc +include/sync_with_master_gtid.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : 1 SET @@global.debug_dbug="d,kill_slave_io_before_commit"; @@ -67,6 +72,7 @@ START TRANSACTION; INSERT INTO t1 VALUES(4); INSERT INTO t1 VALUES(5); COMMIT; +include/save_master_gtid.inc SELECT * FROM t1; i 1 @@ -84,6 +90,7 @@ i SET @@global.debug_dbug=@saved_dbug; START SLAVE io_thread; include/wait_for_slave_io_to_start.inc +include/sync_with_master_gtid.inc SELECT * FROM t1; i 1 @@ -97,6 +104,7 @@ DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : 1 CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos; include/start_slave.inc +include/sync_with_master_gtid.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : SET @@global.debug_dbug="d,kill_slave_io_before_commit"; @@ -114,6 +122,7 @@ START TRANSACTION; INSERT INTO t1 VALUES(10); INSERT INTO t1 VALUES(11); COMMIT; +include/save_master_gtid.inc SELECT * FROM t1; i 1 @@ -140,6 +149,7 @@ DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos; include/start_slave.inc +include/sync_with_master_gtid.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : 1 SELECT * FROM t1; @@ -157,6 +167,7 @@ DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : 1 CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos; include/start_slave.inc +include/sync_with_master_gtid.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : 1 SET @@global.debug_dbug="d,kill_slave_io_before_commit"; @@ -166,6 +177,7 @@ START TRANSACTION; INSERT INTO t1 VALUES(12); INSERT INTO t1 VALUES(13); COMMIT; +include/save_master_gtid.inc START TRANSACTION; INSERT INTO t1 VALUES(14); INSERT INTO t1 VALUES(15); @@ -204,11 +216,16 @@ i 10 11 SET @@global.debug_dbug=@saved_dbug; +include/sync_with_master_gtid.inc include/stop_slave_sql.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : 1 CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos; +connection master; +include/save_master_gtid.inc +connection slave; include/start_slave.inc +include/sync_with_master_gtid.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : SELECT * FROM t1; @@ -230,6 +247,7 @@ DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos; include/start_slave.inc +include/sync_with_master_gtid.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : 1 SET @@global.debug_dbug="d,kill_slave_io_after_2_events"; @@ -239,6 +257,7 @@ START TRANSACTION; INSERT INTO t1 VALUES(18); INSERT INTO t1 VALUES(19); COMMIT; +include/save_master_gtid.inc START TRANSACTION; INSERT INTO t1 VALUES(20); INSERT INTO t1 VALUES(21); @@ -287,11 +306,16 @@ i 16 17 SET @@global.debug_dbug=@saved_dbug; +include/sync_with_master_gtid.inc include/stop_slave_sql.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : 1 CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos; +connection master; +include/save_master_gtid.inc +connection slave; include/start_slave.inc +include/sync_with_master_gtid.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : SELECT * FROM t1; @@ -317,6 +341,7 @@ DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos; include/start_slave.inc +include/sync_with_master_gtid.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : SET @@global.debug_dbug="d,kill_slave_io_after_2_events"; @@ -335,6 +360,7 @@ START TRANSACTION; INSERT INTO t1 VALUES(28); INSERT INTO t1 VALUES(29); COMMIT; +include/save_master_gtid.inc SELECT * FROM t1; i 1 @@ -389,6 +415,7 @@ DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos; include/start_slave.inc +include/sync_with_master_gtid.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : 1 SELECT * FROM t1; diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result index a54ff99b..cd13590b 100644 --- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result +++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result @@ -1,9 +1,6 @@ include/master-slave.inc [connection master] connection master; -call mtr.add_suppression("mysqld: Table '.*gtid_slave_pos' is marked as crashed and should be repaired"); -call mtr.add_suppression("Checking table: './mysql/gtid_slave_pos'"); -call mtr.add_suppression("mysql.gtid_slave_pos: 1 client is using or hasn't closed the table properly"); SET @@session.gtid_domain_id= 0; create table ti (a int auto_increment primary key) engine=innodb; create table tm (a int auto_increment primary key) engine=myisam; diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result index f6eff3f9..948b4f48 100644 --- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result +++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result @@ -21,8 +21,9 @@ INSERT INTO t2 VALUES(1); SELECT * FROM t2; i 1 +include/save_master_gtid.inc connection slave; -connection slave; +include/sync_with_master_gtid.inc SELECT * FROM t1; i 1 diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result index be98b7e3..145b269a 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result @@ -657,7 +657,7 @@ START SLAVE; STOP SLAVE; include/reset_slave.inc 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-103. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos +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-104. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='InnoDB'; @@ -697,7 +697,7 @@ Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default databas STOP SLAVE; include/reset_slave.inc 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-104. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos +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-105. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos *** Drop t15 *** DROP TABLE t15; @@ -716,7 +716,7 @@ START SLAVE; STOP SLAVE; include/reset_slave.inc 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-105. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos +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-106. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='InnoDB'; @@ -756,7 +756,7 @@ Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Defau STOP SLAVE; include/reset_slave.inc 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-106. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos +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-107. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos *** Drop t16 *** DROP TABLE t16; @@ -775,7 +775,7 @@ START SLAVE; STOP SLAVE; include/reset_slave.inc 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-107. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos +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-108. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='InnoDB'; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result index 53b20b18..dae497d5 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result @@ -657,7 +657,7 @@ START SLAVE; STOP SLAVE; include/reset_slave.inc 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-103. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos +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-104. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='MyISAM'; @@ -697,7 +697,7 @@ Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default databas STOP SLAVE; include/reset_slave.inc 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-104. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos +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-105. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos *** Drop t15 *** DROP TABLE t15; @@ -716,7 +716,7 @@ START SLAVE; STOP SLAVE; include/reset_slave.inc 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-105. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos +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-106. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='MyISAM'; @@ -756,7 +756,7 @@ Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Defau STOP SLAVE; include/reset_slave.inc 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-106. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos +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-107. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos *** Drop t16 *** DROP TABLE t16; @@ -775,7 +775,7 @@ START SLAVE; STOP SLAVE; include/reset_slave.inc 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-107. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos +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-108. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='MyISAM'; diff --git a/mysql-test/suite/rpl/r/rpl_get_lock.result b/mysql-test/suite/rpl/r/rpl_get_lock.result index b852546e..cbb02a32 100644 --- a/mysql-test/suite/rpl/r/rpl_get_lock.result +++ b/mysql-test/suite/rpl/r/rpl_get_lock.result @@ -1,6 +1,6 @@ include/master-slave.inc [connection master] -CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +SET GLOBAL LOG_WARNINGS=4; create table t1(n int); insert into t1 values(get_lock("lock",2)); disconnect master; @@ -35,4 +35,5 @@ NULL connection master1; drop table t1; connection slave; +connection default; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_basic.result b/mysql-test/suite/rpl/r/rpl_gtid_basic.result index a7da7010..afc700a7 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_basic.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_basic.result @@ -69,8 +69,6 @@ INSERT INTO t2 VALUES (5, "i1a"); connection server_4; 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 include/start_slave.inc SELECT * FROM t1 ORDER BY a; a b @@ -91,8 +89,6 @@ connection server_2; include/stop_slave.inc CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4, 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_4; UPDATE t2 SET b="j1a" WHERE a=5; @@ -121,8 +117,6 @@ include/save_master_gtid.inc connection server_3; CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4, 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 include/sync_with_master_gtid.inc SELECT * FROM t2 ORDER BY a; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result index 179461ad..c47beacf 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result @@ -4,6 +4,7 @@ connection server_1; call mtr.add_suppression("Checking table:"); call mtr.add_suppression("client is using or hasn't closed the table properly"); call mtr.add_suppression("Table .* is marked as crashed and should be repaired"); +call mtr.add_suppression("Could not read packet:.* errno: 11"); flush tables; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result index a7cb710c..4c35d42d 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result @@ -75,8 +75,6 @@ INSERT INTO t1 VALUES (2); SET sql_log_bin = 1; INSERT INTO t1 VALUES (3); 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 BEGIN; SET GLOBAL gtid_slave_pos = "100-100-100"; ERROR 25000: You are not allowed to execute this command in a transaction diff --git a/mysql-test/suite/rpl/r/rpl_gtid_grouping.result b/mysql-test/suite/rpl/r/rpl_gtid_grouping.result index ad7d6116..1b4d86dd 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_grouping.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_grouping.result @@ -50,5 +50,4 @@ CHANGE MASTER TO MASTER_USE_GTID=no; include/start_slave.inc connection master; DROP TABLE t; -SET GLOBAL LOG_WARNINGS=default; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_header_valid.result b/mysql-test/suite/rpl/r/rpl_gtid_header_valid.result new file mode 100644 index 00000000..6731abc2 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_gtid_header_valid.result @@ -0,0 +1,146 @@ +include/master-slave.inc +[connection master] +# +# Initialize test data +connection master; +create table t1 (a int) engine=innodb; +include/save_master_gtid.inc +set @@SESSION.debug_dbug= "+d,binlog_force_commit_id"; +connection slave; +set SQL_LOG_BIN= 0; +call mtr.add_suppression('Found invalid event in binary log'); +call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594'); +set SQL_LOG_BIN= 1; +include/sync_with_master_gtid.inc +include/stop_slave.inc +include/start_slave.inc +# +# Test FL_PREPARED_XA +connection master; +set @@SESSION.debug_dbug= "+d,negate_xid_from_gtid"; +set @commit_id= 100; +XA START 'x1'; +insert into t1 values (1); +XA END 'x1'; +XA PREPARE 'x1'; +set @@SESSION.debug_dbug= "-d,negate_xid_from_gtid"; +XA COMMIT 'x1'; +include/save_master_gtid.inc +# Waiting for slave to find invalid event.. +connection slave; +include/wait_for_slave_sql_error.inc [errno=1594] +STOP SLAVE IO_THREAD; +# Reset master binlogs (as there is an invalid event) and slave state +connection master; +RESET MASTER; +connection slave; +RESET MASTER; +RESET SLAVE; +set @@global.gtid_slave_pos=""; +include/start_slave.inc +# +# Test FL_COMPLETED_XA +connection master; +set @commit_id= 101; +XA START 'x1'; +insert into t1 values (2); +XA END 'x1'; +XA PREPARE 'x1'; +set @@SESSION.debug_dbug= "+d,negate_xid_from_gtid"; +XA COMMIT 'x1'; +set @@SESSION.debug_dbug= "-d,negate_xid_from_gtid"; +include/save_master_gtid.inc +# Waiting for slave to find invalid event.. +connection slave; +include/wait_for_slave_sql_error.inc [errno=1594] +STOP SLAVE IO_THREAD; +# Cleanup hanging XA PREPARE on slave +set statement SQL_LOG_BIN=0 for XA COMMIT 'x1'; +# Reset master binlogs (as there is an invalid event) and slave state +connection master; +RESET MASTER; +connection slave; +RESET MASTER; +RESET SLAVE; +set @@global.gtid_slave_pos=""; +include/start_slave.inc +# +# Test Missing xid.data (but has format id and length description parts) +connection master; +set @commit_id= 101; +XA START 'x1'; +insert into t1 values (1); +XA END 'x1'; +XA PREPARE 'x1'; +set @@SESSION.debug_dbug= "+d,negate_xid_data_from_gtid"; +XA COMMIT 'x1'; +set @@SESSION.debug_dbug= "-d,negate_xid_data_from_gtid"; +include/save_master_gtid.inc +# Waiting for slave to find invalid event.. +connection slave; +include/wait_for_slave_sql_error.inc [errno=1594] +STOP SLAVE IO_THREAD; +# Cleanup hanging XA PREPARE on slave +set statement SQL_LOG_BIN=0 for XA COMMIT 'x1'; +# Reset master binlogs (as there is an invalid event) and slave state +connection master; +RESET MASTER; +connection slave; +RESET MASTER; +RESET SLAVE; +set @@global.gtid_slave_pos=""; +include/start_slave.inc +# +# Test FL_EXTRA_MULTI_ENGINE +connection master; +set @old_dbug= @@SESSION.debug_dbug; +set @@SESSION.debug_dbug= "+d,inject_fl_extra_multi_engine_into_gtid"; +set @commit_id= 102; +insert into t1 values (3); +include/save_master_gtid.inc +set @@SESSION.debug_dbug=@old_dbug; +connection slave; +# Waiting for slave to find invalid event.. +include/wait_for_slave_sql_error.inc [errno=1594] +STOP SLAVE IO_THREAD; +# Reset master binlogs (as there is an invalid event) and slave state +connection master; +RESET MASTER; +connection slave; +RESET SLAVE; +RESET MASTER; +set @@global.gtid_slave_pos=""; +include/start_slave.inc +# +# Test FL_COMMIT_ALTER +connection master; +set @old_dbug= @@SESSION.debug_dbug; +set @@SESSION.debug_dbug= "+d,negate_alter_fl_from_gtid"; +set @old_alter_tp= @@SESSION.binlog_alter_two_phase; +set @@SESSION.binlog_alter_two_phase= 1; +alter table t1 add column (nc int); +include/save_master_gtid.inc +set @@SESSION.debug_dbug=@old_dbug; +set @@SESSION.binlog_alter_two_phase=@old_alter_tp; +connection slave; +# Waiting for slave to find invalid event.. +include/wait_for_slave_sql_error.inc [errno=1594] +STOP SLAVE IO_THREAD; +# Reset master binlogs (as there is an invalid event) and slave state +connection master; +RESET MASTER; +connection slave; +SET STATEMENT sql_log_bin=0 FOR alter table t1 add column (nc int); +RESET SLAVE; +RESET MASTER; +set @@global.gtid_slave_pos=""; +include/start_slave.inc +# +# Cleanup +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_gtid_header_valid.test diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result index cea5aaae..665fc536 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result @@ -45,8 +45,6 @@ SET GLOBAL gtid_slave_pos= '0-2-10'; 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 START SLAVE; connection server_2; INSERT INTO t1 VALUES (11); @@ -76,8 +74,6 @@ connection server_2; INSERT INTO t1 VALUES (22); 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 START SLAVE; SET sql_log_bin= 0; CALL mtr.add_suppression("which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged"); diff --git a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result index ae0050c3..e8633cd4 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result @@ -111,6 +111,10 @@ a 6 7 *** MDEV-4486: Allow to start old-style replication even if mysql.gtid_slave_pos is unavailable +connection server_1; +INSERT INTO t1 VALUES (8); +DELETE FROM t1 WHERE a=8; +connection server_2; connection server_2; include/stop_slave.inc CHANGE MASTER TO master_use_gtid= no; diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result index 2a578245..c9baf960 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result @@ -1,8 +1,9 @@ -connect master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; -connect slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK; +include/master-slave.inc +[connection master] connection master; reset master; connection slave; +include/stop_slave.inc set @restore_slave_net_timeout= @@global.slave_net_timeout; set @@global.slave_net_timeout= 10; change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; @@ -68,5 +69,5 @@ connection master; drop table t1; connection slave; set @@global.slave_net_timeout= @restore_slave_net_timeout; -include/stop_slave.inc +include/rpl_end.inc End of tests diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_debug.result b/mysql-test/suite/rpl/r/rpl_heartbeat_debug.result index dc45c0b9..a89010cd 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_debug.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_debug.result @@ -9,8 +9,6 @@ Variable_name Slave_heartbeat_period Value 60.000 SET @saved_dbug= @@GLOBAL.debug_dbug; SET GLOBAL debug_dbug="+d,simulate_slave_heartbeat_network_error"; -CALL mtr.add_suppression('SET @master_heartbeat_period to master failed with error'); -CALL mtr.add_suppression('Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again'); include/start_slave.inc connection master; drop table if exists t1; diff --git a/mysql-test/suite/rpl/r/rpl_mark_optimize_tbl_ddl.result b/mysql-test/suite/rpl/r/rpl_mark_optimize_tbl_ddl.result index 9aa31a73..09edd288 100644 --- a/mysql-test/suite/rpl/r/rpl_mark_optimize_tbl_ddl.result +++ b/mysql-test/suite/rpl/r/rpl_mark_optimize_tbl_ddl.result @@ -55,7 +55,6 @@ PARTITION pmax VALUES LESS THAN (MAXVALUE)); INSERT INTO t1 VALUES (1), (10), (100), (1000); ALTER TABLE t1 ANALYZE PARTITION p0; Table Op Msg_type Msg_text -test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK ALTER TABLE t1 OPTIMIZE PARTITION p0; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/rpl/r/rpl_mdev33798.result b/mysql-test/suite/rpl/r/rpl_mdev33798.result new file mode 100644 index 00000000..8796e948 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mdev33798.result @@ -0,0 +1,143 @@ +include/rpl_init.inc [topology=1->2,1->3] +connect server_2b,127.0.0.1,root,,,$SERVER_MYPORT_2; +connection server_2; +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +SET @old_parallel_mode= @@GLOBAL.slave_parallel_mode; +SET @old_timeout= @@GLOBAL.lock_wait_timeout; +SET @old_innodb_timeout= @@GLOBAL.innodb_lock_wait_timeout; +include/stop_slave.inc +SET GLOBAL slave_parallel_threads=5; +set global slave_parallel_mode= aggressive; +SET GLOBAL lock_wait_timeout= 86400; +SET GLOBAL innodb_lock_wait_timeout= 86400; +SET STATEMENT sql_log_bin=0 FOR ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +include/start_slave.inc +connection server_1; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0), (7, 0), (8, 0); +connection server_2; +include/stop_slave.inc +connection server_2b; +BEGIN; +SELECT * FROM t1 WHERE a=1 FOR UPDATE; +a b +1 0 +SELECT * FROM t1 WHERE a=5 FOR UPDATE; +a b +5 0 +connection server_1; +SET SESSION gtid_domain_id= 1; +BEGIN; +UPDATE t1 SET b=1 WHERE a=1; +UPDATE t1 SET b=1 WHERE a=7; +COMMIT; +UPDATE t1 SET b=2 WHERE a=3; +SET SESSION gtid_domain_id=2; +BEGIN; +UPDATE t1 SET b=3 WHERE a=5; +UPDATE t1 SET b=3 WHERE a=3; +COMMIT; +UPDATE t1 SET b=4 WHERE a=7; +SET SESSION gtid_domain_id= 0; +include/save_master_gtid.inc +connection server_2; +include/start_slave.inc +connection server_2b; +ROLLBACK; +connection server_2; +include/sync_with_master_gtid.inc +SELECT a, ( +(a=1 AND b=1) OR +(a=3 AND (b=2 OR b=3)) OR +(a=5 AND b=3) OR +(a=7 AND (b=1 OR b=4)) OR +((a MOD 2)=0 AND b=0)) AS `ok` + FROM t1 +ORDER BY a; +a ok +1 1 +2 1 +3 1 +4 1 +5 1 +6 1 +7 1 +8 1 +connection server_3; +include/sync_with_master_gtid.inc +include/stop_slave.inc +connection server_2; +include/stop_slave.inc +CHANGE MASTER 'm2' to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos; +connection server_1; +SET SESSION gtid_domain_id= 1; +BEGIN; +UPDATE t1 SET b=11 WHERE a=1; +UPDATE t1 SET b=11 WHERE a=7; +COMMIT; +UPDATE t1 SET b=12 WHERE a=3; +SET SESSION gtid_domain_id= 1; +connection server_3; +SET SESSION gtid_domain_id=3; +BEGIN; +UPDATE t1 SET b=13 WHERE a=5; +UPDATE t1 SET b=13 WHERE a=3; +COMMIT; +UPDATE t1 SET b=14 WHERE a=7; +include/save_master_gtid.inc +connection server_2b; +BEGIN; +SELECT * FROM t1 WHERE a=1 FOR UPDATE; +a b +1 1 +SELECT * FROM t1 WHERE a=5 FOR UPDATE; +a b +5 3 +START ALL SLAVES; +Warnings: +Note 1937 SLAVE 'm2' started +Note 1937 SLAVE '' started +connection server_2b; +ROLLBACK; +connection server_1; +include/save_master_gtid.inc +connection server_2; +include/sync_with_master_gtid.inc +connection server_3; +include/save_master_gtid.inc +connection server_2; +include/sync_with_master_gtid.inc +SELECT a, ( +(a=1 AND b=11) OR +(a=3 AND (b=12 OR b=13)) OR +(a=5 AND b=13) OR +(a=7 AND (b=11 OR b=14)) OR +((a MOD 2)=0 AND b=0)) AS `ok` + FROM t1 +ORDER BY a; +a ok +1 1 +2 1 +3 1 +4 1 +5 1 +6 1 +7 1 +8 1 +SET default_master_connection = 'm2'; +include/stop_slave.inc +RESET SLAVE 'm2' ALL; +SET default_master_connection = ''; +connection server_3; +include/start_slave.inc +disconnect server_2b; +connection server_1; +DROP TABLE t1; +connection server_2; +include/stop_slave.inc +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +set global slave_parallel_mode= @old_parallel_mode; +SET GLOBAL lock_wait_timeout= @old_timeout; +SET GLOBAL innodb_lock_wait_timeout= @old_innodb_timeout; +include/start_slave.inc +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_mysql_manager_race_condition.result b/mysql-test/suite/rpl/r/rpl_mysql_manager_race_condition.result index 1172d8e3..740d1ddf 100644 --- a/mysql-test/suite/rpl/r/rpl_mysql_manager_race_condition.result +++ b/mysql-test/suite/rpl/r/rpl_mysql_manager_race_condition.result @@ -17,6 +17,36 @@ include/sync_with_master_gtid.inc include/rpl_restart_server.inc [server_number=2 parameters: --debug_dbug="+d,delay_start_handle_manager"] include/start_slave.inc # +# MDEV-33799 +# Ensure that when the binary log is used for recovery (as tc log), that +# the recovery process cannot start the binlog background thread before +# the mysql handle manager has started. +connection slave; +# Add test suppresssions so crash recovery messages don't fail the test +set session sql_log_bin=0; +call mtr.add_suppression("mariadbd: Got error '145.*"); +call mtr.add_suppression("Checking table:.*"); +call mtr.add_suppression("mysql.gtid_slave_pos:.*hasn't closed the table properly"); +call mtr.add_suppression("Can't init tc log"); +call mtr.add_suppression("Aborting"); +set session sql_log_bin=1; +# Create slave-side only table +create table t2 (a int) engine=innodb; +# Crash mariadbd when binlogging transaction to corrupt database state +connection slave1; +set @@session.debug_dbug="+d,crash_before_writing_xid"; +insert into t2 values (1); +connection slave; +connection slave1; +Got one of the listed errors +# Restart mariadbd in recovery mode. Note --tc-heuristic-recover +# forces mysqld to exit with error, so we run mariadbd via CLI +# MYSQLD_LAST_CMD --debug_dbug="+d,delay_start_handle_manager" --tc-heuristic-recover=COMMIT +connection server_2; +connection slave1; +connection slave; +include/start_slave.inc +# # Cleanup # connection master; @@ -24,4 +54,5 @@ drop table t1; include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc +drop table t2; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 4a2a5d70..bb626960 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -2,6 +2,8 @@ include/master-slave.inc [connection master] call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153"); call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet"); +call mtr.add_suppression("Could not write packet:"); +call mtr.add_suppression("Got a packet bigger than 'max_allowed_packet' bytes"); drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; connection master; diff --git a/mysql-test/suite/rpl/r/rpl_parallel_multi_domain_xa.result b/mysql-test/suite/rpl/r/rpl_parallel_multi_domain_xa.result new file mode 100644 index 00000000..1993d098 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_parallel_multi_domain_xa.result @@ -0,0 +1,58 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction"); +call mtr.add_suppression("WSREP: handlerton rollback failed"); +connection master; +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +connection slave; +include/stop_slave.inc +SET @old_transaction_retries = @@GLOBAL.slave_transaction_retries; +SET @@global.slave_transaction_retries = 1000; +SET @old_parallel_threads = @@GLOBAL.slave_parallel_threads; +SET @old_slave_domain_parallel_threads = @@GLOBAL.slave_domain_parallel_threads; +SET @@global.slave_parallel_threads = 5; +SET @@global.slave_domain_parallel_threads = 3; +SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode; +CHANGE MASTER TO master_use_gtid=slave_pos; +connection master; +CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 0); +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +include/stop_slave.inc +SET @@global.slave_parallel_mode ='optimistic'; +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +include/stop_slave.inc +connection master; +include/save_master_gtid.inc +connection slave; +SET @@global.slave_parallel_mode ='conservative'; +include/start_slave.inc +include/sync_with_master_gtid.inc +include/stop_slave.inc +include/save_master_gtid.inc +connection slave; +SET @@global.slave_parallel_mode = 'optimistic'; +include/start_slave.inc +include/sync_with_master_gtid.inc +include/diff_tables.inc [master:t1, slave:t1] +connection slave; +include/stop_slave.inc +SET @@global.slave_parallel_mode = @old_parallel_mode; +SET @@global.slave_parallel_threads = @old_parallel_threads; +SET @@global.slave_domain_parallel_threads = @old_slave_domain_parallel_threads; +SET @@global.slave_transaction_retries = @old_transaction_retries; +include/start_slave.inc +connection master; +DROP TABLE t1; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +connection master; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result index eff93951..0b317c46 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result @@ -626,6 +626,7 @@ include/save_master_gtid.inc connection server_2; include/sync_with_master_gtid.inc connection server_2; +SET @org_log_warnings=@@GLOBAL.LOG_WARNINGS; set global log_warnings=2; BEGIN; INSERT INTO t1 SET a=1; @@ -651,7 +652,7 @@ connection server_2; include/sync_with_master_gtid.inc connection server_2; include/stop_slave.inc -set global log_warnings=default; +set global log_warnings=@org_log_warnings; SET GLOBAL slave_parallel_mode=@old_parallel_mode; SET GLOBAL slave_parallel_threads=@old_parallel_threads; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_xa.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_xa.result index 4136f188..90c3e5db 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_xa.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_xa.result @@ -32,7 +32,6 @@ include/diff_tables.inc [master:t0, slave:t0] include/diff_tables.inc [master:t1, slave:t1] connection slave; include/stop_slave.inc -set global log_warnings=default; SET GLOBAL slave_parallel_mode=@old_parallel_mode; SET GLOBAL slave_parallel_threads=@old_parallel_threads; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_xa_lsu_off.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_xa_lsu_off.result index 4136f188..90c3e5db 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_xa_lsu_off.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_xa_lsu_off.result @@ -32,7 +32,6 @@ include/diff_tables.inc [master:t0, slave:t0] include/diff_tables.inc [master:t1, slave:t1] connection slave; include/stop_slave.inc -set global log_warnings=default; SET GLOBAL slave_parallel_mode=@old_parallel_mode; SET GLOBAL slave_parallel_threads=@old_parallel_threads; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel_retry.result b/mysql-test/suite/rpl/r/rpl_parallel_retry.result index 2cc4044a..4c7effd7 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_retry.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_retry.result @@ -339,6 +339,28 @@ connection server_1; DROP TABLE t1, t2, t3, t4; DROP function foo; connection server_2; +connection server_2; +include/stop_slave.inc +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +SET GLOBAL slave_parallel_threads=4; +connection server_1; +CREATE TABLE t1 (a INT, b VARCHAR(123)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1, 'asdf'); +UPDATE t1 SET b='zxf1' WHERE a=1; +UPDATE t1 SET b='\n' WHERE a=1; +connection server_2; +SET @old_dbug=@@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,write_row_inject_sleep_before_ha_write_row"; +include/start_slave.inc +connection server_1; +connection server_2; +connection server_1; +DROP TABLE t1; +connection server_2; +include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +include/start_slave.inc connection server_1; CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; INSERT INTO t1 VALUES(100, 100); diff --git a/mysql-test/suite/rpl/r/rpl_parallel_sbm.result b/mysql-test/suite/rpl/r/rpl_parallel_sbm.result index 7990a663..75012c93 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_sbm.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_sbm.result @@ -27,12 +27,19 @@ connection slave; # delaying a transaction; then when the reciprocal START SLAVE occurs, # if the event is still to be delayed, SBM should resume accordingly include/stop_slave.inc +# Lock t1 on slave to ensure the event can't finish (and thereby update +# Seconds_Behind_Master) so slow running servers don't accidentally +# catch up to the master before checking SBM. +connection server_2; +LOCK TABLES t1 WRITE; include/start_slave.inc connection slave; -# Waiting for replica to resume the delay for the transaction +# Waiting for replica to get blocked by the table lock # Sleeping 1s to increment SBM # Ensuring Seconds_Behind_Master increases after sleeping.. # ..done +connection server_2; +UNLOCK TABLES; include/sync_with_master_gtid.inc # # Pt 2) If the worker threads have not entered an idle state, ensure diff --git a/mysql-test/suite/rpl/r/rpl_parallel_seq.result b/mysql-test/suite/rpl/r/rpl_parallel_seq.result index 8f55f52e..02287d54 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_seq.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_seq.result @@ -127,4 +127,14 @@ CREATE SEQUENCE s4; DROP SEQUENCE s2,s3,s4; DROP TABLE ti; connection slave; +connection master; +CREATE SEQUENCE s; +SELECT NEXTVAL(s); +NEXTVAL(s) +1 +flush binary logs; +DROP SEQUENCE s; +DROP SEQUENCE s; +connection slave; +connection master; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel_slave_bgc_kill.result b/mysql-test/suite/rpl/r/rpl_parallel_slave_bgc_kill.result index ba131ea0..6b75dbf6 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_slave_bgc_kill.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_slave_bgc_kill.result @@ -206,10 +206,12 @@ RETURN x; END || SET sql_log_bin=1; +include/stop_slave_io.inc connection server_1; INSERT INTO t3 VALUES (49,0); connection server_2; -START SLAVE SQL_THREAD; +CHANGE MASTER TO master_use_gtid=no; +include/start_slave.inc SELECT * FROM t3 WHERE a >= 40 ORDER BY a; a b 41 41 @@ -239,10 +241,6 @@ SET GLOBAL slave_parallel_threads=0; SET GLOBAL slave_parallel_threads=10; include/start_slave.inc *** 3. Same as (2), but not using gtid mode *** -connection server_2; -include/stop_slave.inc -CHANGE MASTER TO master_use_gtid=no; -include/start_slave.inc connection server_1; connection con_temp3; SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; diff --git a/mysql-test/suite/rpl/r/rpl_parallel_stop_slave.result b/mysql-test/suite/rpl/r/rpl_parallel_stop_slave.result index 0c810d2a..b0a4fa59 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_stop_slave.result @@ -37,7 +37,9 @@ connection con_temp1; BEGIN; INSERT INTO t2 VALUES (21); connection server_2; -START SLAVE; +START SLAVE IO_THREAD; +include/wait_for_slave_param.inc [Read_Master_Log_Pos] +START SLAVE SQL_THREAD; connection con_temp2; SET @old_dbug= @@GLOBAL.debug_dbug; SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger"; diff --git a/mysql-test/suite/rpl/r/rpl_parallel_temptable.result b/mysql-test/suite/rpl/r/rpl_parallel_temptable.result index e9bff03b..0f7af253 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_temptable.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_temptable.result @@ -202,6 +202,24 @@ a b include/stop_slave.inc SET GLOBAL slave_parallel_mode=@old_mode; include/start_slave.inc +*** MDEV33426: Memory allocation accounting incorrect for replicated temptable +connection server_1; +CREATE TEMPORARY TABLE t5 (a int) ENGINE=Aria; +CREATE TEMPORARY TABLE t6 (a int) ENGINE=Heap; +INSERT INTO t5 VALUES (1); +INSERT INTO t6 VALUES (2); +connection server_2; +include/stop_slave.inc +connection server_1; +INSERT INTO t1 SELECT a+40, 5 FROM t5; +INSERT INTO t1 SELECT a+40, 6 FROM t6; +DROP TABLE t5, t6; +connection server_2; +include/start_slave.inc +SELECT * FROM t1 WHERE a>=40 ORDER BY a; +a b +41 5 +42 6 connection server_2; include/stop_slave.inc SET GLOBAL slave_parallel_threads=@old_parallel_threads; diff --git a/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result b/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result index 27cb29d3..4ace84ff 100644 --- a/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result +++ b/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result @@ -87,8 +87,6 @@ include/assert.inc [Value returned by SSS and PS table for Using_Gtid should be change master to master_user = 'root', master_use_gtid= CURRENT_POS; -Warnings: -Warning #### 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead include/assert.inc [Value returned by SSS and PS table for Using_Gtid should be same.] # 3) Test for Auto_position= SLAVE_POS diff --git a/mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result b/mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result index 5720f647..1734b200 100644 --- a/mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result +++ b/mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result @@ -12,11 +12,9 @@ select @@session.server_id; create database replica_db1; create database y; create database test_replica; -SELECT @@GLOBAL.replicate_rewrite_db; -@@GLOBAL.replicate_rewrite_db -primary_db1->replica_db1,x->y -# Ensuring SHOW SLAVE STATUS produces correct value for Replicate_Rewrite_DB... -# ...success +SELECT @@GLOBAL.replicate_rewrite_db, 'primary_db1->replica_db1,x->y' as 'Replicate_Rewrite_DB from SHOW SLAVE STATUS'; +@@GLOBAL.replicate_rewrite_db Replicate_Rewrite_DB from SHOW SLAVE STATUS +primary_db1->replica_db1,x->y primary_db1->replica_db1,x->y # Create DBs and tables on primary connection master; create database primary_db1; @@ -60,15 +58,13 @@ SELECT @@GLOBAL.replicate_rewrite_db; @@GLOBAL.replicate_rewrite_db primary_db1->replica_db1,x->y SET @@GLOBAL.replicate_rewrite_db="test_master->test_replica"; -SELECT @@GLOBAL.replicate_rewrite_db; -@@GLOBAL.replicate_rewrite_db -test_master->test_replica SHOW DATABASES like 'test_replica'; Database (test_replica) test_replica include/start_slave.inc -# Ensuring SHOW SLAVE STATUS produces correct value for Replicate_Rewrite_DB... -# ...success +SELECT @@GLOBAL.replicate_rewrite_db, 'test_master->test_replica' as 'Replicate_Rewrite_DB from SHOW SLAVE STATUS'; +@@GLOBAL.replicate_rewrite_db Replicate_Rewrite_DB from SHOW SLAVE STATUS +test_master->test_replica test_master->test_replica # Create DB and tables on primary connection master; create database test_master; @@ -94,6 +90,8 @@ t 3 include/diff_tables.inc [master:test_master.my_table,slave:test_replica.my_table] # Update of values on primary for DB not set in replication_rewrite_db +include/stop_slave.inc +include/reset_slave.inc connection master; use x; insert into my_table values (314); @@ -104,8 +102,6 @@ t 314 include/save_master_gtid.inc connection slave; -include/stop_slave.inc -include/reset_slave.inc include/start_slave.inc SELECT @@GLOBAL.replicate_rewrite_db; @@GLOBAL.replicate_rewrite_db diff --git a/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result b/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result index f1a0059a..c2bb256a 100644 --- a/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result +++ b/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result @@ -20,6 +20,5 @@ FOUND 1 /The slave is applying a ROW event on behalf of an UPDATE statement on t FOUND 1 /The slave is applying a ROW event on behalf of a DELETE statement on table t1 and is currently taking a considerable amount/ in mysqld.2.err include/stop_slave.inc SET @@GLOBAL.debug_dbug = @saved_dbug; -SET GLOBAL log_warnings = 2; include/start_slave.inc include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_cond_var_per_thd.result b/mysql-test/suite/rpl/r/rpl_semi_sync_cond_var_per_thd.result new file mode 100644 index 00000000..08f60144 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_cond_var_per_thd.result @@ -0,0 +1,32 @@ +include/master-slave.inc +[connection master] +connection master; +call mtr.add_suppression("Got an error reading communication packets"); +set @save_bgc_count= @@global.binlog_commit_wait_count; +set @save_bgc_usec= @@global.binlog_commit_wait_usec; +set @save_debug_dbug= @@global.debug_dbug; +set @@global.binlog_commit_wait_count=3; +set @@global.binlog_commit_wait_usec=10000000; +set @@global.debug_dbug="+d,testing_cond_var_per_thd"; +# Ensure semi-sync is on +connection slave; +connection master; +# Create three transactions to binlog group commit together +connection master; +create table t1 (a int); +connection server_1; +create table t2 (a int); +connection default; +create table t3 (a int); +connection master; +connection server_1; +connection default; +include/assert_grep.inc [Check that there is no 'Thread awaiting semi-sync ACK was awoken before its ACK' warning in error log.] +# +# Cleanup +connection master; +set @@global.binlog_commit_wait_count=@save_bgc_count; +set @@global.binlog_commit_wait_usec=@save_bgc_usec; +set @@global.debug_dbug=@save_debug_dbug; +drop table t1, t2, t3; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result b/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result index 1c94c239..49fdb485 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result @@ -44,13 +44,19 @@ SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; connection server_2; include/wait_for_slave_param.inc [Slave_SQL_Running_State] include/stop_slave.inc -include/assert.inc [Table t1 should have 2 rows.] +select count(*) 'on slave must be 2' from t1; +on slave must be 2 +2 SELECT @@GLOBAL.gtid_current_pos; @@GLOBAL.gtid_current_pos 0-1-4 # restart: --skip-slave-start=1 --rpl-semi-sync-slave-enabled=1 connection server_1; -include/assert.inc [Table t1 should have 1 rows.] +# Ensuring variable rpl_semi_sync_slave_enabled is ON.. +# Ensuring status rpl_semi_sync_slave_status is OFF.. +select count(*) 'on master must be 1' from t1; +on master must be 1 +1 FOUND 1 /truncated binlog file:.*master.*000001/ in mysqld.1.err disconnect conn_client; connection server_2; @@ -77,9 +83,9 @@ SHOW VARIABLES LIKE 'gtid_slave_pos'; Variable_name Value gtid_slave_pos 0-1-4 connection server_1; -SELECT COUNT(*) = 3 as 'true' FROM t1; -true -1 +SELECT COUNT(*) 'must be 3' FROM t1; +must be 3 +3 # ... the gtid states on the slave: SHOW VARIABLES LIKE 'gtid_slave_pos'; Variable_name Value @@ -111,24 +117,32 @@ connection server_2; #================================================================= connect conn_client,127.0.0.1,root,,test,$SERVER_MYPORT_2,; SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL con1_ready WAIT_FOR con1_go"; +SET DEBUG_SYNC= "commit_after_release_LOCK_after_binlog_sync WAIT_FOR con1_go1"; SET STATEMENT server_id=1 FOR INSERT INTO t1 VALUES (4, REPEAT("x", 4100)); connect conn_client_2,127.0.0.1,root,,test,$SERVER_MYPORT_2,; SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; -SET GLOBAL debug_dbug="d,Notify_binlog_EOF"; +SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL con1_go"; +SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL con2_ready"; INSERT INTO t1 VALUES (5, REPEAT("x", 4100)); connection server_2; -SET DEBUG_SYNC= "now WAIT_FOR eof_reached"; +SET DEBUG_SYNC= "now WAIT_FOR con2_ready"; # Kill the server connection server_1; include/wait_for_slave_param.inc [Slave_SQL_Running_State] include/stop_slave.inc -include/assert.inc [Table t1 should have 5 rows.] +select count(*) 'on slave must be 5' from t1; +on slave must be 5 +5 SELECT @@GLOBAL.gtid_current_pos; @@GLOBAL.gtid_current_pos 0-2-7 # restart: --skip-slave-start=1 --rpl-semi-sync-slave-enabled=1 connection server_2; -include/assert.inc [Table t1 should have 3 rows.] +# Ensuring variable rpl_semi_sync_slave_enabled is ON.. +# Ensuring status rpl_semi_sync_slave_status is OFF.. +select count(*) 'on master must be 3' from t1; +on master must be 3 +3 FOUND 1 /truncated binlog file:.*slave.*000002.* to remove transactions starting from GTID 0-1-6/ in mysqld.2.err disconnect conn_client; connection server_1; @@ -155,9 +169,9 @@ SHOW VARIABLES LIKE 'gtid_slave_pos'; Variable_name Value gtid_slave_pos 0-2-7 connection server_2; -SELECT COUNT(*) = 6 as 'true' FROM t1; -true -1 +SELECT COUNT(*) 'must be 6 as' FROM t1; +must be 6 as +6 # ... the gtid states on the slave: SHOW VARIABLES LIKE 'gtid_slave_pos'; Variable_name Value @@ -201,13 +215,19 @@ SET DEBUG_SYNC= "now WAIT_FOR con3_ready"; connection server_2; include/wait_for_slave_param.inc [Slave_SQL_Running_State] include/stop_slave.inc -include/assert.inc [Table t1 should have 7 rows.] +select count(*) 'on slave must be 7' from t1; +on slave must be 7 +7 SELECT @@GLOBAL.gtid_current_pos; @@GLOBAL.gtid_current_pos 0-1-9 # restart: --skip-slave-start=1 --rpl-semi-sync-slave-enabled=1 connection server_1; -include/assert.inc [Table t1 should have 6 rows.] +# Ensuring variable rpl_semi_sync_slave_enabled is ON.. +# Ensuring status rpl_semi_sync_slave_status is OFF.. +select count(*) 'on master must be 6' from t1; +on master must be 6 +6 FOUND 1 /truncated binlog file:.*master.*000002.* to remove transactions starting from GTID 0-1-9/ in mysqld.1.err disconnect conn_client; connection server_2; @@ -236,9 +256,9 @@ Variable_name Value gtid_slave_pos 0-1-9 connection server_1; include/sync_with_master_gtid.inc -SELECT COUNT(*) = 8 as 'true' FROM t1; -true -1 +SELECT COUNT(*) 'must be 8' FROM t1; +must be 8 +8 # ... the gtid states on the slave: SHOW VARIABLES LIKE 'gtid_slave_pos'; Variable_name Value diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_master_shutdown.result b/mysql-test/suite/rpl/r/rpl_semi_sync_master_shutdown.result index 6124ba01..8803b4c3 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_master_shutdown.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_master_shutdown.result @@ -4,7 +4,7 @@ connection master; SET @@GLOBAL.rpl_semi_sync_master_enabled = 1; connection slave; include/stop_slave.inc -SET @@GLOBAL. rpl_semi_sync_slave_enabled = 1; +SET @@GLOBAL.rpl_semi_sync_slave_enabled = 1; include/start_slave.inc connection master; CREATE TABLE t1 (a INT); @@ -21,7 +21,6 @@ connection slave; include/wait_for_slave_sql_to_start.inc include/wait_for_slave_io_to_start.inc connection master; -SET @@GLOBAL.debug_dbug=""; SET @@GLOBAL. rpl_semi_sync_master_enabled = 0; connection master; DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_shutdown_await_ack.result b/mysql-test/suite/rpl/r/rpl_semi_sync_shutdown_await_ack.result index 394a7aca..3048b6b5 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_shutdown_await_ack.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_shutdown_await_ack.result @@ -15,13 +15,17 @@ call mtr.add_suppression("reply failed"); call mtr.add_suppression("Replication event checksum verification"); call mtr.add_suppression("Relay log write failure"); call mtr.add_suppression("Failed to kill the active semi-sync connection"); +set @sav_enabled_server_2= @@GLOBAL.rpl_semi_sync_slave_enabled; +set @sav_server_2_dbug= @@GLOBAL.debug_dbug; connection server_3; call mtr.add_suppression("reply failed"); call mtr.add_suppression("Replication event checksum verification"); call mtr.add_suppression("Relay log write failure"); call mtr.add_suppression("Failed to kill the active semi-sync connection"); +set @sav_enabled_server_3= @@GLOBAL.rpl_semi_sync_slave_enabled; +set @sav_server_3_dbug= @@GLOBAL.debug_dbug; connection server_1; -CREATE TABLE t1 (a int); +CREATE TABLE t1 (a int) engine=innodb; connection server_2; connection server_3; connect server_1_con2, localhost, root,,; @@ -30,8 +34,8 @@ connect server_1_con2, localhost, root,,; ############################# # # Test Case 1) If both replicas simulate a delay that is within the -# allowed timeout, the primary should delay killing the suspended thread -# until an ACK is received (Rpl_semi_sync_master_yes_tx should be 1). +# allowed timeout, the primary should delay killing the Ack_thread +# until an ACK is received. # connection server_1; #-- @@ -40,15 +44,15 @@ connection server_1; #-- Enable semi-sync on slaves let slave_last= 3 connection server_2; -set global rpl_semi_sync_slave_enabled = 1; include/stop_slave.inc +set global rpl_semi_sync_slave_enabled = 1; include/start_slave.inc show status like 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status ON connection server_3; -set global rpl_semi_sync_slave_enabled = 1; include/stop_slave.inc +set global rpl_semi_sync_slave_enabled = 1; include/start_slave.inc show status like 'Rpl_semi_sync_slave_status'; Variable_name Value @@ -67,35 +71,22 @@ show status like 'Rpl_semi_sync_master_clients'; Variable_name Value Rpl_semi_sync_master_clients 2 #-- Prepare servers to simulate delay or error -connection server_1; -SET @@GLOBAL.debug_dbug= ""; connection server_2; SET @@GLOBAL.debug_dbug= "+d,simulate_delay_semisync_slave_reply"; connection server_3; SET @@GLOBAL.debug_dbug= "+d,simulate_delay_semisync_slave_reply"; #-- #-- Test begins +connection server_1_con2; connection server_1; #-- Begin semi-sync transaction INSERT INTO t1 VALUES (1); connection server_1_con2; #-- Wait until master recognizes a connection is awaiting semi-sync ACK -show status like 'Rpl_semi_sync_master_wait_sessions'; -Variable_name Value -Rpl_semi_sync_master_wait_sessions 1 -#-- Give enough time after timeout/ack received to query yes_tx/no_tx -SET @@GLOBAL.debug_dbug= "+d,delay_shutdown_phase_2_after_semisync_wait"; #-- Begin master shutdown SHUTDOWN WAIT FOR ALL SLAVES; connection server_1; -#-- Ensure either ACK was received (yes_tx=1) or timeout (no_tx=1) -show status like 'Rpl_semi_sync_master_yes_tx'; -Variable_name Value -Rpl_semi_sync_master_yes_tx 1 -show status like 'Rpl_semi_sync_master_no_tx'; -Variable_name Value -Rpl_semi_sync_master_no_tx 0 -connection server_1_con2; +ERROR HY000: Lost connection to server during query # Check logs to ensure shutdown was delayed FOUND 1 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err # Validate slave data is in correct state @@ -111,22 +102,19 @@ count(*)=1 #-- Re-synchronize slaves with master and disable semi-sync #-- Stop slaves connection server_2; -SET @@GLOBAL.debug_dbug= ""; -SET @@GLOBAL.rpl_semi_sync_slave_enabled= 0; -include/stop_slave.inc +include/stop_slave_io.inc +include/stop_slave_sql.inc +SET @@GLOBAL.debug_dbug= @sav_server_2_dbug; +SET @@GLOBAL.rpl_semi_sync_slave_enabled= @sav_enabled_server_2; connection server_3; -SET @@GLOBAL.debug_dbug= ""; -SET @@GLOBAL.rpl_semi_sync_slave_enabled= 0; -include/stop_slave.inc +include/stop_slave_io.inc +include/stop_slave_sql.inc +SET @@GLOBAL.debug_dbug= @sav_server_3_dbug; +SET @@GLOBAL.rpl_semi_sync_slave_enabled= @sav_enabled_server_3; #-- Bring the master back up connection server_1_con2; connection default; connection server_1; -SET @@GLOBAL.debug_dbug= ""; -SET @@GLOBAL.rpl_semi_sync_master_enabled = 0; -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status OFF TRUNCATE TABLE t1; #-- Bring slaves back up connection server_2; @@ -147,8 +135,8 @@ COUNT(*)=0 1 # # Test Case 2) If both replicas simulate an error before sending an ACK, -# the primary should delay killing the suspended thread until the -# timeout is reached (Rpl_semi_sync_master_no_tx should be 1). +# the primary should delay killing the Ack_thread until the +# timeout is reached. # connection server_1; #-- @@ -157,15 +145,15 @@ connection server_1; #-- Enable semi-sync on slaves let slave_last= 3 connection server_2; -set global rpl_semi_sync_slave_enabled = 1; include/stop_slave.inc +set global rpl_semi_sync_slave_enabled = 1; include/start_slave.inc show status like 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status ON connection server_3; -set global rpl_semi_sync_slave_enabled = 1; include/stop_slave.inc +set global rpl_semi_sync_slave_enabled = 1; include/start_slave.inc show status like 'Rpl_semi_sync_slave_status'; Variable_name Value @@ -184,35 +172,22 @@ show status like 'Rpl_semi_sync_master_clients'; Variable_name Value Rpl_semi_sync_master_clients 2 #-- Prepare servers to simulate delay or error -connection server_1; -SET @@GLOBAL.debug_dbug= "+d,mysqld_delay_kill_threads_phase_1"; connection server_2; -SET @@GLOBAL.debug_dbug= "+d,corrupt_queue_event"; +SET @@GLOBAL.debug_dbug= "+d,corrupt_queue_event,delay_semisync_kill_connection_for_mdev_28141"; connection server_3; -SET @@GLOBAL.debug_dbug= "+d,corrupt_queue_event"; +SET @@GLOBAL.debug_dbug= "+d,corrupt_queue_event,delay_semisync_kill_connection_for_mdev_28141"; #-- #-- Test begins +connection server_1_con2; connection server_1; #-- Begin semi-sync transaction INSERT INTO t1 VALUES (1); connection server_1_con2; #-- Wait until master recognizes a connection is awaiting semi-sync ACK -show status like 'Rpl_semi_sync_master_wait_sessions'; -Variable_name Value -Rpl_semi_sync_master_wait_sessions 1 -#-- Give enough time after timeout/ack received to query yes_tx/no_tx -SET @@GLOBAL.debug_dbug= "+d,delay_shutdown_phase_2_after_semisync_wait"; #-- Begin master shutdown SHUTDOWN WAIT FOR ALL SLAVES; connection server_1; -#-- Ensure either ACK was received (yes_tx=1) or timeout (no_tx=1) -show status like 'Rpl_semi_sync_master_yes_tx'; -Variable_name Value -Rpl_semi_sync_master_yes_tx 0 -show status like 'Rpl_semi_sync_master_no_tx'; -Variable_name Value -Rpl_semi_sync_master_no_tx 1 -connection server_1_con2; +ERROR HY000: Lost connection to server during query # Check logs to ensure shutdown was delayed FOUND 2 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err # Validate slave data is in correct state @@ -226,24 +201,33 @@ count(*)=0 1 # #-- Re-synchronize slaves with master and disable semi-sync +#-- FIXME: workaround for MDEV-28141, preventing errored replicas from +# killing their semi-sync connections +connection server_2; +set debug_sync= "now wait_for at_semisync_kill_connection"; +set debug_sync= "now signal continue_semisync_kill_connection"; +# Wait for debug_sync signal to have been received before issuing RESET +set debug_sync= "reset"; +connection server_3; +set debug_sync= "now wait_for at_semisync_kill_connection"; +set debug_sync= "now signal continue_semisync_kill_connection"; +# Wait for debug_sync signal to have been received before issuing RESET +set debug_sync= "reset"; #-- Stop slaves connection server_2; -SET @@GLOBAL.debug_dbug= ""; -SET @@GLOBAL.rpl_semi_sync_slave_enabled= 0; -include/stop_slave.inc +include/stop_slave_io.inc +include/stop_slave_sql.inc +SET @@GLOBAL.debug_dbug= @sav_server_2_dbug; +SET @@GLOBAL.rpl_semi_sync_slave_enabled= @sav_enabled_server_2; connection server_3; -SET @@GLOBAL.debug_dbug= ""; -SET @@GLOBAL.rpl_semi_sync_slave_enabled= 0; -include/stop_slave.inc +include/stop_slave_io.inc +include/stop_slave_sql.inc +SET @@GLOBAL.debug_dbug= @sav_server_3_dbug; +SET @@GLOBAL.rpl_semi_sync_slave_enabled= @sav_enabled_server_3; #-- Bring the master back up connection server_1_con2; connection default; connection server_1; -SET @@GLOBAL.debug_dbug= ""; -SET @@GLOBAL.rpl_semi_sync_master_enabled = 0; -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status OFF TRUNCATE TABLE t1; #-- Bring slaves back up connection server_2; @@ -265,8 +249,8 @@ COUNT(*)=0 # # Test Case 3) If one replica simulates a delay within the allowed # timeout and the other simulates an error before sending an ACK, the -# primary should delay killing the suspended thread until it receives an -# ACK from the delayed slave (Rpl_semi_sync_master_yes_tx should be 1). +# primary should delay killing the Ack_thread until it receives an +# ACK from the delayed slave. # connection server_1; #-- @@ -275,15 +259,15 @@ connection server_1; #-- Enable semi-sync on slaves let slave_last= 3 connection server_2; -set global rpl_semi_sync_slave_enabled = 1; include/stop_slave.inc +set global rpl_semi_sync_slave_enabled = 1; include/start_slave.inc show status like 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status ON connection server_3; -set global rpl_semi_sync_slave_enabled = 1; include/stop_slave.inc +set global rpl_semi_sync_slave_enabled = 1; include/start_slave.inc show status like 'Rpl_semi_sync_slave_status'; Variable_name Value @@ -302,35 +286,22 @@ show status like 'Rpl_semi_sync_master_clients'; Variable_name Value Rpl_semi_sync_master_clients 2 #-- Prepare servers to simulate delay or error -connection server_1; -SET @@GLOBAL.debug_dbug= "+d,mysqld_delay_kill_threads_phase_1"; connection server_2; -SET @@GLOBAL.debug_dbug= "+d,corrupt_queue_event"; +SET @@GLOBAL.debug_dbug= "+d,corrupt_queue_event,delay_semisync_kill_connection_for_mdev_28141"; connection server_3; SET @@GLOBAL.debug_dbug= "+d,simulate_delay_semisync_slave_reply"; #-- #-- Test begins +connection server_1_con2; connection server_1; #-- Begin semi-sync transaction INSERT INTO t1 VALUES (1); connection server_1_con2; #-- Wait until master recognizes a connection is awaiting semi-sync ACK -show status like 'Rpl_semi_sync_master_wait_sessions'; -Variable_name Value -Rpl_semi_sync_master_wait_sessions 1 -#-- Give enough time after timeout/ack received to query yes_tx/no_tx -SET @@GLOBAL.debug_dbug= "+d,delay_shutdown_phase_2_after_semisync_wait"; #-- Begin master shutdown SHUTDOWN WAIT FOR ALL SLAVES; connection server_1; -#-- Ensure either ACK was received (yes_tx=1) or timeout (no_tx=1) -show status like 'Rpl_semi_sync_master_yes_tx'; -Variable_name Value -Rpl_semi_sync_master_yes_tx 1 -show status like 'Rpl_semi_sync_master_no_tx'; -Variable_name Value -Rpl_semi_sync_master_no_tx 0 -connection server_1_con2; +ERROR HY000: Lost connection to server during query # Check logs to ensure shutdown was delayed FOUND 3 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err # Validate slave data is in correct state @@ -344,24 +315,28 @@ count(*)=1 1 # #-- Re-synchronize slaves with master and disable semi-sync +#-- FIXME: workaround for MDEV-28141, preventing errored replicas from +# killing their semi-sync connections +connection server_2; +set debug_sync= "now wait_for at_semisync_kill_connection"; +set debug_sync= "now signal continue_semisync_kill_connection"; +# Wait for debug_sync signal to have been received before issuing RESET +set debug_sync= "reset"; #-- Stop slaves connection server_2; -SET @@GLOBAL.debug_dbug= ""; -SET @@GLOBAL.rpl_semi_sync_slave_enabled= 0; -include/stop_slave.inc +include/stop_slave_io.inc +include/stop_slave_sql.inc +SET @@GLOBAL.debug_dbug= @sav_server_2_dbug; +SET @@GLOBAL.rpl_semi_sync_slave_enabled= @sav_enabled_server_2; connection server_3; -SET @@GLOBAL.debug_dbug= ""; -SET @@GLOBAL.rpl_semi_sync_slave_enabled= 0; -include/stop_slave.inc +include/stop_slave_io.inc +include/stop_slave_sql.inc +SET @@GLOBAL.debug_dbug= @sav_server_3_dbug; +SET @@GLOBAL.rpl_semi_sync_slave_enabled= @sav_enabled_server_3; #-- Bring the master back up connection server_1_con2; connection default; connection server_1; -SET @@GLOBAL.debug_dbug= ""; -SET @@GLOBAL.rpl_semi_sync_master_enabled = 0; -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status OFF TRUNCATE TABLE t1; #-- Bring slaves back up connection server_2; @@ -389,8 +364,7 @@ COUNT(*)=0 # active semi-sync connection in-tact. The slave should notice this, and # not issue a `QUIT` command to the primary, which would otherwise be # sent to kill an active connection. This test case validates that the -# slave does not send a `QUIT` in this case (Rpl_semi_sync_master_yes_tx -# should be 1 because server_3 will send the ACK within a valid timeout). +# slave does not send a `QUIT` in this case. # connection server_1; #-- @@ -399,15 +373,15 @@ connection server_1; #-- Enable semi-sync on slaves let slave_last= 3 connection server_2; -set global rpl_semi_sync_slave_enabled = 1; include/stop_slave.inc +set global rpl_semi_sync_slave_enabled = 1; include/start_slave.inc show status like 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status ON connection server_3; -set global rpl_semi_sync_slave_enabled = 1; include/stop_slave.inc +set global rpl_semi_sync_slave_enabled = 1; include/start_slave.inc show status like 'Rpl_semi_sync_slave_status'; Variable_name Value @@ -426,35 +400,22 @@ show status like 'Rpl_semi_sync_master_clients'; Variable_name Value Rpl_semi_sync_master_clients 2 #-- Prepare servers to simulate delay or error -connection server_1; -SET @@GLOBAL.debug_dbug= "+d,mysqld_delay_kill_threads_phase_1"; connection server_2; -SET @@GLOBAL.debug_dbug= "+d,corrupt_queue_event,slave_delay_killing_semisync_connection"; +SET @@GLOBAL.debug_dbug= "+d,corrupt_queue_event,delay_semisync_kill_connection_for_mdev_28141"; connection server_3; SET @@GLOBAL.debug_dbug= "+d,simulate_delay_semisync_slave_reply"; #-- #-- Test begins +connection server_1_con2; connection server_1; #-- Begin semi-sync transaction INSERT INTO t1 VALUES (1); connection server_1_con2; #-- Wait until master recognizes a connection is awaiting semi-sync ACK -show status like 'Rpl_semi_sync_master_wait_sessions'; -Variable_name Value -Rpl_semi_sync_master_wait_sessions 1 -#-- Give enough time after timeout/ack received to query yes_tx/no_tx -SET @@GLOBAL.debug_dbug= "+d,delay_shutdown_phase_2_after_semisync_wait"; #-- Begin master shutdown SHUTDOWN WAIT FOR ALL SLAVES; connection server_1; -#-- Ensure either ACK was received (yes_tx=1) or timeout (no_tx=1) -show status like 'Rpl_semi_sync_master_yes_tx'; -Variable_name Value -Rpl_semi_sync_master_yes_tx 1 -show status like 'Rpl_semi_sync_master_no_tx'; -Variable_name Value -Rpl_semi_sync_master_no_tx 0 -connection server_1_con2; +ERROR HY000: Lost connection to server during query # Check logs to ensure shutdown was delayed FOUND 4 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err # Validate slave data is in correct state @@ -468,24 +429,28 @@ count(*)=1 1 # #-- Re-synchronize slaves with master and disable semi-sync +#-- FIXME: workaround for MDEV-28141, preventing errored replicas from +# killing their semi-sync connections +connection server_2; +set debug_sync= "now wait_for at_semisync_kill_connection"; +set debug_sync= "now signal continue_semisync_kill_connection"; +# Wait for debug_sync signal to have been received before issuing RESET +set debug_sync= "reset"; #-- Stop slaves connection server_2; -SET @@GLOBAL.debug_dbug= ""; -SET @@GLOBAL.rpl_semi_sync_slave_enabled= 0; -include/stop_slave.inc +include/stop_slave_io.inc +include/stop_slave_sql.inc +SET @@GLOBAL.debug_dbug= @sav_server_2_dbug; +SET @@GLOBAL.rpl_semi_sync_slave_enabled= @sav_enabled_server_2; connection server_3; -SET @@GLOBAL.debug_dbug= ""; -SET @@GLOBAL.rpl_semi_sync_slave_enabled= 0; -include/stop_slave.inc +include/stop_slave_io.inc +include/stop_slave_sql.inc +SET @@GLOBAL.debug_dbug= @sav_server_3_dbug; +SET @@GLOBAL.rpl_semi_sync_slave_enabled= @sav_enabled_server_3; #-- Bring the master back up connection server_1_con2; connection default; connection server_1; -SET @@GLOBAL.debug_dbug= ""; -SET @@GLOBAL.rpl_semi_sync_master_enabled = 0; -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status OFF TRUNCATE TABLE t1; #-- Bring slaves back up connection server_2; @@ -504,14 +469,62 @@ Rpl_semi_sync_slave_status OFF SELECT COUNT(*)=0 from t1; COUNT(*)=0 1 +# +# Test Case 5) If a waiting-for-ACK user thread is killed (disconnected) +# during SHUTDOWN WAIT FOR ALL SLAVES, ensure the primary will still +# await the ACK from the replica before killing the Ack_receiver thread +# +connection server_1; +insert into t1 values (1); +include/save_master_gtid.inc +connection server_2; +include/sync_with_master_gtid.inc +include/stop_slave.inc +SET GLOBAL rpl_semi_sync_slave_enabled= 1; +include/start_slave.inc +connection server_1; +SET GLOBAL rpl_semi_sync_master_enabled= 1; +SET GLOBAL rpl_semi_sync_master_timeout= 2000; +show status like 'Rpl_semi_sync_master_status'; +Variable_name Value +Rpl_semi_sync_master_status ON +show status like 'Rpl_semi_sync_master_clients'; +Variable_name Value +Rpl_semi_sync_master_clients 1 +connection server_2; +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,simulate_delay_semisync_slave_reply"; +connect con1, localhost, root,,; +connect con2, localhost, root,,; +connection con1; +insert into t1 values (2); +connection server_1; +# Wait for thd to begin semi-sync wait.. +# ..done +disconnect con1; +connection default; +connection con2; +SHUTDOWN WAIT FOR ALL SLAVES; +# Ensure the primary waited for the ACK of the killed thread +FOUND 5 /Delaying shutdown to await semi-sync ACK/ in mysqld.1.err +connection default; +connection server_1; +connection server_2; +include/stop_slave.inc +connection server_3; +include/stop_slave.inc +connection default; +connection server_1; ############################# # Cleanup ############################# connection server_2; -include/stop_slave.inc +SET @@GLOBAL.rpl_semi_sync_slave_enabled = @sav_enabled_server_2; +SET @@GLOBAL.debug_dbug= @sav_server_2_dbug; include/start_slave.inc connection server_3; -include/stop_slave.inc +SET @@GLOBAL.rpl_semi_sync_slave_enabled = @sav_enabled_server_3; +SET @@GLOBAL.debug_dbug= @sav_server_3_dbug; include/start_slave.inc connection server_1; drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_slave_enabled_consistent.result b/mysql-test/suite/rpl/r/rpl_semi_sync_slave_enabled_consistent.result index 99c31249..4195acb9 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_slave_enabled_consistent.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_slave_enabled_consistent.result @@ -2,6 +2,9 @@ include/master-slave.inc [connection master] call mtr.add_suppression("Replication event checksum verification failed"); call mtr.add_suppression("could not queue event from master"); +call mtr.add_suppression("Semisync ack receiver.*error reading communication packets"); +call mtr.add_suppression("Semisync ack receiver got hangup"); +connection slave; # # Set up a semisync connection connection master; diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_status.result b/mysql-test/suite/rpl/r/rpl_show_slave_status.result new file mode 100644 index 00000000..e32b2f55 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_show_slave_status.result @@ -0,0 +1,75 @@ +include/master-slave.inc +[connection master] +* +* The purpose of this test is to prevent incorrect additions to SHOW +* SLAVE STATUS, which has happened several times in the past. +* +* We must never, _ever_, add extra rows to this output of SHOW SLAVE +* STATUS, except at the very end, as this breaks backwards compatibility +* with applications or scripts that parse the output. This also means that +* we cannot add _any_ new rows in a GA version if a different row was +* already added in a later MariaDB version, as this would make it impossible +* to merge the change up while preserving the order of rows. +* +connection slave; +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host # +Master_User # +Master_Port # +Connect_Retry # +Master_Log_File # +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File # +Slave_IO_Running # +Slave_SQL_Running # +Replicate_Do_DB # +Replicate_Ignore_DB # +Replicate_Do_Table # +Replicate_Ignore_Table # +Replicate_Wild_Do_Table # +Replicate_Wild_Ignore_Table # +Last_Errno # +Last_Error # +Skip_Counter # +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition # +Until_Log_File # +Until_Log_Pos # +Master_SSL_Allowed # +Master_SSL_CA_File # +Master_SSL_CA_Path # +Master_SSL_Cert # +Master_SSL_Cipher # +Master_SSL_Key # +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert # +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno # +Last_SQL_Error # +Replicate_Ignore_Server_Ids # +Master_Server_Id # +Master_SSL_Crl # +Master_SSL_Crlpath # +Using_Gtid # +Gtid_IO_Pos # +Replicate_Do_Domain_Ids # +Replicate_Ignore_Domain_Ids # +Parallel_Mode # +SQL_Delay # +SQL_Remaining_Delay # +Slave_SQL_Running_State # +Slave_DDL_Groups # +Slave_Non_Transactional_Groups # +Slave_Transactional_Groups # +Replicate_Rewrite_DB # +* +* When modifying this test after adding a column to SHOW SLAVE STATUS, +* _only_ additions at the end are allowed, the column number of existing +* columns must _not_ change! +* +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_shutdown_sighup.result b/mysql-test/suite/rpl/r/rpl_shutdown_sighup.result new file mode 100644 index 00000000..01b35f1d --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_shutdown_sighup.result @@ -0,0 +1,50 @@ +include/master-slave.inc +[connection master] +connection slave; +set statement sql_log_bin=0 for call mtr.add_suppression("Signal handler thread did not exit in a timely manner"); +# +# Main test +connection master; +create table t1 (a int); +insert into t1 values (1); +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +set @@global.debug_dbug= "+d,hold_sighup_log_refresh"; +# Waiting for sighup to reach reload_acl_and_cache.. +set debug_sync="now wait_for in_reload_acl_and_cache"; +# Signalling signal handler to proceed to sleep before REFRESH_HOSTS +set debug_sync="now signal refresh_logs"; +# Starting shutdown (note this will take 3+ seconds due to DBUG my_sleep in reload_acl_and_cache) +shutdown; +connection server_2; +connection slave; +include/assert_grep.inc [Ensure Mariadbd did not segfault when shutting down] +connection master; +connection slave; +# +# Error testcase to ensure an error message is shown if the signal +# takes longer than the timeout while processing the SIGHUP +connection slave; +set @@global.debug_dbug= "+d,force_sighup_processing_timeout"; +set @@global.debug_dbug= "+d,hold_sighup_log_refresh"; +connection master; +insert into t1 values (1); +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +# Waiting for sighup to reach reload_acl_and_cache.. +set debug_sync="now wait_for in_reload_acl_and_cache"; +# Signalling signal handler to proceed to sleep before REFRESH_HOSTS +set debug_sync="now signal refresh_logs"; +# Starting shutdown (note this will take 3+ seconds due to DBUG my_sleep in reload_acl_and_cache) +shutdown; +connection server_2; +connection slave; +include/assert_grep.inc [Ensure warning is issued that signal handler thread is still processing] +# +# Cleanup +connection master; +drop table t1; +include/rpl_end.inc +# End of rpl_shutdown_sighup.test diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result index eb6324ff..03fc8a78 100644 --- a/mysql-test/suite/rpl/r/rpl_skip_error.result +++ b/mysql-test/suite/rpl/r/rpl_skip_error.result @@ -122,6 +122,31 @@ connection slave; # Slave_skipped_errros = 5 **** We cannot execute a select as there are differences in the **** behavior between STMT and RBR. +**** +**** Ensure transactions which are skipped due to encountering a +**** non-deadlock error which is present in --slave-skip-errors result +**** in partially committed transactions +connection master; +CREATE TABLE t3 (a INT UNIQUE) ENGINE=InnoDB; +connection slave; +connection slave; +INSERT INTO t3 VALUES (3); +connection master; +BEGIN; +INSERT INTO t3 VALUES (1); +INSERT INTO t3 VALUES (2); +INSERT INTO t3 VALUES (3); +INSERT INTO t3 VALUES (4); +COMMIT; +connection slave; +**** Master and slave tables should have the same data, due to the +**** partially replicated transaction's data overlapping with the data +**** that pre-existed on the slave. That is, despite the transaction +**** consisting of 4 statements, the errored statement should be ignored +**** and the other 3 should commit successfully. +include/diff_tables.inc [master:t3,slave:t3] +connection master; +DROP TABLE t3; ==== Clean Up ==== connection master; DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_options.result b/mysql-test/suite/rpl/r/rpl_start_alter_options.result index 4c6135aa..c150c18a 100644 --- a/mysql-test/suite/rpl/r/rpl_start_alter_options.result +++ b/mysql-test/suite/rpl/r/rpl_start_alter_options.result @@ -3,8 +3,6 @@ include/master-slave.inc connection slave; stop slave; 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 slave_parallel_threads=4; set global slave_parallel_mode=optimistic; set global gtid_strict_mode=1; @@ -96,8 +94,6 @@ include/start_slave.inc connection slave; stop slave; 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 slave_parallel_threads=4; set global slave_parallel_mode=optimistic; set global gtid_strict_mode=1; @@ -189,8 +185,6 @@ include/start_slave.inc connection slave; stop slave; 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 slave_parallel_threads=4; set global slave_parallel_mode=optimistic; set global gtid_strict_mode=1; @@ -321,8 +315,6 @@ include/start_slave.inc connection slave; stop slave; 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 slave_parallel_threads=4; set global slave_parallel_mode=optimistic; set global gtid_strict_mode=1; @@ -377,8 +369,6 @@ connection master; alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=instant; alter table t1 add index if not exists index_1(f), force , algorithm=instant; alter table t1 disable keys, force , algorithm=copy; -Warnings: -Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option alter table t1 enable keys, force , algorithm=copy; Warnings: Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option @@ -414,8 +404,6 @@ include/start_slave.inc connection slave; stop slave; 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 slave_parallel_threads=4; set global slave_parallel_mode=optimistic; set global gtid_strict_mode=1; @@ -470,8 +458,6 @@ connection master; alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=nocopy; alter table t1 add index if not exists index_1(f), force , algorithm=nocopy; alter table t1 disable keys, force , algorithm=copy; -Warnings: -Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option alter table t1 enable keys, force , algorithm=copy; Warnings: Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option diff --git a/mysql-test/suite/rpl/r/rpl_temporary_error2_skip_all.result b/mysql-test/suite/rpl/r/rpl_temporary_error2_skip_all.result new file mode 100644 index 00000000..9819aafa --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_temporary_error2_skip_all.result @@ -0,0 +1,64 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction"); +*** Provoke a deadlock on the slave, check that transaction retry succeeds. *** +connection master; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; +CREATE TABLE t2 (a INT) ENGINE=InnoDB; +INSERT INTO t1(a) VALUES (1), (2), (3), (4), (5); +connection slave; +SELECT * FROM t1 ORDER BY a; +a b +1 NULL +2 NULL +3 NULL +4 NULL +5 NULL +SET sql_log_bin=0; +ALTER TABLE t2 ENGINE=MyISAM; +SET sql_log_bin=1; +connect con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,; +connection con_temp1; +BEGIN; +UPDATE t1 SET b=2 WHERE a=4; +INSERT INTO t2 VALUES (2); +DELETE FROM t2 WHERE a=2; +connection master; +BEGIN; +UPDATE t1 SET b=1 WHERE a=2; +INSERT INTO t2 VALUES (1); +UPDATE t1 SET b=1 WHERE a=4; +COMMIT; +connection slave; +connection con_temp1; +UPDATE t1 SET b=2 WHERE a=2; +SELECT * FROM t1 WHERE a<10 ORDER BY a; +a b +1 NULL +2 2 +3 NULL +4 2 +5 NULL +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +connection slave; +SELECT * FROM t1 ORDER BY a; +a b +1 NULL +2 NULL +3 NULL +4 NULL +5 NULL +* There will be one row in t2 because the ignored deadlock does not retry. +SELECT * FROM t2 ORDER BY a; +a +1 +retries +0 +Last_SQL_Errno = '0' +Last_SQL_Error = '' +connection master; +DROP TABLE t1; +DROP TABLE t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_using_gtid_default.result b/mysql-test/suite/rpl/r/rpl_using_gtid_default.result index 3bdc9d47..24a316de 100644 --- a/mysql-test/suite/rpl/r/rpl_using_gtid_default.result +++ b/mysql-test/suite/rpl/r/rpl_using_gtid_default.result @@ -58,8 +58,6 @@ include/start_slave.inc # to its default of Slave_Pos after RESET 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/start_slave.inc include/stop_slave.inc RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result index 999d9417..35cb3fcd 100644 --- a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result +++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result @@ -1,6 +1,5 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Master is configured to log replication events"); connection slave; connection slave; include/wait_for_slave_to_stop.inc |