| 1 |
--source include/not_group_replication_plugin.inc |
| 2 |
--source include/have_binlog_format_row.inc |
| 3 |
--source include/master-slave.inc |
| 4 |
|
| 5 |
############################################################################### |
| 6 |
# BUG#21107331 RESET SLAVE ALL DOESN'T RESETS SLAVE_RETRIED_TRANSACTIONS |
| 7 |
# BUG#21111229 RESET SLAVE ALL BEHAVES DIFFERENT FOR DEFAULT AND |
| 8 |
# NON-DEFAULT CHANNELS |
| 9 |
# |
| 10 |
# Verify that count_transactions_retries is reset to 0 after RESET SLAVE ALL |
| 11 |
# Step 1. Generates an innodb row lock timeout to increase |
| 12 |
# count_transactions_retries |
| 13 |
# Step 2. RESET SLAVE |
| 14 |
# Step 3. check count_transactions_retries is 0 |
| 15 |
############################################################################### |
| 16 |
|
| 17 |
CREATE TABLE t1 (c1 INT KEY) ENGINE=InnoDB; |
| 18 |
|
| 19 |
# It is used by the CHANGE MASTER below |
| 20 |
--source include/save_binlog_position.inc |
| 21 |
|
| 22 |
--source include/sync_slave_sql_with_master.inc |
| 23 |
|
| 24 |
--source include/stop_slave.inc |
| 25 |
SET @saved_replica_transaction_retries = @@GLOBAL.replica_transaction_retries; |
| 26 |
SET @saved_innodb_lock_wait_timeout = @@GLOBAL.innodb_lock_wait_timeout; |
| 27 |
SET GLOBAL replica_transaction_retries = 1; |
| 28 |
SET GLOBAL innodb_lock_wait_timeout = 1; |
| 29 |
--source include/start_slave.inc |
| 30 |
|
| 31 |
# It blocks slave applier which applies INSERT INTO t1 VALUES(1); |
| 32 |
BEGIN; |
| 33 |
INSERT INTO t1 VALUES(1); |
| 34 |
|
| 35 |
--source include/rpl_connection_master.inc |
| 36 |
INSERT INTO t1 VALUES(1); |
| 37 |
|
| 38 |
# Slave sql stops after retrying the transaction 1 times. |
| 39 |
--source include/rpl_connection_slave1.inc |
| 40 |
--let $slave_sql_errno=1205 |
| 41 |
--source include/wait_for_slave_sql_error.inc |
| 42 |
--source include/stop_slave_io.inc |
| 43 |
|
| 44 |
# The warnings are generated by MTS |
| 45 |
CALL mtr.add_suppression(".*worker thread retried transaction 1 time.*"); |
| 46 |
CALL mtr.add_suppression(".*The replica coordinator and worker threads are " |
| 47 |
"stopped, possibly leaving data in inconsistent.*"); |
| 48 |
--let $assert_text= count_transactions_retries should be greater than 0 |
| 49 |
--let $assert_status_name= count_transactions_retries |
| 50 |
--let $assert_status_value= 0 |
| 51 |
--let $assert_comparator= >= |
| 52 |
--let $table=replication_applier_status |
| 53 |
--source include/rpl_pfs_assert_status.inc |
| 54 |
|
| 55 |
RESET SLAVE ALL; |
| 56 |
|
| 57 |
--let $assert_text= count_transactions_retries should be 0 |
| 58 |
--let $assert_status_name= count_transactions_retries |
| 59 |
--let $assert_status_value= 0 |
| 60 |
--let $table= replication_applier_status |
| 61 |
--source include/rpl_pfs_assert_status.inc |
| 62 |
|
| 63 |
--source include/rpl_connection_slave.inc |
| 64 |
# rollback the INSERT which is used to block slave applier. |
| 65 |
ROLLBACK; |
| 66 |
|
| 67 |
--echo # |
| 68 |
--echo # Cleanup |
| 69 |
--echo # |
| 70 |
SET GLOBAL replica_transaction_retries = @saved_replica_transaction_retries; |
| 71 |
SET GLOBAL innodb_lock_wait_timeout = @saved_innodb_lock_wait_timeout; |
| 72 |
|
| 73 |
--replace_result $binlog_file BINLOG_FILE $binlog_position BINLOG_POS $MASTER_MYPORT MASTER_PORT |
| 74 |
eval CHANGE REPLICATION SOURCE TO SOURCE_LOG_FILE = "$binlog_file", SOURCE_LOG_POS = $binlog_position, |
| 75 |
SOURCE_USER='root', SOURCE_HOST='127.0.0.1', SOURCE_PORT=$MASTER_MYPORT; |
| 76 |
--source include/start_slave.inc |
| 77 |
|
| 78 |
--source include/rpl_connection_master.inc |
| 79 |
DROP TABLE t1; |
| 80 |
--source include/rpl_end.inc |