summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsjaakola <seppo.jaakola@iki.fi>2021-12-10 11:38:27 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2021-12-10 12:10:42 +0200
commit74b3d4252a291456982c8e61a3af3d9936c6fbdd (patch)
tree687aa700b420e76323a3da93879e561e2d3c5088
parent5e8148819eac7e48ce962ae27b9d27ac0c32f8ed (diff)
downloadmariadb-git-74b3d4252a291456982c8e61a3af3d9936c6fbdd.tar.gz
MDEV-27218 mtr test galera.MDEV-20793 has sporadic false positive failuresbb-10.4-MDEV-27218
Fixes to make the galera.MDEV-20793 test deterministic. Specifically, after --send COMMIT, there is now a sync point to catch a known state of the COMMIT execution
-rw-r--r--mysql-test/suite/galera/r/MDEV-20793.result7
-rw-r--r--mysql-test/suite/galera/t/MDEV-20793.test26
2 files changed, 31 insertions, 2 deletions
diff --git a/mysql-test/suite/galera/r/MDEV-20793.result b/mysql-test/suite/galera/r/MDEV-20793.result
index b420c8720f5..feb068f258f 100644
--- a/mysql-test/suite/galera/r/MDEV-20793.result
+++ b/mysql-test/suite/galera/r/MDEV-20793.result
@@ -9,7 +9,6 @@ connection node_1;
SET SESSION wsrep_retry_autocommit = 0;
START TRANSACTION;
UPDATE t1 SET f2 = 1;
-SET SESSION debug_sync = "wsrep_before_replay SIGNAL reached WAIT_FOR continue";
connection node_1_ctrl;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
@@ -24,9 +23,15 @@ UPDATE t1 SET f2 = 2 WHERE f1 = 5;
connection node_1_ctrl;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
connection node_1;
+SET SESSION debug_sync = "wsrep_before_replay SIGNAL reached WAIT_FOR continue";
COMMIT;
connection node_1_ctrl;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET SESSION debug_sync = "now WAIT_FOR reached";
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_slave_enter_sync';
diff --git a/mysql-test/suite/galera/t/MDEV-20793.test b/mysql-test/suite/galera/t/MDEV-20793.test
index 13ff3cbe77b..6835a73a2a4 100644
--- a/mysql-test/suite/galera/t/MDEV-20793.test
+++ b/mysql-test/suite/galera/t/MDEV-20793.test
@@ -30,9 +30,9 @@ SET GLOBAL wsrep_slave_threads = 2;
SET SESSION wsrep_retry_autocommit = 0;
START TRANSACTION;
UPDATE t1 SET f2 = 1;
-SET SESSION debug_sync = "wsrep_before_replay SIGNAL reached WAIT_FOR continue";
--connection node_1_ctrl
+# set sync point for incoming applier
--let $galera_sync_point = apply_monitor_slave_enter_sync
--source include/galera_set_sync_point.inc
@@ -42,8 +42,11 @@ SET SESSION debug_sync = "wsrep_before_replay SIGNAL reached WAIT_FOR continue";
INSERT INTO t1 VALUES (2, 2);
--connection node_1_ctrl
+# wait to see the INSERT from node_2 reaching applier sync point
--source include/galera_wait_sync_point.inc
--source include/galera_clear_sync_point.inc
+
+# set sync point to catch other write set applying from node_2
--let $galera_sync_point = local_monitor_slave_enter_sync
--source include/galera_set_sync_point.inc
@@ -52,17 +55,38 @@ INSERT INTO t1 VALUES (2, 2);
UPDATE t1 SET f2 = 2 WHERE f1 = 5;
--connection node_1_ctrl
+# wait until both appliers are stopped in sync points
--let $galera_sync_point = apply_monitor_slave_enter_sync local_monitor_slave_enter_sync
--source include/galera_wait_sync_point.inc
+--source include/galera_clear_sync_point.inc
+
+# set sync point for catching node_1 transaction just before committing
+--let $galera_sync_point = after_replicate_sync
+--source include/galera_set_sync_point.inc
--connection node_1
+# set sync point, which will stop execution after COMMIT has been BF aborted
+# and send the COMMIT, it should stop in commit_monitor_master_enter_sync point
+SET SESSION debug_sync = "wsrep_before_replay SIGNAL reached WAIT_FOR continue";
--send COMMIT
--connection node_1_ctrl
+# wait until both appliers and local COMMIT are idle in their sync points
+--let $galera_sync_point = after_replicate_sync apply_monitor_slave_enter_sync local_monitor_slave_enter_sync
+--source include/galera_wait_sync_point.inc
+
+# release local COMMIT processing, it will continue and pause first before certification,
+--let $galera_sync_point = after_replicate_sync
+--source include/galera_signal_sync_point.inc
+
+# release first applier (INSERT), it should BF abort the local COMMIT processing
--let $galera_sync_point = apply_monitor_slave_enter_sync
--source include/galera_signal_sync_point.inc
+
+# wait to see that COMMIT was BF aborted and has reached replaying state
SET SESSION debug_sync = "now WAIT_FOR reached";
+# release the latter applier, with real lock conflict
--let $galera_sync_point = local_monitor_slave_enter_sync
--source include/galera_signal_sync_point.inc
--source include/galera_clear_sync_point.inc