Debian Codegraph @

mysql-test/suite/group_replication/t/gr_single_primary_ro.test

raw
1 ################################################################################
2 # WL#9426: Single Primary Mode in Group Replication
3 #
4 # Validate that the leader will switch the RO mode off when
5 # becoming a primary.
6 #
7 # This is a simple test that sets super read only before we
8 # start the group and thus before the server becomes PRIMARY.
9 # Once it becomes primary, it will automatically switch
10 # super read only off.
11 ################################################################################
12
13 --source include/have_group_replication_plugin.inc
14
15 --let $rpl_skip_group_replication_start= 1
16 --let $rpl_group_replication_single_primary_mode=1
17 --source include/group_replication.inc
18
19 --let $rpl_connection_name= server1
20 --source include/rpl_connection.inc
21
22 --let $saved_super_read_only= `SELECT @@GLOBAL.super_read_only`
23 --let $saved_read_only= `SELECT @@GLOBAL.read_only`
24 --let $primary_server_uuid= `SELECT @@server_uuid`
25
26 # set RO to true
27 SET GLOBAL super_read_only= TRUE;
28
29 --let $assert_cond= "[SELECT @@GLOBAL.super_read_only]" = 1
30 --let $assert_text= Assert that server is running in super RO.
31 --source include/assert.inc
32
33 # lets start the group
34 --source include/start_and_bootstrap_group_replication.inc
35
36 # wait to be primary
37 --let $group_replication_expected_uuid=$primary_server_uuid
38 --source include/gr_wait_primary_member_uuid.inc
39
40 # assert that the primary will switch to RW mode.
41 --let $assert_cond= "[SELECT @@GLOBAL.super_read_only]" = 0
42 --let $assert_text= Assert that PRIMARY switches out of super RO.
43 --source include/assert.inc
44
45 --source include/stop_group_replication.inc
46
47 --replace_result $saved_super_read_only SAVED_SUPER_READ_ONLY
48 --eval SET GLOBAL super_read_only= $saved_super_read_only
49 --replace_result $saved_read_only SAVED_READ_ONLY
50 --eval SET GLOBAL read_only= $saved_read_only
51
52 --source include/group_replication_end.inc