Debian Codegraph @

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

raw
1 #
2 # Simple test for the various levels of wsrep-sync-wait
3 #
4
5 --source include/galera_cluster.inc
6 --source include/have_innodb.inc
7
8 --echo #
9 --echo # MDEV-10161: wsrep_sync_wait not enabled when set to 1 in config file
10 --echo #
11 # galera_2nodes.cnf sets wsrep_sync_wait to 7
12 SELECT @@global.wsrep_sync_wait;
13
14 --let $wsrep_sync_wait_orig = `SELECT @@wsrep_sync_wait`
15
16 --connection node_1
17 CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
18
19 --connection node_2
20 SET GLOBAL wsrep_sync_wait = 1;
21 # Those statements should see the table
22
23 # MW-86 SHOW commands have now their own bitmask
24 # SHOW TABLES LIKE '%t1';
25
26 SELECT COUNT(*) = 0 FROM t1;
27
28 --connection node_1
29 CREATE TABLE t2 (f1 INT PRIMARY KEY) Engine=InnoDB;
30
31 --connection node_2
32 SET GLOBAL wsrep_sync_wait = 4;
33 # This insert should see the table and succeed
34 INSERT INTO t2 VALUES (1);
35
36 --connection node_1
37 CREATE TABLE t3 (f1 INT PRIMARY KEY) Engine=InnoDB;
38 INSERT INTO t3 VALUES (1);
39
40 --connection node_2
41 SET GLOBAL wsrep_sync_wait = 2;
42 # This statement should see and update 1 row
43 --enable_info
44 UPDATE t3 SET f1 = 2;
45 --disable_info
46
47 --connection node_2
48 --eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig
49
50 DROP TABLE t1;
51 DROP TABLE t2;
52 DROP TABLE t3;