1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
--source include/galera_cluster.inc
--source include/have_innodb.inc
#
# Test that if wsrep_trx_fragment_size > repl.max_ws_size, no SR takes place and
# the transaction is properly aborted.
#
--connection node_1
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(254)) ENGINE=InnoDB;
CREATE TABLE ten (f1 INTEGER);
INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
--let $wsrep_trx_fragment_size_orig = `SELECT @@wsrep_trx_fragment_size`
--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
SET SESSION wsrep_trx_fragment_size = 256;
SET GLOBAL wsrep_provider_options='repl.max_ws_size=128';
#
# Create a transaction larger than repl.max_ws_size
#
SET AUTOCOMMIT=OFF;
START TRANSACTION;
--error ER_ERROR_DURING_COMMIT,ER_ERROR_ON_WRITE,ER_BINLOG_ROW_LOGGING_FAILED
INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1, ten AS a2;
#
# We expect that the transaction can not complete successfully
#
--connection node_2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
--sleep 2
SELECT COUNT(*) = 0 FROM t1;
--connection node_2
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
SELECT COUNT(*) = 0 FROM t1;
#
# Cleanup
#
--connection node_1
--disable_query_log
--eval SET GLOBAL wsrep_trx_fragment_size = $wsrep_trx_fragment_size_orig;
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
--enable_query_log
DROP TABLE t1;
DROP TABLE ten;
call mtr.add_suppression('WSREP: SR rollback replication failure');
call mtr.add_suppression('WSREP: transaction size limit');
call mtr.add_suppression('WSREP: SR rbr write fail');
call mtr.add_suppression('WSREP: Maximum writeset size exceeded by ');
call mtr.add_suppression('WSREP: transaction size exceeded');
call mtr.add_suppression('WSREP: fragment replication failed: ');
call mtr.add_suppression('WSREP: post commit failed for SR rollback');
call mtr.add_suppression('WSREP: pre_commit for SR rollback returned 2, thd: ');
call mtr.add_suppression('WSREP: wsrep_rollback failed to send SR ROLLBACK for ');
|