[MDEV-4483] Slave loses traditional master coordinates immediately on CHANGE MASTER TO MASTER_USE_GTID = 1 Created: 2013-05-05  Updated: 2013-06-07  Resolved: 2013-06-07

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.2
Fix Version/s: 10.0.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Kristian Nielsen
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-26 Global transaction ID Closed

 Description   

Possibly it currently works by design, and then it's more of a feature request than a bug report

As soon as we execute CHANGE MASTER TO MASTER_USE_GTID = 1 on a slave which had some master position, the master coordinates get reset.
It's understandably that the slave does not use old coordinates if it's configured to use GTID instead, but it seems dangerous to forget them before it even connected to the master and received the new (GTID-based position). For example, a user could issue the CHANGE by mistake, and immediately, before starting the slave, set MASTER_USE_GTID back to 0; but the position is already lost, and further attempt to start slave will cause data inconsistency and replication failure. Or, it might happen that the master does not support GTID, so the slave won't start. It produces very comprehensive error message, but it's quite difficult to fix the problem because the previous position is already forgotten.

Test case:

--source include/master-slave.inc
 
CREATE TABLE t1 (i int);
 
--sync_slave_with_master
 
--source include/stop_slave.inc
CHANGE MASTER TO MASTER_USE_GTID = 1;
CHANGE MASTER TO MASTER_USE_GTID = 0;
--source include/start_slave.inc
 
--connection master
INSERT INTO t1 VALUES (1);
--sync_slave_with_master
 

fails with

Last_Error	Error 'Table 't1' already exists' on query. Default database: 'test'. Query: 'CREATE TABLE t1 (i int)'

bzr version-info

revision-id: knielsen@knielsen-hq.org-20130503092729-gedp152b19k5wdnj
revno: 3626
branch-nick: 10.0-base



 Comments   
Comment by Elena Stepanova [ 2013-05-27 ]

Still reproducible with the new implementation, on 10.0-base revno 3635, both with current_pos and slave_pos.

Comment by Kristian Nielsen [ 2013-06-07 ]

Fix pushed to 10.0-base.

Generated at Thu Feb 08 06:56:47 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.