Debian Codegraph @

mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test

raw
1 #
2 # Test that if the gcache rolls over while IST is in progress, IST will still complete.
3 # This is achieved by using the ist_sender_send_after_get_buffers Galera dbug sync point to block the donor after
4 # the first gcache buffer has been locked for IST.
5 #
6 # After IST blocks, we roll over the gcache and resume IST to confirm that it completes successfully.
7 #
8 # Two nodes perform IST at the same time in order to make the test more stressfull
9 #
10
11 --source include/galera_cluster.inc
12 --source include/have_innodb.inc
13 --source include/have_debug_sync.inc
14 --source include/galera_have_debug_sync.inc
15 --source include/force_restart.inc
16
17 --let $galera_connection_name = node_3
18 --let $galera_server_number = 3
19 --source include/galera_connect.inc
20
21 # Save original auto_increment_offset values.
22 --let $node_1=node_1
23 --let $node_2=node_2
24 --let $node_3=node_3
25 --source ../galera/include/auto_increment_offset_save.inc
26
27 --connection node_1
28 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
29 --let $wait_condition_on_error_output = SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep%'; show processlist
30 --source include/wait_condition_with_debug.inc
31 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
32 INSERT INTO t1 VALUES (01), (02), (03), (04), (05);
33
34 # Disconnect nodes #2 and #3
35 --connection node_2
36 --let $wsrep_cluster_address_orig2 = `select @@wsrep_cluster_address`
37 --source suite/galera/include/galera_stop_replication.inc
38
39 --connection node_1
40 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
41 --source include/wait_condition.inc
42
43 --connection node_3
44 --let $wsrep_cluster_address_orig3 = `select @@wsrep_cluster_address`
45 --source suite/galera/include/galera_stop_replication.inc
46
47 --connection node_1
48 INSERT INTO t1 VALUES (11), (12), (13), (14), (15);
49
50 # Wait until nodes #2 and #3 have left
51 --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
52 --source include/wait_condition.inc
53
54 INSERT INTO t1 VALUES (21), (22), (23), (24), (25);
55
56 # Make sure IST will block ...
57 --let $galera_sync_point = ist_sender_send_after_get_buffers
58 --source include/galera_set_sync_point.inc
59
60 # ... and restart providers to force IST
61 --connection node_2
62 --disable_query_log
63 SET GLOBAL wsrep_cluster_address='';
64 --eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig2';
65 --enable_query_log
66
67 --connection node_1
68 INSERT INTO t1 VALUES (31), (32), (33), (34), (35);
69
70 --connection node_3
71 --disable_query_log
72 SET GLOBAL wsrep_cluster_address='';
73 --eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig3';
74 --enable_query_log
75
76 --connection node_1
77 --sleep 2
78 SHOW STATUS LIKE 'wsrep_debug_sync_waiters';
79
80 INSERT INTO t1 VALUES (41), (42), (43), (44), (45);
81
82 # Roll over gcache by writing a lot of information to it
83
84 CREATE TABLE t2 (f1 LONGTEXT);
85 INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
86 INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
87 INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
88
89 # Unlock IST and wait for it to complete
90 --source include/galera_clear_sync_point.inc
91 --source include/galera_signal_sync_point.inc
92
93 INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
94
95 --connection node_2
96 --source include/wait_until_connected_again.inc
97
98 --connection node_1
99 --let $wait_condition = SELECT VARIABLE_VALUE = 2 OR VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
100 --source include/wait_condition.inc
101
102 --connection node_3
103 --source include/wait_until_connected_again.inc
104
105 --connection node_1
106 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
107 --source include/wait_condition.inc
108
109 # Final checks
110 --connection node_2
111 --let $wait_condition = SELECT COUNT(*) = 30 FROM t1
112 --source include/wait_condition.inc
113
114 SELECT COUNT(*) AS EXPECT_30 FROM t1;
115 SELECT COUNT(*) AS EXPECT_3 FROM t2;
116 SELECT LENGTH(f1) = 512 * 1024 FROM t2;
117 CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled");
118
119 # Final checks
120 --connection node_3
121 --let $wait_condition = SELECT COUNT(*) = 30 FROM t1
122 --source include/wait_condition.inc
123 SELECT COUNT(*) AS EXPECT_30 FROM t1;
124 SELECT COUNT(*) AS EXPECT_3 FROM t2;
125 SELECT LENGTH(f1) = 512 * 1024 FROM t2;
126 CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled");
127
128 DROP TABLE t1, t2;
129
130 # Restore original auto_increment_offset values.
131 --let $galera_cluster_size=3
132 --source ../galera/include/auto_increment_offset_restore.inc
133 --source include/galera_end.inc