Commit 9e3aa83f authored by Jan Lindström's avatar Jan Lindström

MDEV-24443 : galera.lp1376747-4 MTR fails: Result length mismatch

Use debug_sync to force FTWRL to pause in correct state.
parent db9b54f1
......@@ -3,26 +3,23 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
FLUSH TABLE WITH READ LOCK;
FLUSH TABLES WITH READ LOCK;
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2,3);
connection node_2a;
SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SET debug_sync='flush_tables_with_read_lock_after_acquire_locks SIGNAL parked2 WAIT_FOR go2';
FLUSH TABLES t1 WITH READ LOCK;;
connection node_2;
SET debug_sync='now WAIT_FOR parked2';
SET debug_sync='now SIGNAL go2';
UNLOCK TABLES;
SHOW CREATE TABLE t1;
Table Create Table
......@@ -30,8 +27,10 @@ t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
set debug_sync= 'RESET';
connection node_2a;
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
......
......@@ -5,7 +5,8 @@
# after provider is unpaused
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
--let $galera_connection_name = node_2a
--let $galera_server_number = 2
......@@ -17,8 +18,7 @@ INSERT INTO t1 VALUES (1);
--connection node_2
SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF;
FLUSH TABLE WITH READ LOCK;
FLUSH TABLES WITH READ LOCK;
--connection node_1
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
......@@ -26,25 +26,33 @@ INSERT INTO t1 VALUES (2,3);
--connection node_2a
SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF;
SHOW CREATE TABLE t1;
SET debug_sync='flush_tables_with_read_lock_after_acquire_locks SIGNAL parked2 WAIT_FOR go2';
--send FLUSH TABLES t1 WITH READ LOCK;
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE 'committed%';
--source include/wait_condition.inc
SET debug_sync='now WAIT_FOR parked2';
# let the flush table wait in pause state before we unlock
# table otherwise there is window where-in flush table is
# yet to wait in pause and unlock allows alter table to proceed.
# this is because send is asynchronous.
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE Info LIKE 'FLUSH TABLES t1 WITH READ LOCK';
--let $wait_condition_on_error_output = SHOW PROCESSLIST
--source include/wait_condition_with_debug.inc
SET debug_sync='now SIGNAL go2';
# this will release existing lock but will not resume
# the cluster as there is new FTRL that is still pausing it.
UNLOCK TABLES;
SHOW CREATE TABLE t1;
set debug_sync= 'RESET';
--connection node_2a
--reap
UNLOCK TABLES;
--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
--source include/wait_condition.inc
SET SESSION wsrep_sync_wait = DEFAULT;
SHOW CREATE TABLE t1;
SELECT * from t1;
......
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