Debian Codegraph @

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

raw
1 ###############################################################################
2 # Validate that member actions are triggered on group bootstrap.
3 #
4 # Test:
5 # 0. This test requires one server.
6 # 1. Disable the action `mysql_disable_super_read_only_if_primary`,
7 # validate that after bootstrap a group in single-primary
8 # mode, the primary is read-only.
9 # 2. Cleanup
10 ###############################################################################
11 --source include/have_group_replication_plugin.inc
12 --let $rpl_skip_group_replication_start= 1
13 --let $rpl_group_replication_single_primary_mode=1
14 --source include/group_replication.inc
15
16
17 --echo
18 --echo ############################################################
19 --echo # 1. Disable the action `mysql_disable_super_read_only_if_primary`,
20 --echo # validate that after bootstrap a group in single-primary
21 --echo # mode, the primary is read-only.
22 --let $rpl_connection_name= server1
23 --source include/rpl_connection.inc
24
25 SELECT group_replication_disable_member_action("mysql_disable_super_read_only_if_primary", "AFTER_PRIMARY_ELECTION");
26
27 --let $assert_text= The action mysql_disable_super_read_only_if_primary must be disabled
28 --let $assert_cond= [SELECT enabled FROM performance_schema.replication_group_member_actions WHERE name=\'mysql_disable_super_read_only_if_primary\' AND event=\'AFTER_PRIMARY_ELECTION\', enabled, 1] = 0
29 --source include/assert.inc
30
31 --let $assert_text= The version of replication_group_member_actions must be 2
32 --let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_group_member_actions\', version, 1] = 2
33 --source include/assert.inc
34
35 --let $skip_wait_for_disabled_read_only= 1
36 --source include/start_and_bootstrap_group_replication.inc
37
38 --let $assert_text= The super_read_only mode must be 1
39 --let $assert_cond= "[SELECT @@GLOBAL.super_read_only]" = 1;
40 --source include/assert.inc
41
42 --let $assert_text= The read_only mode must be 1
43 --let $assert_cond= "[SELECT @@GLOBAL.read_only]" = 1;
44 --source include/assert.inc
45
46 --let $assert_only_after = CURRENT_TEST: group_replication.gr_spm_skip_disable_super_read_bootstrap
47 --let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
48 --let $assert_select= The member action "mysql_disable_super_read_only_if_primary" for event "AFTER_PRIMARY_ELECTION" with priority "1" will be run.
49 --let $assert_count= 0
50 --let $assert_text= Member action "mysql_disable_super_read_only_if_primary" for event "AFTER_PRIMARY_ELECTION" was not triggered
51 --source include/assert_grep.inc
52
53
54 --echo
55 --echo ############################################################
56 --echo # 2. Clean up.
57 --let $rpl_connection_name= server1
58 --source include/rpl_connection.inc
59
60 --source include/group_replication_end.inc