MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

14

description

 

Transcript of MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

Page 1: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)
Page 2: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

<Insert Picture Here>

MySQL 5.5 Replication Enhancements – An Overview

Lenz GrimmerMySQL Community Relations Specialist

Page 3: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

Semi-synchronous Replication

• Improves replication resilience and failover reliability

• Designed as a plugin• COMMITs on the master node are

acknowledged only when at least one slave has logged the event in the relay log

• Data is not lost in case of failover

Page 4: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

Replication Heartbeat

• Message sent at regular intervals from master node to slave nodes

• Avoids spurious relay log rotation when master node is idle

• Heartbeats are sent only if there are no more unsent events in the binlog file

• If message is not received, slave knows that master node has failed

Page 5: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

Replication Slave fsync() Options

• Fine tune relay logs and {master|relay-log}.info fsync operations

• Reduces potential file corruption when slave crashes

• Three new parameters to configure how often IO and SQL threads will issue file sync

Page 6: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

Automatic Relay Log Recovery

• Ensures master/slave consistency on restart• Slave automatically discard its own

unprocessed relay logs• Recovers pending transactions from the

originating master

Page 7: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

Per-master Event Filtering

• MySQL slave can discard events coming from a specific master

• 'CHANGE MASTER' now supports 'IGNORE_SERVER_IDS = ...' to configure which events should be discarded

• Useful in circular replication topologies

Page 8: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

Replication Slave Side Type Conversions

• Row-based replication between columns with different types was limited

• Type promotion and demotion is now supported

• Examples:– Replicate seamlessly from TINYINT column on master

to INT column on the slave– Or CHAR(10) column to a VARCHAR(20) column– Or even from TEXT column to VARCHAR(20) column

Page 9: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

Individual Log Flushing

• Users can now selectively flush server logs with 'FLUSH LOGS'

• Before, every time users wanted to flush such logs, other server logs would flush as well

• Now users can specify which individual log to flush by providing the log type as an argument to the 'FLUSH LOGS' command

Page 10: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

SHOW RELAYLOG EVENTS

• You can now show relay log contents, as you would do for the binlogs

• Useful for comparing events on the master binlog against the slave relay log

• Easier to inspect the binary and relay logs on servers that act both as master and slave in chained replication topologies

• May also be used to diagnose relay log corruption

Page 11: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

Give it a spin!

• Download MySQL 5.5 from the usual place:http://dev.mysql.com/downloads/mysql/

• Send us feedback and bug reports:http://bugs.mysql.com/

• Questions? Use the Forums or Mailing Lists:http://forums.mysql.com|http://lists.mysql.com

• Blog about your experiences:http://planet.mysql.com

Page 12: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

Discussion / Q & A

Page 13: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)

Thank you!

Lenz Grimmer <[email protected]>

http://www.lenzg.net/

@lenzgr

Page 14: MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)