Commit fcc0b89d authored by Daniele Sciascia's avatar Daniele Sciascia Committed by GitHub

Fix MTR test galera_3nodes_sr.galera_vote_sr (#1439)

A large INSERT would occasionally fail with a deadlock error. This
is due to a limitation in galera library: large writesets that are
internally fragmented (> 32KB), may fail to replicate during a
configuration change. Even if the configuration change is from primary
to primary.
Changed the test to reduce writeset sizes from ~65K to ~16K.
parent 6297a102
......@@ -14,23 +14,23 @@ SET SESSION wsrep_on=ON;
DELETE FROM t1 WHERE f1 = 2;
connection node_1;
SET AUTOCOMMIT=OFF;
SET SESSION wsrep_trx_fragment_size = 131070;
SET SESSION wsrep_trx_fragment_size = 16384;
START TRANSACTION;
INSERT INTO t1 VALUES (1, REPEAT('A', 65535));
INSERT INTO t1 VALUES (2, REPEAT('A', 65535));
INSERT INTO t1 VALUES (3, REPEAT('A', 65535));
INSERT INTO t1 VALUES (4, REPEAT('A', 65535));
INSERT INTO t1 VALUES (5, REPEAT('A', 65535));
INSERT INTO t1 VALUES (1, REPEAT('A', 16384));
INSERT INTO t1 VALUES (2, REPEAT('A', 16384));
INSERT INTO t1 VALUES (3, REPEAT('A', 16384));
INSERT INTO t1 VALUES (4, REPEAT('A', 16384));
INSERT INTO t1 VALUES (5, REPEAT('A', 16384));
COMMIT;
SELECT COUNT(*) AS expect_0 FROM mysql.wsrep_streaming_log;
expect_0
0
START TRANSACTION;
INSERT INTO t1 VALUES (11, REPEAT('A', 65535));
INSERT INTO t1 VALUES (12, REPEAT('A', 65535));
INSERT INTO t1 VALUES (13, REPEAT('A', 65535));
INSERT INTO t1 VALUES (14, REPEAT('A', 65535));
INSERT INTO t1 VALUES (15, REPEAT('A', 65535));
INSERT INTO t1 VALUES (11, REPEAT('A', 16384));
INSERT INTO t1 VALUES (12, REPEAT('A', 16384));
INSERT INTO t1 VALUES (13, REPEAT('A', 16384));
INSERT INTO t1 VALUES (14, REPEAT('A', 16384));
INSERT INTO t1 VALUES (15, REPEAT('A', 16384));
connection node_2;
SET SESSION wsrep_on=OFF;
Starting mysqld
......@@ -75,23 +75,23 @@ SET SESSION wsrep_on=ON;
DELETE FROM t1 WHERE f1 = 2;
connection node_1;
SET AUTOCOMMIT=OFF;
SET SESSION wsrep_trx_fragment_size = 131070;
SET SESSION wsrep_trx_fragment_size = 16384;
START TRANSACTION;
INSERT INTO t1 VALUES (1, REPEAT('A', 65535));
INSERT INTO t1 VALUES (2, REPEAT('A', 65535));
INSERT INTO t1 VALUES (3, REPEAT('A', 65535));
INSERT INTO t1 VALUES (4, REPEAT('A', 65535));
INSERT INTO t1 VALUES (5, REPEAT('A', 65535));
INSERT INTO t1 VALUES (1, REPEAT('A', 16384));
INSERT INTO t1 VALUES (2, REPEAT('A', 16384));
INSERT INTO t1 VALUES (3, REPEAT('A', 16384));
INSERT INTO t1 VALUES (4, REPEAT('A', 16384));
INSERT INTO t1 VALUES (5, REPEAT('A', 16384));
COMMIT;
SELECT COUNT(*) AS expect_0 FROM mysql.wsrep_streaming_log;
expect_0
0
START TRANSACTION;
INSERT INTO t1 VALUES (11, REPEAT('A', 65535));
INSERT INTO t1 VALUES (12, REPEAT('A', 65535));
INSERT INTO t1 VALUES (13, REPEAT('A', 65535));
INSERT INTO t1 VALUES (14, REPEAT('A', 65535));
INSERT INTO t1 VALUES (15, REPEAT('A', 65535));
INSERT INTO t1 VALUES (11, REPEAT('A', 16384));
INSERT INTO t1 VALUES (12, REPEAT('A', 16384));
INSERT INTO t1 VALUES (13, REPEAT('A', 16384));
INSERT INTO t1 VALUES (14, REPEAT('A', 16384));
INSERT INTO t1 VALUES (15, REPEAT('A', 16384));
connection node_2;
SET SESSION wsrep_on=OFF;
Starting mysqld
......@@ -136,23 +136,23 @@ SET SESSION wsrep_on=ON;
DELETE FROM t1 WHERE f1 = 2;
connection node_1;
SET AUTOCOMMIT=OFF;
SET SESSION wsrep_trx_fragment_size = 131070;
SET SESSION wsrep_trx_fragment_size = 16384;
START TRANSACTION;
INSERT INTO t1 VALUES (1, REPEAT('A', 65535));
INSERT INTO t1 VALUES (2, REPEAT('A', 65535));
INSERT INTO t1 VALUES (3, REPEAT('A', 65535));
INSERT INTO t1 VALUES (4, REPEAT('A', 65535));
INSERT INTO t1 VALUES (5, REPEAT('A', 65535));
INSERT INTO t1 VALUES (1, REPEAT('A', 16384));
INSERT INTO t1 VALUES (2, REPEAT('A', 16384));
INSERT INTO t1 VALUES (3, REPEAT('A', 16384));
INSERT INTO t1 VALUES (4, REPEAT('A', 16384));
INSERT INTO t1 VALUES (5, REPEAT('A', 16384));
COMMIT;
SELECT COUNT(*) AS expect_0 FROM mysql.wsrep_streaming_log;
expect_0
0
START TRANSACTION;
INSERT INTO t1 VALUES (11, REPEAT('A', 65535));
INSERT INTO t1 VALUES (12, REPEAT('A', 65535));
INSERT INTO t1 VALUES (13, REPEAT('A', 65535));
INSERT INTO t1 VALUES (14, REPEAT('A', 65535));
INSERT INTO t1 VALUES (15, REPEAT('A', 65535));
INSERT INTO t1 VALUES (11, REPEAT('A', 16384));
INSERT INTO t1 VALUES (12, REPEAT('A', 16384));
INSERT INTO t1 VALUES (13, REPEAT('A', 16384));
INSERT INTO t1 VALUES (14, REPEAT('A', 16384));
INSERT INTO t1 VALUES (15, REPEAT('A', 16384));
connection node_2;
SET SESSION wsrep_on=OFF;
Starting mysqld
......@@ -194,3 +194,4 @@ CALL mtr.add_suppression("Slave SQL: Could not execute Write_rows event on table
CALL mtr.add_suppression("Write_rows_v1 apply failed");
CALL mtr.add_suppression("Inconsistent by consensus");
CALL mtr.add_suppression("WSREP: Failed to apply write set: ");
CALL mtr.add_suppression("WSREP: Failed to report last committed");
......@@ -15,25 +15,26 @@ DELETE FROM t1 WHERE f1 = 2;
# Perform an SR transaction that will hit the inconsistency
--connection node_1
--let $fragment_size = 16384
SET AUTOCOMMIT=OFF;
SET SESSION wsrep_trx_fragment_size = 131070;
--eval SET SESSION wsrep_trx_fragment_size = $fragment_size
START TRANSACTION;
INSERT INTO t1 VALUES (1, REPEAT('A', 65535));
INSERT INTO t1 VALUES (2, REPEAT('A', 65535));
INSERT INTO t1 VALUES (3, REPEAT('A', 65535));
INSERT INTO t1 VALUES (4, REPEAT('A', 65535));
INSERT INTO t1 VALUES (5, REPEAT('A', 65535));
--eval INSERT INTO t1 VALUES (1, REPEAT('A', $fragment_size))
--eval INSERT INTO t1 VALUES (2, REPEAT('A', $fragment_size))
--eval INSERT INTO t1 VALUES (3, REPEAT('A', $fragment_size))
--eval INSERT INTO t1 VALUES (4, REPEAT('A', $fragment_size))
--eval INSERT INTO t1 VALUES (5, REPEAT('A', $fragment_size))
COMMIT;
SELECT COUNT(*) AS expect_0 FROM mysql.wsrep_streaming_log;
# Perform another SR transaction in order to have stuff in the
# wsrep_streaming_log table
START TRANSACTION;
INSERT INTO t1 VALUES (11, REPEAT('A', 65535));
INSERT INTO t1 VALUES (12, REPEAT('A', 65535));
INSERT INTO t1 VALUES (13, REPEAT('A', 65535));
INSERT INTO t1 VALUES (14, REPEAT('A', 65535));
INSERT INTO t1 VALUES (15, REPEAT('A', 65535));
--eval INSERT INTO t1 VALUES (11, REPEAT('A', $fragment_size))
--eval INSERT INTO t1 VALUES (12, REPEAT('A', $fragment_size))
--eval INSERT INTO t1 VALUES (13, REPEAT('A', $fragment_size))
--eval INSERT INTO t1 VALUES (14, REPEAT('A', $fragment_size))
--eval INSERT INTO t1 VALUES (15, REPEAT('A', $fragment_size))
# Node #2 has dropped from the cluster due to voting
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
......
......@@ -33,6 +33,7 @@ CALL mtr.add_suppression("Write_rows_v1 apply failed");
CALL mtr.add_suppression("Inconsistent by consensus");
CALL mtr.add_suppression("WSREP: Failed to apply write set: ");
#CALL mtr.add_suppression("no THD for trx");
CALL mtr.add_suppression("WSREP: Failed to report last committed");
# Restore original auto_increment_offset values.
--source ../galera/include/auto_increment_offset_restore.inc
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