Commit 66b492f3 authored by sjaakola's avatar sjaakola Committed by Jan Lindström

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
parent 74b3d425
...@@ -71,6 +71,31 @@ INSERT INTO t1 VALUES (8,8,8); ...@@ -71,6 +71,31 @@ INSERT INTO t1 VALUES (8,8,8);
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
COUNT(*) COUNT(*)
7 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)); 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 (1, 1, 0);
INSERT INTO t1 VALUES (3, 3, 0); INSERT INTO t1 VALUES (3, 3, 0);
...@@ -92,9 +117,9 @@ SET SESSION wsrep_on = 1; ...@@ -92,9 +117,9 @@ SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug='; SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync';
connection node_1; connection node_1;
SELECT COUNT(*) FROM t1; COMMIT;
COUNT(*) connection node_1a;
7 SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1; SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug='; SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_replay_cb"; SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_replay_cb";
...@@ -125,8 +150,32 @@ f1 f2 f3 ...@@ -125,8 +150,32 @@ f1 f2 f3
3 3 1 3 3 1
4 4 2 4 4 2
5 5 2 5 5 2
8 8 8
10 10 0 10 10 0
INSERT INTO t1 VALUES (7,7,7); INSERT INTO t1 VALUES (7,7,7);
INSERT INTO t1 VALUES (8,8,8); 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; DROP TABLE t1;
...@@ -207,14 +207,16 @@ INSERT INTO t1 VALUES (5, 5, 2); ...@@ -207,14 +207,16 @@ INSERT INTO t1 VALUES (5, 5, 2);
--source include/galera_set_sync_point.inc --source include/galera_set_sync_point.inc
--connection node_1 --connection node_1
--let $wait_condition = SELECT COUNT(*) = 7 FROM t1 --send COMMIT
--source include/wait_condition.inc
SELECT COUNT(*) FROM t1; --connection node_1a
# wait for the local commit to enter in commit monitor wait state # 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 --let $galera_sync_point = apply_monitor_slave_enter_sync commit_monitor_master_enter_sync
--source include/galera_wait_sync_point.inc --source include/galera_wait_sync_point.inc
--source include/galera_clear_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 sync point before replaying
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_replay_cb"; SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_replay_cb";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment