Debian Codegraph @

mysql-test/suite/galera_sr/t/galera_sr_ws_size2.test

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