@@ -8,26 +8,25 @@ connection master;
8
8
use test;
9
9
connection slave;
10
10
/*M!999999\- enable the sandbox mode */
11
- -- SET GLOBAL gtid_slave_pos='';
12
11
CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
13
12
13
+ -- SET GLOBAL gtid_slave_pos='';
14
14
/*M!999999\- enable the sandbox mode */
15
15
STOP ALL SLAVES;
16
- -- SET GLOBAL gtid_slave_pos='';
17
16
CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
18
17
18
+ -- SET GLOBAL gtid_slave_pos='';
19
19
START ALL SLAVES;
20
20
/*M!999999\- enable the sandbox mode */
21
21
STOP ALL SLAVES;
22
- -- SET GLOBAL gtid_slave_pos='';
23
22
CHANGE MASTER '' TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
24
23
24
+ -- SET GLOBAL gtid_slave_pos='';
25
25
START ALL SLAVES;
26
26
start slave;
27
27
Warnings:
28
28
Note 1254 Slave is already running
29
29
/*M!999999\- enable the sandbox mode */
30
- -- SET GLOBAL gtid_slave_pos='';
31
30
CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
32
31
33
32
start slave;
@@ -46,72 +45,72 @@ DROP TABLE t2;
46
45
1. --dump-slave=1 --gtid
47
46
48
47
/*M!999999\- enable the sandbox mode */
49
- SET GLOBAL gtid_slave_pos='0-1-1001';
50
48
CHANGE MASTER '' TO MASTER_USE_GTID=slave_pos;
51
49
-- CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
52
50
51
+ SET GLOBAL gtid_slave_pos='0-1-1001';
53
52
54
53
1a. --dump-slave=1
55
54
56
55
/*M!999999\- enable the sandbox mode */
57
- -- SET GLOBAL gtid_slave_pos='0-1-1001';
58
56
CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
59
57
58
+ -- SET GLOBAL gtid_slave_pos='0-1-1001';
60
59
61
60
2. --dump-slave=2 --gtid
62
61
63
62
/*M!999999\- enable the sandbox mode */
64
- -- SET GLOBAL gtid_slave_pos='0-1-1001';
65
63
-- CHANGE MASTER '' TO MASTER_USE_GTID=slave_pos;
66
64
-- CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
67
65
66
+ -- SET GLOBAL gtid_slave_pos='0-1-1001';
68
67
69
68
2. --dump-slave=2
70
69
71
70
/*M!999999\- enable the sandbox mode */
72
- -- SET GLOBAL gtid_slave_pos='0-1-1001';
73
71
-- CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
74
72
73
+ -- SET GLOBAL gtid_slave_pos='0-1-1001';
75
74
*** Test mysqldump --master-data GTID/non-gtid functionality.
76
75
77
76
1. --master-data=1 --gtid
78
77
79
78
/*M!999999\- enable the sandbox mode */
80
79
CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
81
- SET GLOBAL gtid_slave_pos='0-2-1003';
82
80
-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
81
+ SET GLOBAL gtid_slave_pos='0-2-1003';
83
82
84
83
1a. --master-data=1
85
84
86
85
/*M!999999\- enable the sandbox mode */
87
- -- SET GLOBAL gtid_slave_pos='0-2-1003';
88
86
CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
87
+ -- SET GLOBAL gtid_slave_pos='0-2-1003';
89
88
90
89
2. --master-data=2 --gtid
91
90
92
91
/*M!999999\- enable the sandbox mode */
93
92
-- CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
94
- -- SET GLOBAL gtid_slave_pos='0-2-1003';
95
93
-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
94
+ -- SET GLOBAL gtid_slave_pos='0-2-1003';
96
95
97
96
2a. --master-data=2
98
97
99
98
/*M!999999\- enable the sandbox mode */
100
- -- SET GLOBAL gtid_slave_pos='0-2-1003';
101
99
-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
100
+ -- SET GLOBAL gtid_slave_pos='0-2-1003';
102
101
103
102
3. --master-data --single-transaction --gtid
104
103
105
104
/*M!999999\- enable the sandbox mode */
106
105
CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
107
- SET GLOBAL gtid_slave_pos='0-2-1003';
108
106
-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
107
+ SET GLOBAL gtid_slave_pos='0-2-1003';
109
108
110
109
3a. --master-data --single-transaction
111
110
112
111
/*M!999999\- enable the sandbox mode */
113
- -- SET GLOBAL gtid_slave_pos='0-2-1003';
114
112
CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
113
+ -- SET GLOBAL gtid_slave_pos='0-2-1003';
115
114
116
115
4. --master-data=2 --dump-slave=2 --single-transaction --gtid (MDEV-4827)
117
116
@@ -130,11 +129,9 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
130
129
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
131
130
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
132
131
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
133
-
134
- -- Preferably use GTID to start replication from GTID position:
135
-
136
132
-- CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
137
- -- SET GLOBAL gtid_slave_pos='0-2-1003';
133
+
134
+ -- A corresponding to the above master-data CHANGE-MASTER settings to the slave gtid state is printed later in the file.
138
135
139
136
--
140
137
-- Alternately, following is the position of the binary logging from SHOW MASTER STATUS at point of backup.
@@ -149,14 +146,24 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
149
146
-- Use this position when creating a clone of, or replacement server, from where the backup was taken.
150
147
-- This new server will connects to the same primary server(s).
151
148
--
152
- -- GTID position to start replication:
153
- -- SET GLOBAL gtid_slave_pos='0-1-1001';
149
+
150
+ -- A corresponding to the below dump-slave CHANGE-MASTER settings to the slave gtid state is printed later in the file.
154
151
155
152
-- Use only the MASTER_USE_GTID=slave_pos or MASTER_LOG_FILE/MASTER_LOG_POS in the statements below.
156
153
157
154
-- CHANGE MASTER '' TO MASTER_USE_GTID=slave_pos;
158
155
-- CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
159
156
157
+
158
+ -- The deferred gtid setting for slave corresponding to the master-data CHANGE-MASTER follows
159
+
160
+ -- Preferably use GTID to start replication from GTID position:
161
+
162
+ -- SET GLOBAL gtid_slave_pos='0-2-1003';
163
+
164
+ -- The deferred gtid setting for slave corresponding to the dump-slave CHANGE-MASTER follows
165
+ -- GTID position to start replication:
166
+ -- SET GLOBAL gtid_slave_pos='0-1-1001';
160
167
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
161
168
162
169
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -187,10 +194,6 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
187
194
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
188
195
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
189
196
190
- -- Preferably use GTID to start replication from GTID position:
191
-
192
- -- SET GLOBAL gtid_slave_pos='0-2-1003';
193
-
194
197
--
195
198
-- Alternately, following is the position of the binary logging from SHOW MASTER STATUS at point of backup.
196
199
-- Use this when creating a replica of the primary server where the backup was made.
@@ -199,15 +202,27 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
199
202
200
203
-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
201
204
205
+ -- A corresponding to the above master-data CHANGE-MASTER settings to the slave gtid state is printed as comments later in the file.
206
+
202
207
--
203
208
-- The following is the SQL position of the replication taken from SHOW SLAVE STATUS at the time of backup.
204
209
-- Use this position when creating a clone of, or replacement server, from where the backup was taken.
205
210
-- This new server will connects to the same primary server(s).
206
211
--
207
- -- GTID position to start replication:
208
- -- SET GLOBAL gtid_slave_pos='0-1-1001';
212
+
213
+ -- A corresponding to the below dump-slave CHANGE-MASTER settings to the slave gtid state is printed later in the file.
209
214
-- CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
210
215
216
+
217
+ -- The deferred gtid setting for slave corresponding to the master-data CHANGE-MASTER follows
218
+
219
+ -- Preferably use GTID to start replication from GTID position:
220
+
221
+ -- SET GLOBAL gtid_slave_pos='0-2-1003';
222
+
223
+ -- The deferred gtid setting for slave corresponding to the dump-slave CHANGE-MASTER follows
224
+ -- GTID position to start replication:
225
+ -- SET GLOBAL gtid_slave_pos='0-1-1001';
211
226
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
212
227
213
228
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -232,8 +247,8 @@ change master to master_use_gtid=slave_pos;
232
247
connection master;
233
248
# Ensuring the binlog dump thread is killed on primary...
234
249
/*M!999999\- enable the sandbox mode */
235
- -- SET GLOBAL gtid_slave_pos='0-1-1005';
236
250
-- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000002', MASTER_LOG_POS=BINLOG_START;
251
+ -- SET GLOBAL gtid_slave_pos='0-1-1005';
237
252
connection slave;
238
253
include/start_slave.inc
239
254
include/rpl_end.inc
0 commit comments