1
0
mirror of https://github.com/MariaDB/server.git synced 2025-06-12 01:53:02 +03:00

MDEV-4485: Master did not allow slave to connect from the very start (empty GTID pos) if GTIDs from other multi_source master was present

The idea in the code was to protect the user that tries to connect a slave
to a master with completely different domains than what was intended. If
none of the domains in the start position are present at all in the master
binlog, we gave an error.

However, this is a stupid idea. Because when a slave connects to a master
to start replication from the very start of binlogs - such as when setting
up new master->slave servers from scratch - there will be just this
situation, the requested slave position is empty for all the domains in the
master's binlog.

So the code that gives this error is wrong, and the solution is simply to
remove it.
This commit is contained in:
unknown
2013-05-29 11:41:25 +02:00
parent 3061ca2be5
commit 385780f571
4 changed files with 73 additions and 17 deletions

View File

@ -901,8 +901,6 @@ check_slave_start_position(THD *thd, slave_connection_state *st,
rpl_gtid **delete_list= NULL;
uint32 delete_idx= 0;
bool slave_state_loaded= false;
uint32 missing_domains= 0;
rpl_gtid missing_domain_gtid;
for (i= 0; i < st->hash.records; ++i)
{
@ -943,14 +941,7 @@ check_slave_start_position(THD *thd, slave_connection_state *st,
We do not have anything in this domain, neither in the binlog nor
in the slave state. So we are probably one master in a multi-master
setup, and this domain is served by a different master.
This is not an error, however if we are missing _all_ domains
requested by the slave, then we still give error (below, after
the loop).
*/
if (!missing_domains)
missing_domain_gtid= *slave_gtid;
++missing_domains;
continue;
}
@ -1043,14 +1034,6 @@ check_slave_start_position(THD *thd, slave_connection_state *st,
}
}
if (missing_domains == st->hash.records && missing_domains > 0)
{
*errormsg= "Requested slave GTID state not found in binlog";
*error_gtid= missing_domain_gtid;
err= ER_GTID_POSITION_NOT_FOUND_IN_BINLOG;
goto end;
}
/* Do any delayed deletes from the hash. */
if (delete_list)
{