Debian Codegraph @

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

raw
1 ###############################################################################
2 #
3 # When changing to multi primary mode the auto increment values
4 # of the server shall change to the plugin automatic values according
5 # to the group_replication_auto_increment_increment variable if no
6 # user set value is present.
7 #
8 # auto_increment_increment should be 1 on single primary and 7 on multi primary
9 # auto_increment_offset should be equal to server id, for example on server1 is 1
10 #
11 # Test:
12 # 0. This test requires one server
13 # 1. Confirm value of auto_increment_increment is 1 and
14 # auto_increment_offset is 1 with server stopped
15 # 2. Start server and bootstrap group
16 # 3. On Single Primary the default value of auto_increment_increment is
17 # 1 and auto_increment_offset is 1
18 # 4. Change to multi primary mode and confirm value of
19 # auto_increment_increment is 7 and auto_increment_offset is 1
20 # 5. Stop server and confirm value of auto_increment_increment is 1 and
21 # auto_increment_offset is 1
22 # 6. Clean up
23 #
24 ###############################################################################
25
26 --source include/have_group_replication_plugin.inc
27 --let $rpl_skip_group_replication_start= 1
28 --let $rpl_group_replication_single_primary_mode=1
29 --source include/group_replication.inc
30
31 --echo
32 --echo # 1. Confirm value of auto_increment_increment is 1 and
33 --echo # auto_increment_offset is 1 with server stopped
34
35 --let $assert_text= The default value of auto_increment_increment for single primary should be 1
36 --let $assert_cond= [SELECT @@GLOBAL.auto_increment_increment] = 1
37 --source include/assert.inc
38
39 --let $assert_text= The default value of auto_increment_offset for single primary should be 1
40 --let $assert_cond= [SELECT @@GLOBAL.auto_increment_offset] = 1
41 --source include/assert.inc
42
43 --echo
44 --echo # 2. Start server and bootstrap group
45
46 --source include/start_and_bootstrap_group_replication.inc
47
48 --echo
49 --echo # 3. On Single Primary the default value of auto_increment_increment is
50 --echo # 1 and auto_increment_offset is 1
51
52 --let $assert_text= The default value of auto_increment_increment for single primary should be 1
53 --let $assert_cond= [SELECT @@GLOBAL.auto_increment_increment] = 1
54 --source include/assert.inc
55
56 --let $assert_text= The default value of auto_increment_offset for single primary should be 1
57 --let $assert_cond= [SELECT @@GLOBAL.auto_increment_offset] = 1
58 --source include/assert.inc
59
60 --echo
61 --echo # 4. Change to multi primary mode and confirm value of
62 --echo # auto_increment_increment is 7 and auto_increment_offset is 1
63
64 SELECT group_replication_switch_to_multi_primary_mode();
65
66 --let $assert_text= The default value of auto_increment_increment for single primary should be 7
67 --let $assert_cond= [SELECT @@GLOBAL.auto_increment_increment] = 7
68 --source include/assert.inc
69
70 --let $assert_text= The default value of auto_increment_offset for single primary should be 1
71 --let $assert_cond= [SELECT @@GLOBAL.auto_increment_offset] = 1
72 --source include/assert.inc
73
74 --echo
75 --echo # 5. Stop server and confirm value of auto_increment_increment is 1 and
76 --echo # auto_increment_offset is 1
77
78 --source include/stop_group_replication.inc
79
80 --let $assert_text= The default value of auto_increment_increment for single primary should be 1
81 --let $assert_cond= [SELECT @@GLOBAL.auto_increment_increment] = 1
82 --source include/assert.inc
83
84 --let $assert_text= The default value of auto_increment_offset for single primary should be 1
85 --let $assert_cond= [SELECT @@GLOBAL.auto_increment_offset] = 1
86 --source include/assert.inc
87
88 --echo
89 --echo # 6. Clean up
90
91 --let $rpl_group_replication_reset_persistent_vars=1
92 --source include/group_replication_end.inc