Bug #67099 MySQL 5.6, GTID and binlogs on slaves
Submitted: 5 Oct 2012 12:08 Modified: 19 Jun 2014 5:51
Reporter: Simon Mudd (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:5.6.7-rc1 OS:Any
Assigned to: CPU Architecture:Any
Tags: windmill

[5 Oct 2012 12:08] Simon Mudd
Description:
The global transaction id and simplifying the way to keep track of the replication position and avoid repeating transactions is great. One of the issues I see with the required configuration in order to enable this is according to: http://dev.mysql.com/doc/refman/5.6/en/replication-gtids-howto.html to enable this functionality:

--log-bin --log-slave-updates

From what I can see this is to ensure that a record of all "transactions" are stored in the binlogs, so that when you start up you know the already seen transaction ids (per server uuid) and this prevents any transaction being re-executed.

That's great. Of course that means that all slaves must be configured this way. You also want a slave to be able to not repeat a transaction that has been processed but the implication of the configuration settings above are that you _force_ the slave server to write binlogs (probably sync them), and thus maintain disk space for those written files.

In many environments the slave is NEVER expected to be promoted to a master so there is no need to enable binlogging. This is done to save disk space, but also to save I/O.  This new setup, if we were to use GTID functionality, would require people to look carefully at existing environments to see if the extra disk space and I/O requirements would be an issue, something that I think in many cases might be the case.

How to repeat:
Read the manual, and setup GTID as explained here: http://dev.mysql.com/doc/refman/5.6/en/replication-gtids-restrictions.html.

Check the affect of extra disk space requirements or extra I/O triggered by this change.
A normal downstream master (which often happens) would not be affected by this, nor would a slave that was previously configured to be a failover master as it would already have binlogs enabled.

Slaves which are not intended to be failover masters would have extra resource requirements.

Suggested fix:
The GTID idea is good. Storing the GTID information seen so far: the set of server-uuid, min, max sequence numbers, is fine, but for a box which only needs to know how to syncronise back to it's master or another master which is also replicating from the same server there's no need to know anything but these id, sequence number values. Storing all the binlogs is just a waste of resources.

Please consider a way to configure MySQL so that just the needed GTID information can be saved, thus reducing the extra resource issues, and avoid having to write to binlogs with all the replicated statements or rowbased image changes.
[5 Oct 2012 19:13] James Day
Good idea and particularly applicable to places with more than a few slaves!
[12 Oct 2012 11:55] Sveta Smirnova
Thank you for the reasonable feature request.
[19 Sep 2013 6:17] Simon Mudd
I see this has been created: http://dev.mysql.com/worklog/task/?id=6559 so adding the link here for reference.
[19 Jun 2014 5:51] Erlend Dahl
Implemented in 5.7.5