mirror of
https://github.com/MariaDB/server.git
synced 2025-07-20 10:24:14 +03:00
BUG#24860 (Incorrect SLAVE_TRANSACTION_RETRIES code can result in slave stuck):
If a temporary error occured inside a group on an event that was not the first event of the group, the slave could get stuck because the retry counter is reset whenever an event was executed successfully. This patch only reset the retry counter when an entire group has been successfully executed, or failed with a non-transient error. sql/slave.cc: Adding debug printouts to every place where Relay_log_info::trans_retries is changed and to has_temporary_error() to print the error when returning. Adding debug variable all_errors_are_temporary_errors to make all errors for slave thread temporary errors. Adding code so that the Relay_log_info::trans_retries is only reset when an entire group was sucessfully executed, or a non-temporary error occured. mysql-test/suite/rpl/r/rpl_temporary_errors.result: New BitKeeper file ``mysql-test/suite/rpl/r/rpl_temporary_errors.result'' mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt: New BitKeeper file ``mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt'' mysql-test/suite/rpl/t/rpl_temporary_errors.test: New BitKeeper file ``mysql-test/suite/rpl/t/rpl_temporary_errors.test''
This commit is contained in:
29
mysql-test/suite/rpl/t/rpl_temporary_errors.test
Normal file
29
mysql-test/suite/rpl/t/rpl_temporary_errors.test
Normal file
@ -0,0 +1,29 @@
|
||||
source include/master-slave.inc;
|
||||
|
||||
--echo **** On Master ****
|
||||
connection master;
|
||||
SET SESSION BINLOG_FORMAT=ROW;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
|
||||
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4);
|
||||
--echo **** On Slave ****
|
||||
sync_slave_with_master;
|
||||
SHOW STATUS LIKE 'Slave_retried_transactions';
|
||||
UPDATE t1 SET a = 5, b = 47 WHERE a = 1;
|
||||
SELECT * FROM t1;
|
||||
--echo **** On Master ****
|
||||
connection master;
|
||||
UPDATE t1 SET a = 5, b = 5 WHERE a = 1;
|
||||
save_master_pos;
|
||||
SELECT * FROM t1;
|
||||
#SHOW BINLOG EVENTS;
|
||||
--echo **** On Slave ****
|
||||
connection slave;
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
SHOW STATUS LIKE 'Slave_retried_transactions';
|
||||
SELECT * FROM t1;
|
||||
source include/show_slave_status.inc;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo **** On Master ****
|
||||
connection master;
|
||||
DROP TABLE t1;
|
Reference in New Issue
Block a user