From 0d5c605b60f8fa6eea77c78ce02d7aec056f95d0 Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Mon, 10 Apr 2017 13:09:20 +0300 Subject: [PATCH] MW-369 Fixed test MW-369D, recorded MW-369C, MW-369D --- mysql-test/suite/galera/r/MW-369A.result | 1 + mysql-test/suite/galera/r/MW-369B.result | 1 + mysql-test/suite/galera/r/MW-369C.result | 30 +++++++++++++++++++++++ mysql-test/suite/galera/r/MW-369D.result | 31 ++++++++++++++++++++++++ mysql-test/suite/galera/t/MW-369.inc | 1 + mysql-test/suite/galera/t/MW-369C.test | 2 ++ mysql-test/suite/galera/t/MW-369D.test | 8 +++--- 7 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 mysql-test/suite/galera/r/MW-369C.result create mode 100644 mysql-test/suite/galera/r/MW-369D.result diff --git a/mysql-test/suite/galera/r/MW-369A.result b/mysql-test/suite/galera/r/MW-369A.result index 9e8ed8fc100..50215a1f2a8 100644 --- a/mysql-test/suite/galera/r/MW-369A.result +++ b/mysql-test/suite/galera/r/MW-369A.result @@ -16,6 +16,7 @@ SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync'; COMMIT; SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync'; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction diff --git a/mysql-test/suite/galera/r/MW-369B.result b/mysql-test/suite/galera/r/MW-369B.result index b8916a5fc4e..c368f00ec90 100644 --- a/mysql-test/suite/galera/r/MW-369B.result +++ b/mysql-test/suite/galera/r/MW-369B.result @@ -18,6 +18,7 @@ SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync'; COMMIT; SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync'; SELECT * FROM p; diff --git a/mysql-test/suite/galera/r/MW-369C.result b/mysql-test/suite/galera/r/MW-369C.result new file mode 100644 index 00000000000..56656ad75f0 --- /dev/null +++ b/mysql-test/suite/galera/r/MW-369C.result @@ -0,0 +1,30 @@ +CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB; +CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, +CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)) ; +INSERT INTO p VALUES (1, 0); +INSERT INTO p VALUES (2, 0); +INSERT INTO c VALUES (1, 1); +SET AUTOCOMMIT=ON; +START TRANSACTION; +UPDATE p SET f2 = 1 WHERE f1 = 1; +SET SESSION wsrep_sync_wait = 0; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +DELETE FROM c WHERE f1 = 1; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync'; +COMMIT; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync'; +SELECT * FROM p; +f1 f2 +1 1 +2 0 +SELECT * FROM c; +f1 p_id +DROP TABLE c; +DROP TABLE p; diff --git a/mysql-test/suite/galera/r/MW-369D.result b/mysql-test/suite/galera/r/MW-369D.result new file mode 100644 index 00000000000..2ab5b5ac262 --- /dev/null +++ b/mysql-test/suite/galera/r/MW-369D.result @@ -0,0 +1,31 @@ +CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB; +CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, +CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)) ; +INSERT INTO p VALUES (1, 0); +INSERT INTO p VALUES (2, 0); +SET AUTOCOMMIT=ON; +START TRANSACTION; +UPDATE p SET f2 = 1 WHERE f1 = 1; +SET SESSION wsrep_sync_wait = 0; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +INSERT INTO c VALUES (1, 1); +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync'; +COMMIT; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync'; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +SELECT * FROM p; +f1 f2 +1 0 +2 0 +SELECT * FROM c; +f1 p_id +1 1 +DROP TABLE c; +DROP TABLE p; diff --git a/mysql-test/suite/galera/t/MW-369.inc b/mysql-test/suite/galera/t/MW-369.inc index ed750de93e4..fdc26823cca 100644 --- a/mysql-test/suite/galera/t/MW-369.inc +++ b/mysql-test/suite/galera/t/MW-369.inc @@ -61,6 +61,7 @@ SET SESSION wsrep_sync_wait = 0; --connection node_1a --let $galera_sync_point = apply_monitor_slave_enter_sync local_monitor_enter_sync --source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc --let $galera_sync_point = apply_monitor_slave_enter_sync --source include/galera_signal_sync_point.inc --let $galera_sync_point = local_monitor_enter_sync diff --git a/mysql-test/suite/galera/t/MW-369C.test b/mysql-test/suite/galera/t/MW-369C.test index 903eda6bf7d..d4b1a08df84 100644 --- a/mysql-test/suite/galera/t/MW-369C.test +++ b/mysql-test/suite/galera/t/MW-369C.test @@ -16,9 +16,11 @@ # # Expected Outcome: # ================ +# # Both operations on node_1 and node_2 should succeed without conflicts. # The parent table should contain values (1, 1), (2, 0) and the child # table should be empty. +# --source include/galera_cluster.inc --source include/have_innodb.inc diff --git a/mysql-test/suite/galera/t/MW-369D.test b/mysql-test/suite/galera/t/MW-369D.test index 6b86da1da6a..db2bfcd09c0 100644 --- a/mysql-test/suite/galera/t/MW-369D.test +++ b/mysql-test/suite/galera/t/MW-369D.test @@ -15,9 +15,10 @@ # # Expected Outcome: # ================ -# Both operations on node_1 and node_2 should succeed without conflicts. -# The parent table should contain values (1, 1), (2, 0) and the child -# table should contain a row (1, 1) +# +# The parent operation on connection node_1 will conflict with an insert +# to node_2. The parent table will contain rows (1, 0), (2, 0) and +# the child table will contain row (1, 1). # --source include/galera_cluster.inc @@ -38,6 +39,7 @@ INSERT INTO p VALUES (2, 0); # Commit succeeds --connection node_1 +--error ER_LOCK_DEADLOCK --reap --connection node_2