Skip to content

Commit 726dbf7

Browse files
author
Neha Kumari
committed
WL#12819:GTIDs: Replicate from GTID disabled source to GTID enabled replica directly
This worklog implements a new option ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS = [OFF|LOCAL|uuid] which will be a per channel property to be specified with CHANGE MASTER that allows direct data flows between a non-GTID replication setup and a GTID replication setup. After this worklog, a user shall be able to replicate from a GTID disabled source to a GTID enabled replica without any other middleware or any upgrade procedure. RB: 24033
1 parent 6294f5b commit 726dbf7

File tree

94 files changed

+4125
-187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+4125
-187
lines changed

mysql-test/extra/rpl_tests/restart_slave_with_custom_relaylog_repo_file.inc

+141-1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,123 @@ localhost
146146
EOF
147147
END_OF_PROCEDURE
148148

149+
--write_file $MYSQL_TMP_DIR/create_file_repo_with_no_assign_gtids_to_anonymous_transactions.inc END_OF_PROCEDURE
150+
--write_file $MYSQLD_DATADIR/$filename
151+
12
152+
./slave-relay-bin.000001
153+
4
154+
155+
0
156+
0
157+
0
158+
1
159+
160+
root
161+
localhost
162+
0
163+
1
164+
EOF
165+
END_OF_PROCEDURE
166+
167+
--write_file $MYSQL_TMP_DIR/create_file_repo_with_invalid_type_assign_gtids_to_anonymous_transactions.inc END_OF_PROCEDURE
168+
--write_file $MYSQLD_DATADIR/$filename
169+
14
170+
./slave-relay-bin.000001
171+
4
172+
173+
0
174+
0
175+
0
176+
1
177+
178+
root
179+
localhost
180+
0
181+
1
182+
6
183+
184+
EOF
185+
END_OF_PROCEDURE
186+
187+
--write_file $MYSQL_TMP_DIR/create_file_repo_with_invalid_default_value_for_type_off_assign_gtids_to_anonymous_transactions.inc END_OF_PROCEDURE
188+
--write_file $MYSQLD_DATADIR/$filename
189+
14
190+
./slave-relay-bin.000001
191+
4
192+
193+
0
194+
0
195+
0
196+
1
197+
198+
root
199+
localhost
200+
0
201+
1
202+
1
203+
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaaa
204+
EOF
205+
END_OF_PROCEDURE
206+
207+
--write_file $MYSQL_TMP_DIR/create_file_repo_with_invalid_value_for_type_not_off_assign_gtids_to_anonymous_transactions.inc END_OF_PROCEDURE
208+
--write_file $MYSQLD_DATADIR/$filename
209+
14
210+
./slave-relay-bin.000001
211+
4
212+
213+
0
214+
0
215+
0
216+
1
217+
218+
root
219+
localhost
220+
0
221+
1
222+
3
223+
224+
EOF
225+
END_OF_PROCEDURE
226+
227+
--write_file $MYSQL_TMP_DIR/create_file_repo_with_invalid_value_assign_gtids_to_anonymous_transactions.inc END_OF_PROCEDURE
228+
--write_file $MYSQLD_DATADIR/$filename
229+
14
230+
./slave-relay-bin.000001
231+
4
232+
233+
0
234+
0
235+
0
236+
1
237+
238+
root
239+
localhost
240+
0
241+
1
242+
3
243+
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa
244+
EOF
245+
END_OF_PROCEDURE
246+
247+
--write_file $MYSQL_TMP_DIR/create_file_repo_with_no_value_assign_gtids_to_anonymous_transactions.inc END_OF_PROCEDURE
248+
--write_file $MYSQLD_DATADIR/$filename
249+
13
250+
./slave-relay-bin.000001
251+
4
252+
253+
0
254+
0
255+
0
256+
1
257+
258+
root
259+
localhost
260+
0
261+
1
262+
3
263+
EOF
264+
END_OF_PROCEDURE
265+
149266
--let $MYSQLD_DATADIR= `select @@datadir`
150267
--let $filename = `SELECT @@relay_log_info_file`
151268

@@ -178,7 +295,24 @@ if ($sub_testcase == no_require_table_primary_key_check) {
178295
if ($sub_testcase == invalid_require_table_primary_key_check) {
179296
--source $MYSQL_TMP_DIR/create_file_repo_with_invalid_require_table_primary_key_check.inc
180297
}
181-
298+
if ($sub_testcase == no_assign_gtids_to_anonymous_transactions) {
299+
--source $MYSQL_TMP_DIR/create_file_repo_with_no_assign_gtids_to_anonymous_transactions.inc
300+
}
301+
if ($sub_testcase == invalid_type_assign_gtids_to_anonymous_transactions) {
302+
--source $MYSQL_TMP_DIR/create_file_repo_with_invalid_type_assign_gtids_to_anonymous_transactions.inc
303+
}
304+
if ($sub_testcase == invalid_default_value_for_type_off_assign_gtids_to_anonymous_transactions) {
305+
--source $MYSQL_TMP_DIR/create_file_repo_with_invalid_default_value_for_type_off_assign_gtids_to_anonymous_transactions.inc
306+
}
307+
if ($sub_testcase == invalid_value_for_type_not_off_assign_gtids_to_anonymous_transactions) {
308+
--source $MYSQL_TMP_DIR/create_file_repo_with_invalid_value_for_type_not_off_assign_gtids_to_anonymous_transactions.inc
309+
}
310+
if ($sub_testcase == invalid_value_assign_gtids_to_anonymous_transactions) {
311+
--source $MYSQL_TMP_DIR/create_file_repo_with_invalid_value_assign_gtids_to_anonymous_transactions.inc
312+
}
313+
if ($sub_testcase == no_value_assign_gtids_to_anonymous_transactions) {
314+
--source $MYSQL_TMP_DIR/create_file_repo_with_no_value_assign_gtids_to_anonymous_transactions.inc
315+
}
182316
--let $rpl_server_parameters= $rpl_server_restart_parameters
183317

184318
--let $explicit_default_wait_counter = 15000
@@ -192,3 +326,9 @@ if ($sub_testcase == invalid_require_table_primary_key_check) {
192326
--remove_file $MYSQL_TMP_DIR/create_file_repo_with_nonexist_PCU.inc
193327
--remove_file $MYSQL_TMP_DIR/create_file_repo_with_no_require_table_primary_key_check.inc
194328
--remove_file $MYSQL_TMP_DIR/create_file_repo_with_invalid_require_table_primary_key_check.inc
329+
--remove_file $MYSQL_TMP_DIR/create_file_repo_with_no_assign_gtids_to_anonymous_transactions.inc
330+
--remove_file $MYSQL_TMP_DIR/create_file_repo_with_invalid_type_assign_gtids_to_anonymous_transactions.inc
331+
--remove_file $MYSQL_TMP_DIR/create_file_repo_with_invalid_default_value_for_type_off_assign_gtids_to_anonymous_transactions.inc
332+
--remove_file $MYSQL_TMP_DIR/create_file_repo_with_invalid_value_assign_gtids_to_anonymous_transactions.inc
333+
--remove_file $MYSQL_TMP_DIR/create_file_repo_with_invalid_value_for_type_not_off_assign_gtids_to_anonymous_transactions.inc
334+
--remove_file $MYSQL_TMP_DIR/create_file_repo_with_no_value_assign_gtids_to_anonymous_transactions.inc

mysql-test/include/rpl_end.inc

+8-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
#
1515
# ==== Usage ====
1616
#
17-
# [--let $rpl_only_running_threads= 1]
18-
# [--let $rpl_debug= 1]
19-
# [--let $rpl_group_replication= 1]
20-
# [--let $rpl_gtid_utils= 1]
21-
# [--let $rpl_assert_transaction_length= 1]
17+
# [--let $rpl_skip_sync = 1]
18+
# [--let $rpl_skip_delete_channels = 1]
19+
# [--let $rpl_skip_stop_slave = 1]
20+
# [--let $rpl_only_running_threads = 1]
21+
# [--let $rpl_debug = 1]
22+
# [--let $rpl_group_replication = 1]
23+
# [--let $rpl_gtid_utils = 1]
24+
# [--let $rpl_assert_transaction_length = 1]
2225
# --source include/rpl_end.inc
2326
#
2427
# Parameters:

mysql-test/r/information_schema_keywords.result

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ AS 1
2424
ASC 1
2525
ASCII 0
2626
ASENSITIVE 1
27+
ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS 0
2728
AT 0
2829
ATTRIBUTE 0
2930
AUTOEXTEND_SIZE 0

mysql-test/r/mysqldump.result

+2
Original file line numberDiff line numberDiff line change
@@ -5347,6 +5347,8 @@ CREATE TABLE IF NOT EXISTS `slave_relay_log_info` (
53475347
`Privilege_checks_hostname` char(255) CHARACTER SET ascii COLLATE ascii_general_ci DEFAULT NULL COMMENT 'Hostname part of PRIVILEGE_CHECKS_USER.',
53485348
`Require_row_format` tinyint(1) NOT NULL COMMENT 'Indicates whether the channel shall only accept row based events.',
53495349
`Require_table_primary_key_check` enum('STREAM','ON','OFF') NOT NULL DEFAULT 'STREAM' COMMENT 'Indicates what is the channel policy regarding tables having primary keys on create and alter table queries',
5350+
`Assign_gtids_to_anonymous_transactions_type` enum('OFF','LOCAL','UUID') NOT NULL DEFAULT 'OFF' COMMENT 'Indicates whether the channel will generate a new GTID for anonymous transactions. OFF means that anonymous transactions will remain anonymous. LOCAL means that anonymous transactions will be assigned a newly generated GTID based on server_uuid. UUID indicates that anonymous transactions will be assigned a newly generated GTID based on Assign_gtids_to_anonymous_transactions_value',
5351+
`Assign_gtids_to_anonymous_transactions_value` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'Indicates the UUID used while generating GTIDs for anonymous transactions',
53505352
PRIMARY KEY (`Channel_name`)
53515353
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC COMMENT='Relay Log Information';
53525354
/*!40101 SET character_set_client = @saved_cs_client */;

mysql-test/suite/funcs_1/r/is_columns_mysql.result

+4
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ def mysql slave_relay_log_info Privilege_checks_username 10 NULL YES char 32 96
188188
def mysql slave_relay_log_info Privilege_checks_hostname 11 NULL YES char 255 255 NULL NULL NULL ascii ascii_general_ci char(255) select,insert,update,references Hostname part of PRIVILEGE_CHECKS_USER. NULL
189189
def mysql slave_relay_log_info Require_row_format 12 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select,insert,update,references Indicates whether the channel shall only accept row based events. NULL
190190
def mysql slave_relay_log_info Require_table_primary_key_check 13 STREAM NO enum 6 18 NULL NULL NULL utf8 utf8_general_ci enum('STREAM','ON','OFF') select,insert,update,references Indicates what is the channel policy regarding tables having primary keys on create and alter table queries NULL
191+
def mysql slave_relay_log_info Assign_gtids_to_anonymous_transactions_type 14 OFF NO enum 5 15 NULL NULL NULL utf8 utf8_general_ci enum('OFF','LOCAL','UUID') select,insert,update,references Indicates whether the channel will generate a new GTID for anonymous transactions. OFF means that anonymous transactions will remain anonymous. LOCAL means that anonymous transactions will be assigned a newly generated GTID based on server_uuid. UUID indicates that anonymous transactions will be assigned a newly generated GTID based on Assign_gtids_to_anonymous_transactions_value NULL
192+
def mysql slave_relay_log_info Assign_gtids_to_anonymous_transactions_value 15 NULL YES text 65535 65535 NULL NULL NULL utf8 utf8_bin text select,insert,update,references Indicates the UUID used while generating GTIDs for anonymous transactions NULL
191193
def mysql slave_worker_info Id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int unsigned PRI select,insert,update,references NULL
192194
def mysql slave_worker_info Relay_log_name 2 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_bin text select,insert,update,references NULL
193195
def mysql slave_worker_info Relay_log_pos 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint unsigned select,insert,update,references NULL
@@ -540,6 +542,8 @@ NULL mysql slave_relay_log_info Id int NULL NULL NULL NULL int unsigned
540542
1.0000 mysql slave_relay_log_info Privilege_checks_hostname char 255 255 ascii ascii_general_ci char(255)
541543
NULL mysql slave_relay_log_info Require_row_format tinyint NULL NULL NULL NULL tinyint(1)
542544
3.0000 mysql slave_relay_log_info Require_table_primary_key_check enum 6 18 utf8 utf8_general_ci enum('STREAM','ON','OFF')
545+
3.0000 mysql slave_relay_log_info Assign_gtids_to_anonymous_transactions_type enum 5 15 utf8 utf8_general_ci enum('OFF','LOCAL','UUID')
546+
1.0000 mysql slave_relay_log_info Assign_gtids_to_anonymous_transactions_value text 65535 65535 utf8 utf8_bin text
543547
NULL mysql slave_worker_info Id int NULL NULL NULL NULL int unsigned
544548
1.0000 mysql slave_worker_info Relay_log_name text 65535 65535 utf8 utf8_bin text
545549
NULL mysql slave_worker_info Relay_log_pos bigint NULL NULL NULL NULL bigint unsigned

0 commit comments

Comments
 (0)