-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-35465 Async replication stops working on Galera async replica no…
…de when parallel replication is enabled Parallel slave failed to retry in retry_event_group() with error WSREP: Parallel slave worker failed at wsrep_before_command() hook Fix wsrep transaction cleanup/restart in retry_event_group() to properly clean up previous transaction by calling wsrep_after_statement(). Also move call to reset error after call to wsrep_after_statement() to make sure that it remains effective. Add a MTR test galera_as_slave_parallel_retry to reproduce the error when the fix is not present. Other issues which were detected when testing with sysbench: Check if parallel slave is killed for retry before waiting for prior commits in THD::wsrep_parallel_slave_wait_for_prior_commit(). This is required with slave-parallel-mode=optimistic to avoid deadlock when a slave later in commit order manages to reach prepare phase before a lock conflict is detected. Suppress wsrep applier specific warning for slave threads.
- Loading branch information
Showing
7 changed files
with
113 additions
and
14 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
mysql-test/suite/galera/r/galera_as_slave_parallel_retry.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
connection node_2; | ||
connection node_1; | ||
connect master, 127.0.0.1, root, , test, $NODE_MYPORT_3; | ||
connect node_1_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_1; | ||
connection node_1; | ||
START SLAVE; | ||
connection master; | ||
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; | ||
connection node_1; | ||
SET GLOBAL debug_dbug = '+d,rpl_parallel_simulate_temp_err_xid,sync.wsrep_retry_event_group'; | ||
connection master; | ||
INSERT INTO t1 VALUES (1); | ||
connection node_1_ctrl; | ||
SET debug_sync = 'now WAIT_FOR sync.wsrep_retry_event_group_reached'; | ||
SET GLOBAL debug_dbug = ''; | ||
SET debug_sync = 'now SIGNAL signal.wsrep_retry_event_group'; | ||
connection node_1; | ||
SET debug_sync = 'RESET'; | ||
connection master; | ||
DROP TABLE t1; | ||
connection node_1; | ||
STOP SLAVE; |
10 changes: 10 additions & 0 deletions
10
mysql-test/suite/galera/t/galera_as_slave_parallel_retry.cnf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
!include ../galera_2nodes_as_slave.cnf | ||
|
||
[mysqld] | ||
log-bin=mysqld-bin | ||
log-slave-updates | ||
binlog-format=ROW | ||
|
||
[mysqld.1] | ||
slave-parallel-threads=2 | ||
slave-parallel-mode=optimistic |
52 changes: 52 additions & 0 deletions
52
mysql-test/suite/galera/t/galera_as_slave_parallel_retry.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# MDEV-35465 Async replication stops working on Galera async replica node | ||
# when parallel replication is enabled | ||
|
||
--source include/have_innodb.inc | ||
--source include/have_log_bin.inc | ||
--source include/galera_cluster.inc | ||
--source include/have_debug_sync.inc | ||
|
||
# Node 3 is not a Galera node, use it as a master | ||
--connect master, 127.0.0.1, root, , test, $NODE_MYPORT_3 | ||
--connect node_1_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_1 | ||
|
||
--connection node_1 | ||
--disable_query_log | ||
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3; | ||
--enable_query_log | ||
START SLAVE; | ||
|
||
--connection master | ||
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; | ||
|
||
--connection node_1 | ||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' | ||
--source include/wait_condition.inc | ||
|
||
# | ||
--let debug_dbug_orig = `SELECT @@GLOBAL.debug_dbug` | ||
SET GLOBAL debug_dbug = '+d,rpl_parallel_simulate_temp_err_xid,sync.wsrep_retry_event_group'; | ||
|
||
--connection master | ||
INSERT INTO t1 VALUES (1); | ||
|
||
--connection node_1_ctrl | ||
SET debug_sync = 'now WAIT_FOR sync.wsrep_retry_event_group_reached'; | ||
--eval SET GLOBAL debug_dbug = '$debug_dbug_orig' | ||
SET debug_sync = 'now SIGNAL signal.wsrep_retry_event_group'; | ||
|
||
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1; | ||
--source include/wait_condition.inc | ||
|
||
|
||
--connection node_1 | ||
SET debug_sync = 'RESET'; | ||
|
||
--connection master | ||
DROP TABLE t1; | ||
|
||
--connection node_1 | ||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' | ||
--source include/wait_condition.inc | ||
|
||
STOP SLAVE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters