Skip to content

Commit 473e85e

Browse files
author
Jan Lindström
committed
MDEV-25591 : Test case cleanups
galera_var_wsrep_on_off : Add wait conditions to make sure DDL is replicated before continuing. wsrep.[variables|variables_debug] : Remove unnecessary parts and add check to correct number of variables or skip galera_ssl_reload: Add version check and SSL checks.
1 parent 0cc811c commit 473e85e

10 files changed

+55
-308
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--disable_query_log
2+
3+
--let $galera_variables_ok = `SELECT COUNT(*) = 49 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
4+
5+
--if (!$galera_variables_ok) {
6+
--skip Galera number of variables has changed!
7+
}
8+
9+
--enable_query_log
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--disable_query_log
2+
3+
--let $galera_variables_ok = `SELECT COUNT(*) = 50 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
4+
5+
--if (!$galera_variables_ok) {
6+
--skip Galera number of variables has changed!
7+
}
8+
9+
--enable_query_log

mysql-test/suite/galera/r/galera_var_wsrep_on_off.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ COUNT(*) = 1
2323
1
2424
DROP TABLE t1;
2525
connection node_1;
26+
connection node_1;
2627
START TRANSACTION;
2728
SET SESSION wsrep_on=OFF;
2829
ERROR 25000: You are not allowed to execute this command in a transaction
@@ -54,6 +55,7 @@ f1
5455
connection node_1a;
5556
SET GLOBAL wsrep_on = ON;
5657
DROP TABLE t1;
58+
connection node_2;
5759
connection node_1;
5860
SET GLOBAL wsrep_on = OFF;
5961
connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;;
@@ -71,6 +73,7 @@ SHOW SESSION VARIABLES LIKE 'wsrep_on';
7173
Variable_name Value
7274
wsrep_on ON
7375
disconnect node_1b;
76+
connection node_2;
7477
connection node_1;
7578
SET GLOBAL wsrep_on = OFF;
7679
SET SESSION wsrep_on = ON;
@@ -101,6 +104,7 @@ f1
101104
1
102105
DROP TABLE t1;
103106
connection node_1;
107+
connection node_1;
104108
SET SESSION wsrep_on = OFF;
105109
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
106110
INSERT INTO t1 VALUES (1);
@@ -125,3 +129,4 @@ Tables_in_test
125129
connection node_1;
126130
DROP TABLE t1;
127131
SET GLOBAL wsrep_on = ON;
132+
connection node_2;

mysql-test/suite/galera/t/galera_var_wsrep_on_off.test

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3;
3030

3131
DROP TABLE t1;
3232

33+
--connection node_1
34+
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
35+
--source include/wait_condition.inc
3336

3437
#
3538
# Test that variable wsrep_on cannot be changed while in
@@ -73,6 +76,10 @@ SELECT * FROM t1;
7376
SET GLOBAL wsrep_on = ON;
7477
DROP TABLE t1;
7578

79+
--connection node_2
80+
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
81+
--source include/wait_condition.inc
82+
7683

7784
#
7885
# New connections inherit @@session.wsrep_on from @@global.wsrep_on
@@ -93,6 +100,10 @@ SHOW SESSION VARIABLES LIKE 'wsrep_on';
93100

94101
--disconnect node_1b
95102

103+
--connection node_2
104+
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
105+
--source include/wait_condition.inc
106+
96107

97108
#
98109
# Can't set @@session.wsrep_on = ON, while @@global.wsrep_on = OFF
@@ -131,6 +142,9 @@ SELECT * FROM t1;
131142

132143
DROP TABLE t1;
133144

145+
--connection node_1
146+
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
147+
--source include/wait_condition.inc
134148

135149
#
136150
# Test single statement, multi statement, and
@@ -165,3 +179,7 @@ SHOW TABLES;
165179
--connection node_1
166180
DROP TABLE t1;
167181
SET GLOBAL wsrep_on = ON;
182+
183+
--connection node_2
184+
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
185+
--source include/wait_condition.inc

mysql-test/suite/galera_3nodes/r/galera_ssl_reload.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
connection node_2;
22
connection node_1;
3+
# Correct Galera library found
34
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
45
connection node_1;
56
connection node_2;

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
#
44

55
--source include/galera_cluster.inc
6-
--source include/have_innodb.inc
6+
--source include/have_openssl.inc
7+
--source include/have_ssl_communication.inc
8+
9+
--let $galera_version=26.4.8
10+
source ../../wsrep/include/check_galera_version.inc;
711

812
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
913

Lines changed: 0 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
# Correct Galera library found
2-
#
3-
# MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of
4-
# variables when using "_"
5-
#
6-
CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*");
72
SHOW GLOBAL STATUS LIKE 'wsrep%';
83
Variable_name Value
94
wsrep_local_state_uuid #
@@ -74,80 +69,6 @@ wsrep_provider_version #
7469
wsrep_ready #
7570
wsrep_rollbacker_thread_count #
7671
wsrep_thread_count #
77-
78-
SHOW GLOBAL STATUS LIKE 'wsrep_%';
79-
Variable_name Value
80-
wsrep_local_state_uuid #
81-
wsrep_protocol_version #
82-
wsrep_last_committed #
83-
wsrep_replicated #
84-
wsrep_replicated_bytes #
85-
wsrep_repl_keys #
86-
wsrep_repl_keys_bytes #
87-
wsrep_repl_data_bytes #
88-
wsrep_repl_other_bytes #
89-
wsrep_received #
90-
wsrep_received_bytes #
91-
wsrep_local_commits #
92-
wsrep_local_cert_failures #
93-
wsrep_local_replays #
94-
wsrep_local_send_queue #
95-
wsrep_local_send_queue_max #
96-
wsrep_local_send_queue_min #
97-
wsrep_local_send_queue_avg #
98-
wsrep_local_recv_queue #
99-
wsrep_local_recv_queue_max #
100-
wsrep_local_recv_queue_min #
101-
wsrep_local_recv_queue_avg #
102-
wsrep_local_cached_downto #
103-
wsrep_flow_control_paused_ns #
104-
wsrep_flow_control_paused #
105-
wsrep_flow_control_sent #
106-
wsrep_flow_control_recv #
107-
wsrep_flow_control_active #
108-
wsrep_flow_control_requested #
109-
wsrep_cert_deps_distance #
110-
wsrep_apply_oooe #
111-
wsrep_apply_oool #
112-
wsrep_apply_window #
113-
wsrep_commit_oooe #
114-
wsrep_commit_oool #
115-
wsrep_commit_window #
116-
wsrep_local_state #
117-
wsrep_local_state_comment #
118-
wsrep_cert_index_size #
119-
wsrep_causal_reads #
120-
wsrep_cert_interval #
121-
wsrep_open_transactions #
122-
wsrep_open_connections #
123-
wsrep_incoming_addresses #
124-
wsrep_cluster_weight #
125-
wsrep_desync_count #
126-
wsrep_evs_delayed #
127-
wsrep_evs_evict_list #
128-
wsrep_evs_repl_latency #
129-
wsrep_evs_state #
130-
wsrep_gcomm_uuid #
131-
wsrep_gmcast_segment #
132-
wsrep_applier_thread_count #
133-
wsrep_cluster_capabilities #
134-
wsrep_cluster_conf_id #
135-
wsrep_cluster_size #
136-
wsrep_cluster_state_uuid #
137-
wsrep_cluster_status #
138-
wsrep_connected #
139-
wsrep_local_bf_aborts #
140-
wsrep_local_index #
141-
wsrep_provider_capabilities #
142-
wsrep_provider_name #
143-
wsrep_provider_vendor #
144-
wsrep_provider_version #
145-
wsrep_ready #
146-
wsrep_rollbacker_thread_count #
147-
wsrep_thread_count #
148-
SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';
149-
Variable_name Value
150-
wsrep_local_state_comment #
15172
# Should show nothing.
15273
SHOW STATUS LIKE 'x';
15374
Variable_name Value
@@ -164,12 +85,6 @@ SHOW STATUS LIKE 'wsrep_thread_count';
16485
Variable_name Value
16586
wsrep_thread_count 2
16687
# variables
167-
SELECT COUNT(*) AS EXPECT_49 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%";
168-
EXPECT_49
169-
49
170-
SELECT COUNT(*) AS EXPECT_49 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%";
171-
EXPECT_49
172-
49
17388
SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME;
17489
VARIABLE_NAME
17590
WSREP_AUTO_INCREMENT_CONTROL
@@ -221,54 +136,3 @@ WSREP_START_POSITION
221136
WSREP_SYNC_WAIT
222137
WSREP_TRX_FRAGMENT_SIZE
223138
WSREP_TRX_FRAGMENT_UNIT
224-
SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME;
225-
VARIABLE_NAME
226-
WSREP_AUTO_INCREMENT_CONTROL
227-
WSREP_CAUSAL_READS
228-
WSREP_CERTIFICATION_RULES
229-
WSREP_CERTIFY_NONPK
230-
WSREP_CLUSTER_ADDRESS
231-
WSREP_CLUSTER_NAME
232-
WSREP_CONVERT_LOCK_TO_TRX
233-
WSREP_DATA_HOME_DIR
234-
WSREP_DBUG_OPTION
235-
WSREP_DEBUG
236-
WSREP_DESYNC
237-
WSREP_DIRTY_READS
238-
WSREP_DRUPAL_282555_WORKAROUND
239-
WSREP_FORCED_BINLOG_FORMAT
240-
WSREP_GTID_DOMAIN_ID
241-
WSREP_GTID_MODE
242-
WSREP_IGNORE_APPLY_ERRORS
243-
WSREP_LOAD_DATA_SPLITTING
244-
WSREP_LOG_CONFLICTS
245-
WSREP_MAX_WS_ROWS
246-
WSREP_MAX_WS_SIZE
247-
WSREP_MYSQL_REPLICATION_BUNDLE
248-
WSREP_NODE_ADDRESS
249-
WSREP_NODE_INCOMING_ADDRESS
250-
WSREP_NODE_NAME
251-
WSREP_NOTIFY_CMD
252-
WSREP_ON
253-
WSREP_OSU_METHOD
254-
WSREP_PATCH_VERSION
255-
WSREP_PROVIDER
256-
WSREP_PROVIDER_OPTIONS
257-
WSREP_RECOVER
258-
WSREP_REJECT_QUERIES
259-
WSREP_REPLICATE_MYISAM
260-
WSREP_RESTART_SLAVE
261-
WSREP_RETRY_AUTOCOMMIT
262-
WSREP_SLAVE_FK_CHECKS
263-
WSREP_SLAVE_THREADS
264-
WSREP_SLAVE_UK_CHECKS
265-
WSREP_SR_STORE
266-
WSREP_SST_AUTH
267-
WSREP_SST_DONOR
268-
WSREP_SST_DONOR_REJECTS_QUERIES
269-
WSREP_SST_METHOD
270-
WSREP_SST_RECEIVE_ADDRESS
271-
WSREP_START_POSITION
272-
WSREP_SYNC_WAIT
273-
WSREP_TRX_FRAGMENT_SIZE
274-
WSREP_TRX_FRAGMENT_UNIT

0 commit comments

Comments
 (0)