-
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.
- Loading branch information
Showing
37 changed files
with
640 additions
and
301 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
connection node_2; | ||
connection node_1; | ||
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; | ||
connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; | ||
set wsrep_sync_wait = 0; | ||
CREATE TABLE t1(a int not null primary key auto_increment, b int) engine=InnoDB; | ||
INSERT INTO t1 VALUES (1,2); | ||
connection node_1a; | ||
BEGIN; | ||
UPDATE t1 SET b=3 WHERE a=1; | ||
connection node_1; | ||
set debug_sync='wsrep_kill_before_awake_no_mutex SIGNAL before_kill WAIT_FOR continue'; | ||
connection node_1b; | ||
set debug_sync= 'now WAIT_FOR before_kill'; | ||
connection node_2; | ||
UPDATE t1 SET b=7 WHERE a=1; | ||
connection node_1b; | ||
set debug_sync= 'now SIGNAL continue'; | ||
connection node_1; | ||
DROP TABLE t1; | ||
SET DEBUG_SYNC= 'RESET'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
connection node_2; | ||
connection node_1; | ||
connect node_1_kill, 127.0.0.1, root, , test, $NODE_MYPORT_1; | ||
connect node_1_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_1; | ||
SET SESSION wsrep_sync_wait = 0; | ||
connect node_1_follower, 127.0.0.1, root, , test, $NODE_MYPORT_1; | ||
SET SESSION wsrep_sync_wait = 0; | ||
connection node_1; | ||
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; | ||
SET SESSION DEBUG_SYNC = "commit_before_enqueue SIGNAL leader_before_enqueue_reached WAIT_FOR leader_before_enqueue_continue"; | ||
INSERT INTO t1 VALUES (1); | ||
connection node_1_ctrl; | ||
SET DEBUG_SYNC = "now WAIT_FOR leader_before_enqueue_reached"; | ||
connection node_1_follower; | ||
INSERT INTO t1 VALUES (2);; | ||
connection node_1_ctrl; | ||
connection node_1_kill; | ||
# Execute KILL QUERY for group commit follower | ||
SET DEBUG_SYNC = "now SIGNAL leader_before_enqueue_continue"; | ||
connection node_1_follower; | ||
connection node_1; | ||
SELECT * FROM t1; | ||
f1 | ||
1 | ||
2 | ||
SET DEBUG_SYNC = "RESET"; | ||
DROP TABLE t1; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--source include/galera_cluster.inc | ||
--source include/have_innodb.inc | ||
--source include/have_debug_sync.inc | ||
--source include/galera_have_debug_sync.inc | ||
|
||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 | ||
--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1 | ||
set wsrep_sync_wait = 0; | ||
|
||
CREATE TABLE t1(a int not null primary key auto_increment, b int) engine=InnoDB; | ||
INSERT INTO t1 VALUES (1,2); | ||
|
||
--connection node_1a | ||
--let $victim_id = `SELECT CONNECTION_ID()` | ||
BEGIN; | ||
UPDATE t1 SET b=3 WHERE a=1; | ||
|
||
--connection node_1 | ||
set debug_sync='wsrep_kill_before_awake_no_mutex SIGNAL before_kill WAIT_FOR continue'; | ||
--disable_query_log | ||
--disable_result_log | ||
--send_eval KILL CONNECTION $victim_id | ||
--enable_result_log | ||
--enable_query_log | ||
|
||
--connection node_1b | ||
set debug_sync= 'now WAIT_FOR before_kill'; | ||
|
||
--connection node_2 | ||
UPDATE t1 SET b=7 WHERE a=1; | ||
|
||
--connection node_1b | ||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE User = 'system user' AND State LIKE 'Update_rows_log_event%'; | ||
--source include/wait_condition.inc | ||
set debug_sync= 'now SIGNAL continue'; | ||
|
||
--connection node_1 | ||
--reap | ||
DROP TABLE t1; | ||
SET DEBUG_SYNC= 'RESET'; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
!include ../galera_2nodes.cnf | ||
|
||
[mysqld] | ||
log-bin | ||
log-slave-updates |
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,69 @@ | ||
# | ||
# Verify that transaction which has reached group commit queue | ||
# cannot be killed. If the kill succeeds, assertion for | ||
# wsrep transaction state will fail. | ||
# | ||
# If the bug is present, i.e. wsrep transaction gets killed during | ||
# group commit wait, this test is enough to reproduce the crash | ||
# most of the time. | ||
# | ||
|
||
--source include/have_innodb.inc | ||
--source include/have_debug_sync.inc | ||
--source include/galera_cluster.inc | ||
|
||
# Connection for KILL commands | ||
--connect node_1_kill, 127.0.0.1, root, , test, $NODE_MYPORT_1 | ||
# Connection for sync point control | ||
--connect node_1_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_1 | ||
SET SESSION wsrep_sync_wait = 0; | ||
# Connection for group commit follower | ||
--connect node_1_follower, 127.0.0.1, root, , test, $NODE_MYPORT_1 | ||
# Need to disable sync wait to reach commit queue when leader | ||
# is blocked. | ||
SET SESSION wsrep_sync_wait = 0; | ||
--let $follower_id = `SELECT CONNECTION_ID()` | ||
|
||
--connection node_1 | ||
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; | ||
|
||
SET SESSION DEBUG_SYNC = "commit_before_enqueue SIGNAL leader_before_enqueue_reached WAIT_FOR leader_before_enqueue_continue"; | ||
--send INSERT INTO t1 VALUES (1) | ||
|
||
--connection node_1_ctrl | ||
SET DEBUG_SYNC = "now WAIT_FOR leader_before_enqueue_reached"; | ||
|
||
--connection node_1_follower | ||
# SET SESSION DEBUG_SYNC = "group_commit_waiting_for_prior SIGNAL follower_waiting_for_prior_reached WAIT_FOR follower_waiting_for_prior_continue"; | ||
--send INSERT INTO t1 VALUES (2); | ||
|
||
--connection node_1_ctrl | ||
# TODO: Is it possible to use sync points to enforce group commit to happen? | ||
# The leader will hold commit monitor in commit_before_enqueue sync point, | ||
# which prevents the follower to reach the group commit wait state. | ||
# We now sleep and expect the follower to reach group commit, but this | ||
# may cause false negatives. | ||
--sleep 1 | ||
|
||
--connection node_1_kill | ||
--echo # Execute KILL QUERY for group commit follower | ||
--disable_query_log | ||
--disable_result_log | ||
# Because it is currently impossible to verify that the | ||
# follower has reached group commit queue, the KILL may | ||
# sometimes return success. | ||
--error 0,ER_KILL_DENIED_ERROR | ||
--eval KILL QUERY $follower_id | ||
--enable_result_log | ||
--enable_query_log | ||
|
||
SET DEBUG_SYNC = "now SIGNAL leader_before_enqueue_continue"; | ||
--connection node_1_follower | ||
--reap | ||
|
||
--connection node_1 | ||
--reap | ||
SELECT * FROM t1; | ||
|
||
SET DEBUG_SYNC = "RESET"; | ||
DROP TABLE t1; |
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
Oops, something went wrong.