MySQL Replication: Latest Developments · MySQL 5.1.30 row-based replication MySQL 4.0.12 MySQL 4.1.7 MySQL 5.5.8 semi-sync replication MySQL 5.6.10 crash-safe replication metadata
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands 2
Timeline – Server GA Releases and Major Replication Enhancements
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
MySQL 3.23.15replication added to MySQLstatement-based replication
MySQL 5.1.30row-based replication
MySQL 4.0.12
MySQL 4.1.7
MySQL 5.5.8semi-sync replication
MySQL 5.6.10crash-safe replication metadataglobal transaction Identifiersmulti-threaded applierbinary log group commit
MySQL 5.7.9large semi-sync enhancements2nd generation of multi-threaded appliermulti-source replicationgroup replication server core changesXA support in replication
Timeline – How MySQL Replication Has Evolved Over the Years!
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
MySQL 3.23.15replication added to MySQLstatement-based replication
MySQL 5.1.30row-based replication
MySQL 4.0.12
MySQL 4.1.7
MySQL 5.5.8semi-sync replication
MySQL 5.6.10crash-safe replication metadataglobal transaction Identifiersmulti-threaded applierbinary log group commit
MySQL 5.7.9large semi-sync enhancements2nd generation of multi-threaded appliermulti-source replicationgroup replication server core changesXA support in replication
– 11 were ground work for MySQL Group Replication.
• 8 replication related contributions merged into MySQL 5.7 (and counting).– Some contributions even though rejected, served as inspiration for our work.
– Countless technical discussions and feedback received from our users.
– You are an active part of this too!
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands 16
Timeline – Server GA Releases and Major Replication Enhancements
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
MySQL 3.23.15replication added to MySQLstatement-based replication
MySQL 5.1.30row-based replication
MySQL 4.0.12
MySQL 4.1.7
MySQL 5.5.8semi-sync replication
MySQL 5.6.10crash-safe replication metadataglobal transaction Identifiersmulti-threaded applierbinary log group commit
MySQL 5.7.9large semi-sync enhancements2nd generation of multi-threaded appliermulti-source replicationgroup replication server core changesXA support in replication
MySQL 5.0.15
Great!
Lets check out some of thenice Replication features
• Reads and writes always allowed.• No need to synchronize servers, ever.• No need to restart servers.• No need to change replication topology.• Easy to roll back and forth and to switch between modes.
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
Orange bar’s percentage shows the throughput gain when compared to the corresponding blue bar. Blue and stacked bars show throughput ratio computed against the best blue bar.
“Smaller”, yet interesting, enhancements!• Multi-threaded applier is able to retry failed transactions.
• Option to make the Multi-threaded applier preserve commit order.
• SSL options for mysqlbinlog tool.
• Rewrite DB rules for the mysqlbinlog tool.
• Function to wait for transactions to be applied, regardless of the replication stream they come from.
• Options to track global transaction identifiers in the return packet of the mysqlprotocol. Useful for tracking GTID session state and enabler for session consistency.
• Support for XA transactions when the binary log is enabled.
• Change in the defaults. E.g., binlog_format=ROW and sync_binlog=1.
• Options to fine tune the binary log group commit procedure.
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands 29
Timeline – Server GA Releases and Major Replication Enhancements
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
MySQL 3.23.15replication added to MySQLstatement-based replication
MySQL 5.1.30row-based replication
MySQL 4.0.12
MySQL 4.1.7
MySQL 5.5.8semi-sync replication
MySQL 5.6.10crash-safe replication metadataglobal transaction Identifiersmulti-threaded applierbinary log group commit
MySQL 5.7.9large semi-sync enhancements2nd generation of multi-threaded appliermulti-source replicationgroup replication server core changesXA support in replication
MySQL 5.0.15
The road to MySQL 5.7gave us features...
... and infrastructure to take MySQL Replication and HA to
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
MySQL 3.23.15replication added to MySQLstatement-based replication
MySQL 5.1.30row-based replication
MySQL 4.0.12
MySQL 4.1.7
MySQL 5.5.8semi-sync replication
MySQL 5.6.10crash-safe replication metadataglobal transaction Identifiersmulti-threaded applierbinary log group commit
MySQL 5.7.9large semi-sync enhancements2nd generation of multi-threaded appliermulti-source replicationgroup replication server core changesXA support in replication
• Feature rich new replication plugin based on proven distributed systems algorithms (Paxos).
– Compression, multi-platform, dynamic membership, distributed agreement, quorum based message passing, SSL, IP whitelisting, integrated with the server, ...
• Frequent releases on Labs.
– Enabled community involvement early in the design and implementation.
– Increasing interest on the technology.
• Large changes done to server core, replication framework and plugin.
– Suggests really fast development pace.
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands 36
• Modular design and implementation modernized also the server core.
• Latest release presents two features/enhancements:
–MTS support (servers now are able to apply the group replication stream in parallel).
– Single Primary Mode (with automatic leader election on primary failure and group-wide information propagation).• For those that do not want to deploy GR in multi-master mode.
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands 37
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
MySQL 3.23.15replication added to MySQLstatement-based replication
MySQL 5.1.30row-based replication
MySQL 4.0.12
MySQL 4.1.7
MySQL 5.5.8semi-sync replication
MySQL 5.6.10crash-safe replication metadataglobal transaction Identifiersmulti-threaded applierbinary log group commit
MySQL 5.7.9large semi-sync enhancements2nd generation of multi-threaded appliermulti-source replicationgroup replication server core changesXA support in replication
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
APIs: Capture / Apply / Lifecycle
Capture Applier Recovery
Replication Protocol Logics
Group Communication System API
Group Communication Engine (Paxos)
MySQL Server
MyS
QL
Gro
up
Re
plic
atio
nP
lugi
n
Group
Built on top of proven technology!Shares many pieces of async Replication.Multi-Master approach to replication.
Built on reusable components!Layered implementation approach.Interface driven development.Decoupled from the server core.The plugin listens to server events.Capture procedure of async replication.Communication decoupled from the rest.
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
APIs: Capture / Apply / Lifecycle
Capture Applier Recovery
Replication Protocol Logics
Group Communication System API
Group Communication Engine (Paxos)
MySQL Server
MyS
QL
Gro
up
Re
plic
atio
nP
lugi
n
Group
Server to Plugin:Lifecycle events: server start/stop, readyfor connections, before/after commit, ...Some semi-sync interfaces reused.New interfaces created.Internals are hidden from the plugin.
Plugin to Server:Communicate fate of a transaction.Communicate GTID, Recovery Actions.Engage the relay log.
Maintains distributed execution context.Conflict detection.Distributed recovery:Handle membership changes;Donate state if needed;Collect state if needed.
Inject transactions into the relay log.Decide the fate of on-going transactions.
ArchitecturePlugin Core
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
MySQL 3.23.15replication added to MySQLstatement-based replication
MySQL 5.1.30row-based replication
MySQL 4.0.12
MySQL 4.1.7
MySQL 5.5.8semi-sync replication
MySQL 5.6.10crash-safe replication metadataglobal transaction Identifiersmulti-threaded applierbinary log group commit
MySQL 5.7.9large semi-sync enhancements2nd generation of multi-threaded appliermulti-source replicationgroup replication server core changesXA support in replication
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
MySQL 3.23.15replication added to MySQLstatement-based replication
MySQL 5.1.30row-based replication
MySQL 4.0.12
MySQL 4.1.7
MySQL 5.5.8semi-sync replication
MySQL 5.6.10crash-safe replication metadataglobal transaction Identifiersmulti-threaded applierbinary log group commit
MySQL 5.7.9large semi-sync enhancements2nd generation of multi-threaded appliermulti-source replicationgroup replication server core changesXA support in replication
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
MySQL 3.23.15replication added to MySQLstatement-based replication
MySQL 5.1.30row-based replication
MySQL 4.0.12
MySQL 4.1.7
MySQL 5.5.8semi-sync replication
MySQL 5.6.10crash-safe replication metadataglobal transaction Identifiersmulti-threaded applierbinary log group commit
MySQL 5.7.9large semi-sync enhancements2nd generation of multi-threaded appliermulti-source replicationgroup replication server core changesXA support in replication
MySQL 5.0.15
Last but not least, MySQL 8.0.0came out, and together with
it some interesting replicationfeatures. Lets have a look.
• The user is now able to set GTID_PURGED without having to have GTID_EXECUTED empty.
• SET GLOBAL GTID_PURGED= +’<gtid_set>’
– Adds this range to the existing GTID_PURGED.
• SET GLOBAL GTID_PURGED=‘<gtid_set>’
– Sets GTID_PURGED to the gtid_set provided.
• Noteworthy:– gtid_set must be a super set of the existing GTID_PURGED – do not forget GTIDs;
– gtid_set must not intersect the set of gtids in GTID_EXECUTED that have not yet been purged – same GTID cannot be purged and not purged at the same time.
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands 53
Tuesday, October 4, 2016 Percona Live 2016 - Amsterdam, The Netherlands
MySQL 3.23.15replication added to MySQLstatement-based replication
MySQL 5.1.30row-based replication
MySQL 4.0.12
MySQL 4.1.7
MySQL 5.5.8semi-sync replication
MySQL 5.6.10crash-safe replication metadataglobal transaction Identifiersmulti-threaded applierbinary log group commit
MySQL 5.7.9large semi-sync enhancements2nd generation of multi-threaded appliermulti-source replicationgroup replication server core changesXA support in replication
MySQL 5.0.15
What now?
Well, there is more to come.We are living exciting times!