Debian Codegraph @

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

raw
1 ################################################################################
2 # This test evaluates the variable associated to recovery completion modes
3 # It checks the default value, updates it with valid values and checks them.
4 # It also checks that invalid values throw an error.
5 #
6 # Test:
7 # 0. The test requires one server.
8 # 1. Check the default value. It should be transactions_applied.
9 # 2. Change to a valid values. Change to a valid alias. Expect success.
10 # 3. Test an invalid values. Expect error.
11 # 4. Clean up.
12 ################################################################################
13
14 --source include/have_group_replication_plugin.inc
15 --let $rpl_skip_group_replication_start= 1
16 --source include/group_replication.inc
17
18 --echo #
19 --echo # Check the default value
20 --echo #
21
22 --connection server1
23 --echo server1
24
25 --source include/start_and_bootstrap_group_replication.inc
26
27 SET @configured_rec_policy= @@GLOBAL.group_replication_recovery_complete_at;
28
29 --let $assert_text= The default of the recovery complete mode should be "transactions_applied"
30 --let $assert_cond= "[SELECT @@group_replication_recovery_complete_at]" = "transactions_applied"
31 --source include/assert.inc
32
33
34 --echo #
35 --echo # Change to a valid value.
36 --echo #
37
38 SET GLOBAL group_replication_recovery_complete_at= "transactions_certified";
39
40 --let $assert_text= The recovery complete mode should now be "transactions_certified"
41 --let $assert_cond= "[SELECT @@group_replication_recovery_complete_at]" = "transactions_certified"
42 --source include/assert.inc
43
44 SET GLOBAL group_replication_recovery_complete_at= @configured_rec_policy;
45
46 --echo #
47 --echo # Change to a valid alias.
48 --echo #
49
50 SET GLOBAL group_replication_recovery_complete_at= 0;
51
52 --let $assert_text= The default of the recovery complete mode should be "transactions_certified"
53 --let $assert_cond= "[SELECT @@group_replication_recovery_complete_at]" = "transactions_certified"
54 --source include/assert.inc
55
56 SET GLOBAL group_replication_recovery_complete_at= 1;
57
58 --let $assert_text= The recovery complete mode should now be "transactions_applied"
59 --let $assert_cond= "[SELECT @@group_replication_recovery_complete_at]" = "transactions_applied"
60 --source include/assert.inc
61
62 --echo #
63 --echo # Test an invalid values.
64 --echo #
65
66 --error ER_WRONG_VALUE_FOR_VAR
67 SET GLOBAL group_replication_recovery_complete_at= "invalid_value";
68
69 --error ER_WRONG_VALUE_FOR_VAR
70 SET GLOBAL group_replication_recovery_complete_at= 20;
71
72 --echo #
73 --echo # Clean up
74 --echo #
75
76 SET GLOBAL group_replication_recovery_complete_at= @configured_rec_policy;
77
78 --source include/group_replication_end.inc