Commit fee61edd authored by Jan Lindström's avatar Jan Lindström

MDEV-19939: Galera test failure on galera_toi_ddl_fk_insert

Add sync wait to make sure selects see correct consistent db.
parent 24aa723a
...@@ -32,7 +32,6 @@ galera_parallel_autoinc_largetrx : MDEV-19746 Galera test failures because of ws ...@@ -32,7 +32,6 @@ galera_parallel_autoinc_largetrx : MDEV-19746 Galera test failures because of ws
galera_parallel_autoinc_manytrx : MDEV-19746 Galera test failures because of wsrep_slave_threads identification galera_parallel_autoinc_manytrx : MDEV-19746 Galera test failures because of wsrep_slave_threads identification
galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade
galera_sst_mariabackup_encrypt_with_key : MDEV-19926 Galera SST tests fail galera_sst_mariabackup_encrypt_with_key : MDEV-19926 Galera SST tests fail
galera_toi_ddl_fk_insert : MDEV-19939: Galera test failure on galera_toi_ddl_fk_insert
galera_var_slave_threads : MDEV-19746 Galera test failures because of wsrep_slave_threads identification galera_var_slave_threads : MDEV-19746 Galera test failures because of wsrep_slave_threads identification
galera_wan : MDEV-17259: Test failure on galera.galera_wan galera_wan : MDEV-17259: Test failure on galera.galera_wan
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE ten (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE parent ( CREATE TABLE parent (
id INT PRIMARY KEY AUTO_INCREMENT, id INT PRIMARY KEY AUTO_INCREMENT,
f2 INTEGER, f2 INTEGER
KEY (id)
) ENGINE=InnoDB; ) ENGINE=InnoDB;
CREATE TABLE child ( CREATE TABLE child (
id INT PRIMARY KEY AUTO_INCREMENT, id INT PRIMARY KEY AUTO_INCREMENT,
...@@ -23,19 +22,21 @@ connection node_1b; ...@@ -23,19 +22,21 @@ connection node_1b;
connection node_2; connection node_2;
connection node_2a; connection node_2a;
connection node_1; connection node_1;
SELECT COUNT(*) = 20001 FROM parent; SET SESSION wsrep_sync_wait=15;
COUNT(*) = 20001 SELECT COUNT(*) FROM parent;
1 COUNT(*)
SELECT COUNT(*) = 10000 FROM child; 20001
COUNT(*) = 10000 SELECT COUNT(*) FROM child;
1 COUNT(*)
10000
connection node_2; connection node_2;
SELECT COUNT(*) = 20001 FROM parent; SET SESSION wsrep_sync_wait=15;
COUNT(*) = 20001 SELECT COUNT(*) FROM parent;
1 COUNT(*)
SELECT COUNT(*) = 10000 FROM child; 20001
COUNT(*) = 10000 SELECT COUNT(*) FROM child;
1 COUNT(*)
10000
DROP TABLE child; DROP TABLE child;
DROP TABLE parent; DROP TABLE parent;
DROP TABLE ten; DROP TABLE ten;
...@@ -6,13 +6,12 @@ ...@@ -6,13 +6,12 @@
# This test creates a new FK constraint while concurrent INSERTS are running # This test creates a new FK constraint while concurrent INSERTS are running
# #
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE ten (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE parent ( CREATE TABLE parent (
id INT PRIMARY KEY AUTO_INCREMENT, id INT PRIMARY KEY AUTO_INCREMENT,
f2 INTEGER, f2 INTEGER
KEY (id)
) ENGINE=InnoDB; ) ENGINE=InnoDB;
CREATE TABLE child ( CREATE TABLE child (
...@@ -41,7 +40,6 @@ INSERT INTO parent VALUES (1, 0); ...@@ -41,7 +40,6 @@ INSERT INTO parent VALUES (1, 0);
--let $galera_server_number = 1 --let $galera_server_number = 1
--source include/galera_connect.inc --source include/galera_connect.inc
--connection node_1b --connection node_1b
--sleep 2
--send ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id); --send ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id);
--connection node_1a --connection node_1a
...@@ -57,14 +55,15 @@ INSERT INTO parent VALUES (1, 0); ...@@ -57,14 +55,15 @@ INSERT INTO parent VALUES (1, 0);
--reap --reap
--connection node_1 --connection node_1
SELECT COUNT(*) = 20001 FROM parent; SET SESSION wsrep_sync_wait=15;
SELECT COUNT(*) = 10000 FROM child; SELECT COUNT(*) FROM parent;
SELECT COUNT(*) FROM child;
--connection node_2 --connection node_2
SELECT COUNT(*) = 20001 FROM parent; SET SESSION wsrep_sync_wait=15;
SELECT COUNT(*) = 10000 FROM child; SELECT COUNT(*) FROM parent;
SELECT COUNT(*) FROM child;
DROP TABLE child; DROP TABLE child;
DROP TABLE parent; DROP TABLE parent;
DROP TABLE ten; DROP TABLE ten;
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