Debian Codegraph @

mysql-test/suite/group_replication/r/gr_recovery_completion_mode.result

raw
1 include/group_replication.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection server1]
6 ######################################################################
7 # Phase 1:
8 # Recovery only waits for the certification of all cached transactions
9 ######################################################################
10 #
11 # Create t1 and t2 on both servers
12 # Start group replication on server 1 after inserting data on t1
13 #
14 server1
15 SET SESSION sql_log_bin=0;
16 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
17 CREATE TABLE t2 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
18 SET SESSION sql_log_bin=1;
19 include/start_and_bootstrap_group_replication.inc
20 INSERT INTO t1 VALUES (1);
21 server2
22 SET SESSION sql_log_bin=0;
23 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
24 CREATE TABLE t2 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
25 SET SESSION sql_log_bin=1;
26 #
27 # Lock table t1 and table t2 on server 2
28 # Table t1: Blocks first phase of recovery
29 # Table t2: Blocks second phase of recovery
30 #
31 SET @configured_rec_policy= @@GLOBAL.group_replication_recovery_complete_at;
32 SET GLOBAL group_replication_recovery_complete_at= "transactions_certified";
33 Warnings:
34 Warning 1681 'group_replication_recovery_complete_at' is deprecated and will be removed in a future release.
35 server_2 (server2)
36 LOCK TABLE t1 READ;
37 slave (server2)
38 LOCK TABLE t2 READ;
39 #
40 # Start group replication on server 2 and check it is stuck on recovery
41 #
42 server2
43 include/start_group_replication.inc
44 Warnings:
45 Warning 1681 'group_replication_recovery_complete_at' is deprecated and will be removed in a future release.
46 #
47 # Insert some transaction on server 1 that will be cached on server 2
48 #
49 server1
50 SELECT WAIT_FOR_EXECUTED_GTID_SET('08033a70-3560-11e5-a2cb-0800200c9a66:3');
51 WAIT_FOR_EXECUTED_GTID_SET('08033a70-3560-11e5-a2cb-0800200c9a66:3')
52 0
53 INSERT INTO t2 VALUES (1);
54 #
55 # UnLock table t1: First phase of recovery can carry on.
56 # Member 1 is online as it only waits for certification of cached data
57 #
58 server_2 (server2)
59 UNLOCK TABLES;
60 server2
61 include/gr_wait_for_member_state.inc
62 #
63 # UnLock table t2: Second phase of recovery can carry on.
64 # The data should be there.
65 #
66 slave (server2)
67 UNLOCK TABLES;
68 #
69 # Phase 1 cleanup
70 # Remove the data from the tables and stop group replication on server 2
71 #
72 server1
73 TRUNCATE TABLE t1;
74 TRUNCATE TABLE t2;
75 include/rpl_sync.inc
76 server2
77 include/stop_group_replication.inc
78 ######################################################################
79 # Phase 2:
80 # Recovery waits for the execution of all executed transactions
81 ######################################################################
82 #
83 # Start group replication on server 1 after inserting data on t1
84 #
85 server1
86 INSERT INTO t1 VALUES (1);
87 #
88 # Change recovery policy on server 2 to wait for transaction execution.
89 #
90 server2
91 SET GLOBAL group_replication_recovery_complete_at= "transactions_applied";
92 Warnings:
93 Warning 1681 'group_replication_recovery_complete_at' is deprecated and will be removed in a future release.
94 #
95 # Lock table t1 and table t2 on server 2
96 # Table t1: Blocks first phase of recovery
97 # Table t2: Blocks second phase of recovery
98 #
99 server_2 (server2)
100 LOCK TABLE t1 READ;
101 slave (server2)
102 LOCK TABLE t2 READ;
103 #
104 # Start group replication on server 2 and check it is stuck on recovery
105 #
106 server2
107 include/start_group_replication.inc
108 #
109 # Insert some transaction on server 1 that will be cached on server 2
110 #
111 server1
112 INSERT INTO t2 VALUES (1);
113 #
114 # Wait for the transactions to be cached on server 2
115 #
116 server2
117 #
118 # UnLock table t1: First phase of recovery can carry on.
119 # Member 2 is still recovering as it can't apply cached data
120 #
121 server_2 (server2)
122 UNLOCK TABLES;
123 server2
124 include/assert.inc [The value of member_state should be recovering]
125 #
126 # UnLock table t2: Second phase of recovery can carry on.
127 # The data should be there and the member should now be online.
128 #
129 slave (server2)
130 UNLOCK TABLES;
131 include/gr_wait_for_member_state.inc
132 #
133 # Test cleanup
134 #
135 server2
136 DROP TABLE t1;
137 DROP TABLE t2;
138 SET GLOBAL group_replication_recovery_complete_at= @configured_rec_policy;
139 Warnings:
140 Warning 1681 'group_replication_recovery_complete_at' is deprecated and will be removed in a future release.
141 include/group_replication_end.inc