1
+ # ==== Purpose ====
2
+ #
3
+ # Check that Group Replication plugin is installed and that test
4
+ # case server configuration fulfills Group Replication requirements.
5
+ #
6
+ # Also it configures:
7
+ # 1) group_replication_group_name, if not configured previously.
8
+ # 2) client connections to all group servers.
9
+ # 3) XCom configuration.
10
+ #
11
+ # ==== Usage ====
12
+ #
13
+ # [--let $group_replication_group_name= UUID]
14
+ # [--let $rpl_skip_group_replication_configuration= 1]
15
+ # --source include/have_group_replication_plugin.inc
16
+ #
17
+ # Parameters:
18
+ #
19
+ # $group_replication_group_name
20
+ # By default, this script generates a random group name to be
21
+ # used on the test that sources it.
22
+ # If this parameter is provided, its value will be used as
23
+ # group name.
24
+ #
25
+ # $skip_group_replication_configuration
26
+ # By default, this script configures XCom on all servers.
27
+ # If this parameter is provided, the XCom configuration setup
28
+ # is skipped.
29
+ #
30
+ # $skip_recovery_configuration
31
+ # By default, this script will configure the servers with a default value
32
+ # for a user_name and password which will be used for distributed
33
+ # recovery. However, if this parameter is provided, the recovery
34
+ # configuration is skipped.
35
+ #
36
+
1
37
--let $include_filename = have_group_replication_plugin . inc
2
38
--let $_previous_include_silent = $include_silent
3
39
--let $include_silent = 1
4
40
--source include /begin_include_file . inc
5
41
6
- # Synchronous replication will work only for RBR mode of replication thus tests
7
- # using it are restricted to this mode only.
8
- --source include /have_log_bin . inc
9
- --source include /have_binlog_format_row . inc
10
-
11
- #
12
- # Check if server has support for loading plugins
13
- #
14
- if (`SELECT @@have_dynamic_loading != 'YES' `) {
15
- --skip Requires dynamic loading
16
- }
17
-
18
- if (!$GROUP_REPLICATION )
19
- {
20
- --skip Need Group Replication plugin
21
- }
22
-
23
- if (!`select count (*) from information_schema . plugins where PLUGIN_NAME like 'group_replication' `)
24
- {
25
- --skip Need Group Replication plugin
26
- }
42
+ # Check server configuration.
43
+ --source include /have_group_replication_plugin_base . inc
27
44
28
45
# Allow $SERVER_MYPORT_1 as alias for $MASTER_MYPORT
29
46
# necessary for the rpl_group_replication_default_connections.inc file.
@@ -41,6 +58,18 @@ if (!$SERVER_MYPORT_2)
41
58
42
59
--source include /rpl_group_replication_default_connections . inc
43
60
61
+ # Generate group name if not defined yet.
62
+ if ($group_replication_group_name == '' )
63
+ {
64
+ --let $group_replication_group_name = `SELECT UUID ()`
65
+ }
66
+
67
+ if (!$rpl_skip_group_replication_configuration )
68
+ {
69
+ # Configure XCom.
70
+ --source include /gr_configuration . inc
71
+ }
72
+
44
73
--let $include_filename = have_group_replication_plugin . inc
45
74
--let $include_silent = $_previous_include_silent
46
75
--source include /end_include_file . inc
0 commit comments