Debian Codegraph @

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

raw
1 ################################################################################
2 # Validate that GR behaves properly when group GNOs are
3 # near exhaustion even with bigger GTID assignment blocks.
4 # Group is started with only 6 available GTIDs and all
5 # will be used.
6 # Test will be run with: 1 and 100 block size.
7 #
8 # MAX_GNO: 9223372036854775807
9 #
10 # Test:
11 # 0. The test requires two servers: M1 and M2.
12 # 1. Set GTID_PURGED=GRP_UUID:1-9223372036854775800. Bootstrap start GR on M1.
13 # Verify GTID_EXECUTED=GRP_UUID:1-9223372036854775801.
14 # 2. Set GTID_PURGED=GRP_UUID:1-9223372036854775800. Start GR on M2. Verify
15 # GTID_EXECUTED=GRP_UUID:1-9223372036854775802.
16 # 3. Create a table on M1. Verify GTID_EXECUTED=GRP_UUID:1-9223372036854775803.
17 # 4. Execute a transaction on M2. M2 GTID block will adapt to available GNOs.
18 # Verify GTID_EXECUTED=GRP_UUID:1-9223372036854775804.
19 # 5. Clean up.
20 ################################################################################
21 --let $group_replication_group_name= 297aeabb-1ef1-11e6-97b4-00212844d44e
22 --source include/have_group_replication_plugin.inc
23 --let $rpl_skip_group_replication_start= 1
24 --source include/group_replication.inc
25
26 # Supress log errors since they are expected.
27 --let $rpl_connection_name= server1
28 --source include/rpl_connection.inc
29 SET SESSION sql_log_bin = 0;
30 call mtr.add_suppression("The integer component of the GTID number is high.");
31 SET SESSION sql_log_bin = 1;
32 --let $rpl_connection_name= server2
33 --source include/rpl_connection.inc
34 SET SESSION sql_log_bin = 0;
35 call mtr.add_suppression("The integer component of the GTID number is high.");
36 SET SESSION sql_log_bin = 1;
37
38 --echo
39 --echo ############################################################
40 --echo # 1. Start server 1.
41 --let $rpl_connection_name= server1
42 --source include/rpl_connection.inc
43 --eval SET GLOBAL GTID_PURGED= "$group_replication_group_name:1-9223372036854775800"
44 --let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775800
45 --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775800"
46 --source include/assert.inc
47
48 --source include/start_and_bootstrap_group_replication.inc
49 --let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775801
50 --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775801"
51 --source include/assert.inc
52
53
54 --echo
55 --echo ############################################################
56 --echo # 2. Start server 2.
57 --let $rpl_connection_name= server2
58 --source include/rpl_connection.inc
59 --eval SET GLOBAL GTID_PURGED= "$group_replication_group_name:1-9223372036854775800"
60 --let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775800
61 --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775800"
62 --source include/assert.inc
63
64 --source include/start_group_replication.inc
65 --let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775802
66 --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775802"
67 --source include/assert.inc
68
69
70 --echo
71 --echo ############################################################
72 --echo # 3. Create a table on server 1.
73 --let $rpl_connection_name= server1
74 --source include/rpl_connection.inc
75 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
76 --let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775803
77 --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775803"
78 --source include/assert.inc
79 --source include/rpl_sync.inc
80
81
82 --echo
83 --echo ############################################################
84 --echo # 4. Execute a transaction on server 2.
85 --echo # Server 2 GTID block will adapt to available GNOs.
86 --let $rpl_connection_name= server2
87 --source include/rpl_connection.inc
88 INSERT INTO t1 VALUES (1);
89 --let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775804
90 --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775804"
91 --source include/assert.inc
92
93
94 --echo
95 --echo ############################################################
96 --echo # 5. Clean up.
97 DROP TABLE t1;
98 --source include/group_replication_end.inc