File: gr_without_perfschema.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (92 lines) | stat: -rw-r--r-- 3,717 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
################################################################################
# ==== Purpose ====
#
# This test will setup a group with only two members to ensure that the GR
# works regardless of performance-schema being enabled or not.
#
# It will first generate some workload in a single member. It will then
# make the other member to join the group and recover. Once having the two
# members in the group, the test case will generate workload to be certified.
#
# ==== Related Bugs and Worklogs ====
#
# BUG#23291352 GROUP REPLICATION SEGFAULTS WHEN PERFORMANCE_SCHEMA=OFF
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. On M1, create a table and data to be recovered.
# 2. Bootstrap start a group on M1.
# 3. Start GR on M2 and wait until recovered.
# 4. Check if GR works fine: generate workload to be certified/replicated.
# 5. Clean up: stop group replication on both members.
################################################################################

--source include/not_windows.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc

--echo
--echo ####################################################################
--echo # 1. Create a table on server1 and generate workload to be recovered
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);

--echo
--echo #################################################################
--echo # 2. Start group replication on server1, bootstrapping the group
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
--source include/gr_set_bootstrap_group.inc
START GROUP_REPLICATION;
--source include/gr_clear_bootstrap_group.inc

--echo
--echo #################################################################
--echo # 3. Start group replication on server2 and wait until recovered
--let $rpl_connection_name= server2
--source include/rpl_connection.inc

--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
START GROUP_REPLICATION;

--echo Wait until server2 recovered table t1
--let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.tables WHERE TABLE_SCHEMA="test" AND TABLE_NAME="t1";
--source include/wait_condition.inc

--echo Wait until server2 recovered the single row of table t1
--let $wait_condition= SELECT COUNT(*)=1 FROM t1
--source include/wait_condition.inc

--echo Wait until server2 recovery has finished
--let $wait_condition= SELECT @@GLOBAL.super_read_only = '0'
--source include/wait_condition.inc

--echo
--echo #########################################################################
--echo # 4. Check if GR works fine: generate workload to be certified/replicated
INSERT INTO t1 VALUES (2);

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--echo Wait until server1 has the table with 2 rows
--let $wait_condition= SELECT COUNT(*)=2 FROM t1
--source include/wait_condition.inc

DROP TABLE t1;
--let $rpl_connection_name= server2
--source include/rpl_connection.inc

--echo Wait until server2 has dropped table t1
--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.tables WHERE TABLE_SCHEMA="test" AND TABLE_NAME="t1";
--source include/wait_condition.inc

--echo
--echo #####################################################
--echo # 5. Clean up: stop group replication on both members
STOP GROUP_REPLICATION;
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
STOP GROUP_REPLICATION;
--source include/group_replication_end.inc