File: gr_server_id_0.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 (98 lines) | stat: -rw-r--r-- 5,158 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
################################################################################
# Validate that even when server is started with server_id=0, on
# which situation slave infrastructure is not initialized, and even
# when server_id is changed dynamically, which does not initialize
# slave infrastructure, START GROUP REPLICATION command errors out
# properly.
#
# Test:
# 0. The test requires one server.
# 1. Restart server with server_id=0, slave infrastructure will not be
#    initialized.
# 2. Start GR on server should fail. INSTALL PLUGIN should fail.
# 3. Even after set server_id to different from 0, start GR must fail.
#    INSTALL PLUGIN should succeed.
# 4. Cleanup.
################################################################################
--source include/force_restart.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc

# Store runtime configuration
--let $_server_id= `SELECT @@GLOBAL.server_id`
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`

# Error log suppressions
SET SESSION sql_log_bin= 0;
call mtr.add_suppression("For the creation of replication channels the server id must be different from 0");
call mtr.add_suppression("Failure during Group Replication handler initialization");
call mtr.add_suppression("Plugin 'group_replication' init function returned error.");
call mtr.add_suppression("Couldn't load plugin named 'group_replication' with soname 'group_replication.*'");
call mtr.add_suppression("Failure when cleaning Group Replication server state");
call mtr.add_suppression("Failure when unregistering the server state observers");
call mtr.add_suppression("Failure when unregistering the transactions state observers");
call mtr.add_suppression("Failure when unregistering the binlog state observers");
call mtr.add_suppression("Group Replication plugin is not installed");
call mtr.add_suppression("For the creation of replication channels the server id must be different from 0");
call mtr.add_suppression("Unable to start Group Replication. Replication applier infrastructure is not initialized since the server was started with server_id=0. Please, restart the server with server_id larger than 0.");
call mtr.add_suppression("Function 'group_replication' already exists");
call mtr.add_suppression("Could not uninstall Group Replication UDF functions. Try to remove them manually if present.");
SET SESSION sql_log_bin= 1;


--echo
--echo ############################################################
--echo # 1. Restart server with server_id=0, slave infrastructure
--echo #    will not be initialized.
--let $allow_rpl_inited= 1
--let $restart_parameters=restart:--group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_group_name=$group_replication_group_name --server_id=0
--replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--source include/restart_mysqld.inc
# Needed as we are not using rpl_restart_server.inc
--let $rpl_server_number= 1
--source include/rpl_reconnect.inc


--echo
--echo ############################################################
--echo # 2. Both start and install plugin must fail.
--error ER_GROUP_REPLICATION_CONFIGURATION
START GROUP_REPLICATION;

--replace_result $GROUP_REPLICATION GROUP_REPLICATION
--error ER_CANT_INITIALIZE_UDF
--eval INSTALL PLUGIN group_replication SONAME '$GROUP_REPLICATION'


--echo
--echo ############################################################
--echo # 3. Even after set server_id to different from 0, start
--echo #    must fail.
--echo #    Install plugin will succeed.
--eval SET GLOBAL server_id= $_server_id
--source include/install_group_replication_plugin.inc

--error ER_GROUP_REPLICATION_CONFIGURATION
START GROUP_REPLICATION;

--error ER_GROUP_REPLICATION_CONFIGURATION
START GROUP_REPLICATION;


--echo
--echo ############################################################
--echo # 4. Cleanup.
--echo #    Restart server with server_id different from 0, so that
--echo #    slave infrastructure will be initialized, and RESET
--echo #    SLAVE operations on group_replication_end.inc do work.
--let $allow_rpl_inited= 1
--let $restart_parameters=restart:--group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_group_name=$group_replication_group_name --server_id=$_server_id
--replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--source include/restart_mysqld.inc
# Needed as we are not using rpl_restart_server.inc
--let $rpl_server_number= 1
--source include/rpl_reconnect.inc

--source include/group_replication_end.inc