File: gr_start_stop_behaviour.result

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 (169 lines) | stat: -rw-r--r-- 7,096 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
include/group_replication.inc
Warnings:
Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
Note	####	Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
[connection server1]
[connection server1]
SET SESSION sql_log_bin= 0;
include/gtid_utils.inc
SET SESSION sql_log_bin= 1;
[connection server2]
SET SESSION sql_log_bin= 0;
include/gtid_utils.inc
SET SESSION sql_log_bin= 1;

############################################################
# 1. Create a table on the group.
############################################################
[connection server1]
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
include/rpl_sync.inc

############################################################
# 2. Try to stop Group Replication in the middle of a ongoing
#    transaction. It should throw error
#    ER_LOCK_OR_ACTIVE_TRANSACTION
############################################################
BEGIN;
INSERT INTO t1 VALUES (2);
STOP GROUP_REPLICATION;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
include/assert.inc [GTID_EXECUTED must contain 3 group transactions]
[connection server_1]
include/assert.inc [There is no value 2 in table t1]
[connection server1]
COMMIT;
include/rpl_sync.inc
include/assert.inc [There is a value 2 in table t1 on server1]
include/assert.inc [GTID_EXECUTED must contain 4 group transactions]
[connection server2]
include/assert.inc [There is a value 2 in table t1 on server2]
include/assert.inc [GTID_EXECUTED must contain 4 group transactions]

############################################################
# 3. Stop Group Replication while GTID_NEXT is specified
#    and check an error is thrown to prove that
#    STOP GROUP_REPLICATION does not create any
#    implicit commits.
############################################################
[connection server1]
SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-bbbbbbbbbbbb:1';
STOP GROUP_REPLICATION;
ERROR HY000: Can't execute the given command when @@SESSION.GTID_NEXT == 'UUID:NUMBER'.
[connection server_1]
include/assert.inc [GTID_EXECUTED must contain 4 group transactions]
include/assert.inc [GTID_OWNED is still set since aaaaaaaa-aaaa-aaaa-aaaa-bbbbbbbbbbbb:1 transaction was not committed]
include/stop_group_replication.inc
[connection server1]
COMMIT;
SET GTID_NEXT= AUTOMATIC;
include/assert.inc [GTID_OWNED is empty after committing aaaaaaaa-aaaa-aaaa-aaaa-bbbbbbbbbbbb:1]
include/assert.inc [GTID_EXECUTED must contain 4 group transactions and 1 local transaction]

############################################################
# 4. Try to Start Group Replication in the middle of a ongoing
#    transaction. It should throw error
#    ER_LOCK_OR_ACTIVE_TRANSACTION
############################################################
[connection server1]
BEGIN;
INSERT INTO t1 VALUES (4);
START GROUP_REPLICATION;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
include/assert.inc [GTID_EXECUTED must still contain 4 group transactions and 1 local transaction]
[connection server_2]
include/assert.inc [There is no value 4 in table t1]
[connection server1]
COMMIT;
include/assert.inc [There is a value 4 in table t1 on server1]
include/assert.inc [GTID_EXECUTED must contain 4 group transactions and 2 local transaction]
DROP TABLE t1;
RESET MASTER;

##################################################################
# 5. Try to start Group Replication while there are ongoing
#    transaction in parallel that does not have any GR compatible
#    DMLs (no write set that goes to certification). It should be
#    commit hook error.
##################################################################
SET SESSION sql_log_bin= 0;
CALL mtr.add_suppression("Failed to extract the set of items written");
CALL mtr.add_suppression("Run function 'before_commit' in plugin 'group_replication' failed");
CREATE TABLE t_without_primary_key(i INT);
SET SESSION sql_log_bin= 1;
BEGIN;
INSERT INTO t_without_primary_key VALUES (1);
[connection server_1]
include/start_group_replication.inc
[connection server1]
COMMIT;
ERROR HY000: Error on observer while running replication hook 'before_commit'.
SET SESSION sql_log_bin= 0;
DROP TABLE t_without_primary_key;
SET SESSION sql_log_bin= 1;

############################################################
# 6. Start Group Replication while GTID_NEXT is specified.
#    It shall fail leaving GTID_NEXT untouched
############################################################
include/stop_group_replication.inc
DROP TABLE t1;
RESET MASTER;
[connection server1]
SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-bbbbbbbbbbbb:1';
START GROUP_REPLICATION;
ERROR HY000: Can't execute the given command when @@SESSION.GTID_NEXT == 'UUID:NUMBER'.
[connection server_1]
include/assert.inc [GTID_EXECUTED is empty]
include/assert.inc [GTID_OWNED is still set since the ongoing transaction was not committed]
[connection server1]
COMMIT;
SET GTID_NEXT= AUTOMATIC;
include/assert.inc [GTID_OWNED is empty after committing aaaaaaaa-aaaa-aaaa-aaaa-bbbbbbbbbbbb:1]
include/assert.inc [GTID_EXECUTED must contain only the local transaction]
RESET MASTER;
include/start_group_replication.inc
include/assert.inc [GTID_EXECUTED must contain 6 group transactions]

#################################################################
# 7. Verify that if a session is in lock_table_mode (exclusively
#    acquired a lock on a table), stop group replication command
#    is not allowed from the session.
#################################################################
[connection server2]
LOCK table t1 WRITE;
[connection server1]
INSERT INTO t1 values (6);
[connection server2]
STOP GROUP_REPLICATION;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
UNLOCK tables;

#################################################################
# 8. Verify that if a session is in lock_table_mode (exclusively
#    acquired a lock on a table), start group replication command
#    is not allowed from the session.
#################################################################
[connection server2]
include/stop_group_replication.inc
[connection server2]
LOCK table t1 WRITE;
START GROUP_REPLICATION;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
UNLOCK tables;
include/start_group_replication.inc

############################################################
# 9. Clean up
############################################################
[connection server1]
DROP TABLE t1;
[connection server1]
SET SESSION sql_log_bin= 0;
include/gtid_utils_end.inc
SET SESSION sql_log_bin= 1;
[connection server2]
SET SESSION sql_log_bin= 0;
include/gtid_utils_end.inc
SET SESSION sql_log_bin= 1;
include/group_replication_end.inc