mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.2' into 10.3
This commit is contained in:
@@ -1872,6 +1872,7 @@ SET GLOBAL slave_parallel_threads=10;
|
||||
SET GLOBAL slave_parallel_threads=1;
|
||||
SET @old_dbug= @@GLOBAL.debug_dbug;
|
||||
SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
|
||||
CALL mtr.add_suppression("Unexpected break of being relay-logged GTID");
|
||||
|
||||
--connection server_1
|
||||
INSERT INTO t2 VALUES (101);
|
||||
|
@@ -37,7 +37,7 @@ select * from t1;
|
||||
|
||||
# The slave is synced and waiting/reading from master
|
||||
# SHOW SLAVE STATUS will show "Waiting for master to send event"
|
||||
let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Cert, Master_SSL_Key;
|
||||
let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Crl, Master_SSL_Crlpath, Master_SSL_Cert, Master_SSL_Key;
|
||||
source include/show_slave_status.inc;
|
||||
source include/check_slave_is_running.inc;
|
||||
|
||||
|
54
mysql-test/suite/rpl/r/rpl_gtid_grouping.result
Normal file
54
mysql-test/suite/rpl/r/rpl_gtid_grouping.result
Normal file
@@ -0,0 +1,54 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
connection slave;
|
||||
call mtr.add_suppression("Unexpected break of being relay-logged GTID 0-27697-1000");
|
||||
call mtr.add_suppression("Relay log write failure: could not queue event from master");
|
||||
call mtr.add_suppression("The current group of events starts with a non-GTID");
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
CREATE TABLE t (a INT) ENGINE=innodb;
|
||||
INSERT INTO t VALUES(1);
|
||||
### A. Simulate an unnoticeable loss of Xid event
|
||||
connection slave;
|
||||
SET @@global.debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
|
||||
connection master;
|
||||
SET @@gtid_seq_no=1000;
|
||||
set @@server_id=27697;
|
||||
INSERT INTO t VALUES(1000);
|
||||
set @@server_id=default;
|
||||
INSERT INTO t VALUES(1001);
|
||||
## Prove the error occurs.
|
||||
connection slave;
|
||||
include/wait_for_slave_io_error.inc [errno=1595]
|
||||
## Prove the slave recovers after the simulation condtion is lifted.
|
||||
SET @@global.debug_dbug=default;
|
||||
include/start_slave.inc
|
||||
### B. Do the same to GTID event.
|
||||
connection slave;
|
||||
SET @@global.debug_dbug="+d,slave_discard_gtid_0_x_1002";
|
||||
connection master;
|
||||
SET @@gtid_seq_no=1002;
|
||||
set @@server_id=27697;
|
||||
INSERT INTO t VALUES(1002);
|
||||
set @@server_id=default;
|
||||
INSERT INTO t VALUES(1003);
|
||||
## Prove the error occurs.
|
||||
connection slave;
|
||||
include/wait_for_slave_io_error.inc [errno=1595]
|
||||
## Prove the slave recovers after the simulation condtion is lifted.
|
||||
SET @@global.debug_dbug=default;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
connection slave;
|
||||
include/diff_tables.inc [master:t,slave:t]
|
||||
"===== Clean up ====="
|
||||
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
|
@@ -1378,6 +1378,7 @@ include/stop_slave.inc
|
||||
SET GLOBAL slave_parallel_threads=1;
|
||||
SET @old_dbug= @@GLOBAL.debug_dbug;
|
||||
SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
|
||||
CALL mtr.add_suppression("Unexpected break of being relay-logged GTID");
|
||||
connection server_1;
|
||||
INSERT INTO t2 VALUES (101);
|
||||
INSERT INTO t2 VALUES (102);
|
||||
|
@@ -132,8 +132,13 @@ connection server_1;
|
||||
INSERT INTO t1 VALUES (0, 1);
|
||||
include/save_master_gtid.inc
|
||||
connection server_2;
|
||||
set @@sql_log_bin=0;
|
||||
call mtr.add_suppression("Unexpected break of being relay-logged GTID 1-1-32 event group by the current GTID event 0-1-4");
|
||||
set @@sql_log_bin=1;
|
||||
set @@global.debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
|
||||
include/start_slave.inc
|
||||
include/sync_with_master_gtid.inc
|
||||
set @@global.debug_dbug="";
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b
|
||||
0 1
|
||||
|
@@ -23,6 +23,8 @@ t
|
||||
Master_SSL_Allowed = 'Yes'
|
||||
Master_SSL_CA_Path = ''
|
||||
Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
|
||||
Master_SSL_Crl = ''
|
||||
Master_SSL_Crlpath = ''
|
||||
Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
|
||||
Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
|
||||
include/check_slave_is_running.inc
|
||||
@@ -37,6 +39,8 @@ include/wait_for_slave_to_start.inc
|
||||
Master_SSL_Allowed = 'Yes'
|
||||
Master_SSL_CA_Path = ''
|
||||
Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
|
||||
Master_SSL_Crl = ''
|
||||
Master_SSL_Crlpath = ''
|
||||
Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
|
||||
Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
|
||||
include/check_slave_is_running.inc
|
||||
|
97
mysql-test/suite/rpl/t/rpl_gtid_grouping.test
Normal file
97
mysql-test/suite/rpl/t/rpl_gtid_grouping.test
Normal file
@@ -0,0 +1,97 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Test verifies that replicated transaction boundaries are set properly
|
||||
# at receiving from master time.
|
||||
#
|
||||
# ==== Implementation ====
|
||||
#
|
||||
# A. Simulate an unnoticeable loss of Xid event to observe a slave error,
|
||||
# then restart slave to recover from the failure.
|
||||
# B. Do the same to GTID event.
|
||||
#
|
||||
# ==== References ====
|
||||
#
|
||||
# MDEV-27697 slave must recognize incomplete replication event group
|
||||
#
|
||||
--source include/have_binlog_format_mixed.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--connection slave
|
||||
call mtr.add_suppression("Unexpected break of being relay-logged GTID 0-27697-1000");
|
||||
call mtr.add_suppression("Relay log write failure: could not queue event from master");
|
||||
call mtr.add_suppression("The current group of events starts with a non-GTID");
|
||||
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
CREATE TABLE t (a INT) ENGINE=innodb;
|
||||
INSERT INTO t VALUES(1);
|
||||
save_master_pos;
|
||||
|
||||
--echo ### A. Simulate an unnoticeable loss of Xid event
|
||||
--sync_slave_with_master
|
||||
SET @@global.debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
|
||||
|
||||
--connection master
|
||||
SET @@gtid_seq_no=1000;
|
||||
set @@server_id=27697;
|
||||
INSERT INTO t VALUES(1000);
|
||||
set @@server_id=default;
|
||||
INSERT INTO t VALUES(1001);
|
||||
|
||||
--echo ## Prove the error occurs.
|
||||
--connection slave
|
||||
# ER_SLAVE_RELAY_LOG_WRITE_FAILURE
|
||||
--let $slave_io_errno = 1595
|
||||
--source include/wait_for_slave_io_error.inc
|
||||
## EOP
|
||||
|
||||
--echo ## Prove the slave recovers after the simulation condtion is lifted.
|
||||
SET @@global.debug_dbug=default;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--echo ### B. Do the same to GTID event.
|
||||
--connection slave
|
||||
SET @@global.debug_dbug="+d,slave_discard_gtid_0_x_1002";
|
||||
|
||||
--connection master
|
||||
SET @@gtid_seq_no=1002;
|
||||
set @@server_id=27697;
|
||||
INSERT INTO t VALUES(1002);
|
||||
set @@server_id=default;
|
||||
INSERT INTO t VALUES(1003);
|
||||
|
||||
--echo ## Prove the error occurs.
|
||||
--connection slave
|
||||
# ER_SLAVE_RELAY_LOG_WRITE_FAILURE
|
||||
--let $slave_io_errno = 1595
|
||||
--source include/wait_for_slave_io_error.inc
|
||||
## EOP
|
||||
|
||||
--echo ## Prove the slave recovers after the simulation condtion is lifted.
|
||||
SET @@global.debug_dbug=default;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
save_master_pos;
|
||||
|
||||
--sync_slave_with_master
|
||||
## EOP
|
||||
|
||||
--let $diff_tables=master:t,slave:t
|
||||
--source include/diff_tables.inc
|
||||
|
||||
--echo "===== Clean up ====="
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO MASTER_USE_GTID=no;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t;
|
||||
SET GLOBAL LOG_WARNINGS=default;
|
||||
--source include/rpl_end.inc
|
@@ -201,9 +201,16 @@ INSERT INTO t1 VALUES (0, 1);
|
||||
# execution of format_description event will not wait infinitely
|
||||
# for a commit of the incomplete group that never happens.
|
||||
|
||||
# Apart from the suppression, MDEV-27697 refinement to the original test needs
|
||||
# an allowance to one time accept malformed event group.
|
||||
set @@sql_log_bin=0;
|
||||
call mtr.add_suppression("Unexpected break of being relay-logged GTID 1-1-32 event group by the current GTID event 0-1-4");
|
||||
set @@sql_log_bin=1;
|
||||
set @@global.debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
|
||||
--source include/start_slave.inc
|
||||
#--sync_with_master
|
||||
--source include/sync_with_master_gtid.inc
|
||||
set @@global.debug_dbug="";
|
||||
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
SHOW STATUS LIKE 'Slave_open_temp_tables';
|
||||
|
Reference in New Issue
Block a user