← Back to team overview

maria-developers team mailing list archive

Re: GTID replication and relay_log.info


Pavel Ivanov <pivanof@xxxxxxxxxx> writes:

> There's a well-known problem in MySQL that relay_log.info is not
> always in sync with the database state, and killing and restarting
> server at an unfortunate time will cause it to re-execute last
> statement and potentially break replication. Did you fix this
> situation with GTIDs and rpl_slave_state table? It looks like with

Yes. When using GTID, relay logs are ignored whenever slave threads are
restarted, such as slave server restart, events are fetched anew from the
server starting at the current GTID position.

As you say, this is required for crash safety.

> GTIDs it's really easy to solve the problem -- rpl_slave_state has
> GTID of the last executed transaction, so on restart one needs just to
> ignore all relay logs and re-connect to master with the last GTID. Did

Yes. That is how it's done basically.

Slave restart should be crash safe with MariaDB GTID (for InnoDB DML - MyISAM
DML or DDL in general is not crash safe of course, as neither MyISAM nor DDL
is transactional).

There is currently a bug when restarting the *master* while the slave is still
scanning for the GTID start position, but this will be fixed before GA of

 - Kristian.

Follow ups