Debian Codegraph @

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

raw
1 --source include/galera_cluster.inc
2 --source include/have_innodb.inc
3
4 #
5 # Test that SR transaction is cumulatively allowed to grow beyond repl.max_ws_size
6 # if individual fragements are below that size
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 = 512;
18 SET GLOBAL wsrep_provider_options='repl.max_ws_size=4096';
19
20 #
21 # Create a transaction larger than repl.max_ws_size
22 #
23
24 SET AUTOCOMMIT=OFF;
25 START TRANSACTION;
26 INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1;
27 INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1;
28 INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1;
29 INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1;
30 INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1;
31
32 INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1;
33 INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1;
34 INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1;
35 INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1;
36 INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1;
37
38 #
39 # We expect that the transaction can proceed successfully
40 #
41
42 --connection node_2
43 SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
44 --let $wait_condition = SELECT COUNT(*) > 10 FROM t1;
45 --source include/wait_condition.inc
46
47 --connection node_1
48 # Commit succeeds
49 COMMIT;
50
51 --connection node_2
52 SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
53 SELECT COUNT(*) = 100 FROM t1;
54
55 #
56 # Cleanup
57 #
58
59 DROP TABLE t1;
60 DROP TABLE ten;
61
62 --connection node_1
63 --disable_query_log
64 --eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
65 --enable_query_log
66
67 call mtr.add_suppression('WSREP: transaction size limit');
68 call mtr.add_suppression('WSREP: rbr write fail');
69 call mtr.add_suppression('WSREP: Maximum writeset size exceeded by ');
70 call mtr.add_suppression('WSREP: transaction size exceeded');