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; ...@@ -3,26 +3,23 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
connection node_2; connection node_2;
SET session wsrep_sync_wait=0; SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF; FLUSH TABLES WITH READ LOCK;
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;
connection node_1; connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER; ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2,3); INSERT INTO t1 VALUES (2,3);
connection node_2a; connection node_2a;
SET session wsrep_sync_wait=0; 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; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) 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;; FLUSH TABLES t1 WITH READ LOCK;;
connection node_2; connection node_2;
SET debug_sync='now WAIT_FOR parked2';
SET debug_sync='now SIGNAL go2';
UNLOCK TABLES; UNLOCK TABLES;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
...@@ -30,8 +27,10 @@ t1 CREATE TABLE `t1` ( ...@@ -30,8 +27,10 @@ t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
set debug_sync= 'RESET';
connection node_2a; connection node_2a;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION wsrep_sync_wait = DEFAULT;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
# after provider is unpaused # after provider is unpaused
# #
--source include/galera_cluster.inc --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_connection_name = node_2a
--let $galera_server_number = 2 --let $galera_server_number = 2
...@@ -17,8 +18,7 @@ INSERT INTO t1 VALUES (1); ...@@ -17,8 +18,7 @@ INSERT INTO t1 VALUES (1);
--connection node_2 --connection node_2
SET session wsrep_sync_wait=0; SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF; FLUSH TABLES WITH READ LOCK;
FLUSH TABLE WITH READ LOCK;
--connection node_1 --connection node_1
ALTER TABLE t1 ADD COLUMN f2 INTEGER; ALTER TABLE t1 ADD COLUMN f2 INTEGER;
...@@ -26,25 +26,33 @@ INSERT INTO t1 VALUES (2,3); ...@@ -26,25 +26,33 @@ INSERT INTO t1 VALUES (2,3);
--connection node_2a --connection node_2a
SET session wsrep_sync_wait=0; SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF;
SHOW CREATE TABLE t1; 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; --send FLUSH TABLES t1 WITH READ LOCK;
--connection node_2 --connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE 'committed%'; SET debug_sync='now WAIT_FOR parked2';
--source include/wait_condition.inc
# 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; UNLOCK TABLES;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
set debug_sync= 'RESET';
--connection node_2a --connection node_2a
--reap --reap
UNLOCK TABLES; UNLOCK TABLES;
--let $wait_condition = SELECT COUNT(*) = 2 FROM t1; SET SESSION wsrep_sync_wait = DEFAULT;
--source include/wait_condition.inc
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * from 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