Skip to content

Commit

Permalink
MDEV-19968: Galera test failure on galera_load_data
Browse files Browse the repository at this point in the history
Add wait conditions and compare cardinality etc information
between nodes and print something only if they differ.
  • Loading branch information
Jan Lindström committed Aug 21, 2019
1 parent 6c06def commit 1a3c77e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 49 deletions.
42 changes: 4 additions & 38 deletions mysql-test/suite/galera/r/galera_load_data.result
Original file line number Diff line number Diff line change
Expand Up @@ -32,49 +32,15 @@ Warnings:
Note 1031 Storage engine InnoDB of the table `cardtest02`.`cardtest_tbl` doesn't have this option
UNLOCK TABLES;
use cardtest02;
show indexes from cardtest_tbl;
Table cardtest_tbl
Non_unique 0
Key_name PRIMARY
Seq_in_index 1
Column_name id
Collation A
Cardinality 301
Sub_part NULL
Packed NULL
Null
Index_type BTREE
Comment
Index_comment
select table_rows, avg_row_length, data_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';
table_rows 301
avg_row_length 81
data_length 24576
select count(*) from cardtest_tbl;
count(*) 301
count(*)
301
connection node_2;
set session wsrep_sync_wait=15;
use cardtest02;
show indexes from cardtest_tbl;
Table cardtest_tbl
Non_unique 0
Key_name PRIMARY
Seq_in_index 1
Column_name id
Collation A
Cardinality 301
Sub_part NULL
Packed NULL
Null
Index_type BTREE
Comment
Index_comment
select table_rows, avg_row_length, data_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';
table_rows 301
avg_row_length 81
data_length 24576
select count(*) from cardtest_tbl;
count(*) 301
count(*)
301
connection node_1;
use test;
drop database cardtest02;
42 changes: 31 additions & 11 deletions mysql-test/suite/galera/t/galera_load_data.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
--source include/galera_cluster.inc


--connection node_1

create database cardtest02;
Expand Down Expand Up @@ -38,23 +37,44 @@ ALTER TABLE `cardtest_tbl` ENABLE KEYS;
UNLOCK TABLES;

use cardtest02;
--sleep 15
--vertical_results
show indexes from cardtest_tbl;
--vertical_results
select table_rows, avg_row_length, data_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';
--let $wait_timeout=600
--let $wait_condition = SELECT table_rows = 301 from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';
--source include/wait_condition.inc

select count(*) from cardtest_tbl;

let $cardinality1 = `SELECT cardinality from information_schema.statistics WHERE TABLE_NAME = 'cardtest_tbl'`;
let $table_rows1 = `SELECT table_rows from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl'`;
let $avg_row_length1 = `SELECT avg_row_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl'`;
let $data_length1 = `SELECT data_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl'`;

--connection node_2
set session wsrep_sync_wait=15;
use cardtest02;
--sleep 15
--vertical_results
show indexes from cardtest_tbl;
--vertical_results
select table_rows, avg_row_length, data_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';

--let $wait_timeout=600
--let $wait_condition = SELECT table_rows = 301 from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';
--source include/wait_condition.inc

select count(*) from cardtest_tbl;

if (`SELECT cardinality <> $cardinality1 from information_schema.statistics WHERE TABLE_NAME = 'cardtest_tbl'`)
{
SELECT cardinality from information_schema.statistics WHERE TABLE_NAME = 'cardtest_tbl';
}
if (`SELECT table_rows <> $table_rows1 from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl'`)
{
SELECT table_rows from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';
}
if (`SELECT avg_row_length <> $avg_row_length1 from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl'`)
{
SELECT avg_row_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';
}
if (`SELECT data_length <> $data_length1 from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl'`)
{
SELECT data_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';
}

--connection node_1
use test;
drop database cardtest02;
Expand Down

0 comments on commit 1a3c77e

Please sign in to comment.