summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsjaakola <seppo.jaakola@iki.fi>2021-12-13 12:13:03 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2021-12-14 08:25:31 +0200
commit66b492f3e43e357951ee6b1c93f4afabcbfec9ba (patch)
treebf05162e7c0e63572d33c3123ce98c4c8a8d5e15
parent74b3d4252a291456982c8e61a3af3d9936c6fbdd (diff)
downloadmariadb-git-66b492f3e43e357951ee6b1c93f4afabcbfec9ba.tar.gz
Fix for the test galera.galera_UK_conflict
mtr test galera.galera_UK_conflict, has rather distorted logic in test scenario 2. The test would fail always with: CURRENT_TEST: galera.galera_UK_conflict mysqltest: In included file "./include/galera_wait_sync_point.inc": included from /home/seppo/work/wsrep/mariadb-server/mysql-test/suite/galera/t/galera_UK_conflict.test at line 216: At line 3: query 'SET SESSION wsrep_on = 0' failed: 1179: You are not allowed to execute this command in a transaction This happens because wait_condition is called in wrong connection (node_1, which is excuting MST transaction) This test is fixed by using contl connection for wait contdition check, and new result is recorded as well
-rw-r--r--mysql-test/suite/galera/r/galera_UK_conflict.result57
-rw-r--r--mysql-test/suite/galera/t/galera_UK_conflict.test8
2 files changed, 58 insertions, 7 deletions
diff --git a/mysql-test/suite/galera/r/galera_UK_conflict.result b/mysql-test/suite/galera/r/galera_UK_conflict.result
index cc7e17d7c58..b0420d58ede 100644
--- a/mysql-test/suite/galera/r/galera_UK_conflict.result
+++ b/mysql-test/suite/galera/r/galera_UK_conflict.result
@@ -71,6 +71,31 @@ INSERT INTO t1 VALUES (8,8,8);
SELECT COUNT(*) FROM t1;
COUNT(*)
7
+SELECT * FROM t1;
+f1 f2 f3
+1 1 0
+3 3 1
+4 4 2
+5 5 2
+7 7 7
+8 8 8
+10 10 0
+connection node_1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+7
+SELECT * FROM t1;
+f1 f2 f3
+1 1 0
+3 3 1
+4 4 2
+5 5 2
+7 7 7
+8 8 8
+10 10 0
+DROP TABLE t1;
+test scenario 2
+connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 int, f3 int, unique key keyj (f2));
INSERT INTO t1 VALUES (1, 1, 0);
INSERT INTO t1 VALUES (3, 3, 0);
@@ -92,9 +117,9 @@ SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync';
connection node_1;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-7
+COMMIT;
+connection node_1a;
+SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_replay_cb";
@@ -125,8 +150,32 @@ f1 f2 f3
3 3 1
4 4 2
5 5 2
-8 8 8
10 10 0
INSERT INTO t1 VALUES (7,7,7);
INSERT INTO t1 VALUES (8,8,8);
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+7
+SELECT * FROM t1;
+f1 f2 f3
+1 1 0
+3 3 1
+4 4 2
+5 5 2
+7 7 7
+8 8 8
+10 10 0
+connection node_1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+7
+SELECT * FROM t1;
+f1 f2 f3
+1 1 0
+3 3 1
+4 4 2
+5 5 2
+7 7 7
+8 8 8
+10 10 0
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_UK_conflict.test b/mysql-test/suite/galera/t/galera_UK_conflict.test
index 25f414a5764..7a14821cc32 100644
--- a/mysql-test/suite/galera/t/galera_UK_conflict.test
+++ b/mysql-test/suite/galera/t/galera_UK_conflict.test
@@ -207,14 +207,16 @@ INSERT INTO t1 VALUES (5, 5, 2);
--source include/galera_set_sync_point.inc
--connection node_1
---let $wait_condition = SELECT COUNT(*) = 7 FROM t1
---source include/wait_condition.inc
-SELECT COUNT(*) FROM t1;
+--send COMMIT
+
+--connection node_1a
# wait for the local commit to enter in commit monitor wait state
--let $galera_sync_point = apply_monitor_slave_enter_sync commit_monitor_master_enter_sync
--source include/galera_wait_sync_point.inc
--source include/galera_clear_sync_point.inc
+# first applier is now waiting in before commit, and local trx in commit monitor
+
# set sync point before replaying
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_replay_cb";