SlideShare a Scribd company logo
1 of 57
Download to read offline
Yahoo Case Study: MySQL GTIDs and Parallel or
Multithreaded Replication
PRESENTED BY Stacy Yuan, Yashada Jadhav October 2015
About Yahoo
▪  Yahoo is focused on making the world’s daily habits inspiring and
entertaining.
▪  By creating highly personalized experiences for our users, we keep people
connected to what matters most to them, across devices and around the
world.
▪  In turn, we create value for advertisers by connecting them with the
audiences that build their businesses
▪  More than 1B monthly active users across Yahoo and Tumblr
▪  More than 575M mobile monthly active users across Yahoo and Tumblr
Ad Products Team
Mission Statement: Delivering scalable and cost efficient data services
through innovation and automation powering Yahoo Products
▪  Thousands of Production Servers
▪  OLTP systems & Data marts
▪  Database Design and Architecture
▪  Capacity Planning and Performance Reviews
▪  24x7 Monitoring and Operational Support
MySQL at Yahoo
▪  MySQL powers many mission-critical products within Advertising
and User space across Desktop and Mobile
▪  Multiple production configurations based on product requirement
▪  Yahoo Sports, Daily Fantasy: Mobile friendly
▪  Flickr: Sharded across thousands of servers
▪  DBaaS setup for multiple products
▪  Hot:Hot, Hot:Warm Configurations
▪  Versions range from Percona Server 5.5 to 5.6 including Percona
XtraDB Cluster
▪  Operating systems running customized RHEL 6.x
About Stacy
▪  14 years of experience on various flavors of relational databases.
▪  Focus on performance tuning, code reviews, database deployment
and infrastructure management for MySQL
▪  In her spare time, she enjoys reading books and doing some
volunteer work.
About Yashada
▪  MySQL DevOps Engineer with a background in database design
and performance tuning.
▪  4+ years of experience on various flavors of relational databases.
▪  Special Skills - Fluency in Sarcasm
What are the next 45 minutes about?
•  GTID Replication
● Advantages and Disadvantages
● Performance when compared to regular replication
▪  Multi threaded slaves
●  Why do we want MTS?
●  MTS vs single threaded replication - Performance tests
▪  Rolling out GTID and MTS to a live system with no downtime
▪  GTID and MTS in Production
●  Operational issues
●  Monitoring and HA
●  Backups using xtrabackup
Why go for GTID and MTS
▪  Slave promotion becomes easier with a global transaction ID
▪  Multitenant database systems suffer from problems like resource
contention due to bad queries, batch jobs etc. that affect replication.
▪  MTS without GTID - replication co-ordinates might no longer be
accurate due to multiple parallel worker threads.
▪  MTS with GTID
GTID Replication
File-based Replication
Enables data from one MySQL database server (the master) to be
replicated to one or more MySQL database servers (the slaves) through
MySQL log file and its position
▪  Have replication user, binlog is enabled
▪  Have a copy of master database
▪  Connect to master through master_host, port, replication user,
master log file and its position.
▪  Each slave pulls the data from the master, and execute the events
to the slave.
GTID Replication
A global transaction identifier (GTID) is a unique identifier created and
associated with each transaction committed on the server of origin
(master).
GTID is unique not only to the server on which it originated, but is
unique across all servers in a given replication setup.
GTID = source_id:transaction_id
▪  The source_id identifies the originating server.
▪  The transaction_id is a sequence number determined by the order in
which the transaction was committed on this server.
Example:
▪  5c7401d3-3623-11e5-ae8c-78e7d15fd641:1-13476
GTID Replication Advantage
▪  Replication topology is easy to change - binlog file name and
position are not required any more instead we use
master_auto_position=1
▪  Failover is simplified
▪  Increase performance in relay slave - set sync_binlog=0
▪  Managing multi-tiered replication is easier
Master_log_file=‘mysql-bin.***’
Master_log_pos=****
master_auto_position=1
Replication Failover Comparison
Regular Rep Failover
If S1 is bad, S4
S5 need
to be rebuilt.
M M
GTID Rep Failover
Redirect
S4 to M
S2
S3
S1
S4
S5
S2 S1
S3 S4
S5
GTID Replication Limitations
▪  GTID does not provide replication monitoring
▪  SQL_SKIP_SLAVE_COUNTER does not work
▪  Can not force the database to start replication from specific position
GTIDs Replication Caveats
▪  Updates involving non-transactional storage engines.
▪  CREATE TABLE ... SELECT statements is not supported.
▪  Temporary table is not supported inside a transaction
To prevent GTID-based replication to fail: enforce-gtid-consistency
Replication Performance GTID vs Regular Rep
In terms of performance, GTID is almost same as regular replication. It
is slightly slower.
The reasons could be -
▪  GTIDs write more lines into binary log - information about GTID
▪  GTID performs additional checks for transactions
GTID vs Regular Rep
GTID vs Regular Rep
GTID vs Regular Rep
Multi threaded Replication
Single threaded replication
▪ Applications multi-threaded parallel write into master
▪ Replication from master to slave is single-threaded, it becomes
bottleneck in a busy system.
Master Slave
Multi-Threaded Slaves (MTS)
▪  Coordinator thread on slave dispatches work across several worker
threads
▪  Each worker thread commit transaction individually.
▪  Multiple active schemas/databases can take advantage of parallel
replication
Master Slave
MTS Prerequisites
▪  MySQL 5.6 above
▪  Transactions are independently based on different databases.
▪  Multitenant databases is the best to enable MTS
▪  N databases, use N parallel workers
slave_parallel_workers = N
▪  Example: 3 databases in MySQL, better to set
slave_parallel_workers =3
Master
db1, db2, db3
Slave
db1, db2, db3
Configure MTS
▪  STOP SLAVE;
▪  SET GLOBAL slave_parallel_workers=3;
▪  START SLAVE;
MTS Execution Gaps and Checkpoint
▪  Events are no longer guaranteed to be consecutive
▪  Execution gaps are tracked
▪  Checkpoints are performed from time to time
Check settings
slave_checkpoint_period default 300 ms
slave_checkpoint_group default 512 trx
▪  Exec_Master_Log_Pos shows the latest checkpoint and not latest
transaction
▪  How to fix execution gaps -
STOP SLAVE; START SLAVE UNTIL SQL_AFTER_MTS_GAPS
Convert MTS to Single-threaded
▪  Run MTS until no more gaps are found in the relay log
▪  Stop Replication
▪  Configure single threaded slave
▪  Start single threaded slave
START SLAVE UNTIL SQL_AFTER_MTS_GAPS;
SET @@GLOBAL.slave_parallel_workers = 0;
START SLAVE;
MTS Advantages and Limitations
Advantages:
▪  Take advantage of multi-core servers
▪  Changes to each schema applied and committed independently by
worker threads
▪  Smaller risk of data loss
Limitations:
▪  START SLAVE UNTIL no longer support
▪  Foreign Keys cross-referencing DBs will disable MTS
▪  No implicit transaction retry after transient failure
MTS Caveats
▪  Enforcing foreign key relationships between tables in different
databases causes MTS to use sequential mode which can have
negative impact on performance
▪  Single database replication, it slows down the replication
performance
MTS without GTID
▪  Exec_Master_Log_Pos in SHOW SLAVE STATUS is misleading.
▪  Skipping replication errors with SQL_SLAVE_SKIP_COUNTER=1 is
dangerous
▪  Backup from slave, either mysqldump and xtrabackup might not get
right position
GTID comes to the rescue
Performance Testing - GTID with MTS Setup
Test scenario:
▪  one master,
▪  two slaves (one is single-threaded replication, another slave is multi-
threaded replication both using GTID
Master
Slave1 Slave2
GTID Rep MTS GTID Rep
Replication Performance Comparison
Replication Performance Comparison
QPS is increased about 3 or 4 times
Load, CPU, and Writes per second are increased as well
Replication Performance Comparison
GTID with MTS enabled: Things to watch out for
▪  Exec_Master_Log_Pos is no longer reliable
▪  Executed_Gtid_Set is the reliable
▪  SQL_SLAVE_SKIP_COUNTER no longer works
▪  START SLAVE UNTIL is not supported
▪  Slave_transaction_retries is treated as 0, and can not be changed.
MySQL57 GA
▪  Parallel replication improvement
Slave can apply transaction in parallel with single database/schema with --slave-parallel-
type=LOGICAL_CLOCK.
▪  GTID improvements:
●  Automatically tracks the replication position in replication stream.
●  Enable/disable GTID can be online without MySQL restart
MySQL57 SLAVE_PARALLEL_TYPE STUDY
Master	
  :	
  slave-­‐parallel-­‐type	
   DATABASE	
   LOGICAL_CLOCK	
  
Master	
  generated	
  binary	
  logs(MB)	
   3924	
   3690	
  
read/write	
  requests	
   18704820	
   17587168	
  
read/write	
  requests/per	
  sec	
   20783.1	
   19541.25	
  
response	
  Sme	
  AVG	
  ms	
   1.54	
   1.64	
  
95	
  percenSle	
   2.21	
   2.36	
  
15	
  mins	
  work	
   81	
   38	
  
Slave	
  QPS	
   4614.648	
   9466.198	
  
Rolling out GTID and MTS to production
Online Rollout GTID with MTS in Percona Server
▪  MySQL56 requires downtime to enable GTID, it is not acceptable
▪  With Percona server 5.6, with almost no downtime
The variable GTID_DEPLOYMENT_STEP plays an important role
Database Servers Setup
Dual masters setup
▪ Masters setup cross different colos.
▪ Each master carries one slave DNS
Prod master BCP master
Prod slave BCP slave
Enable GTID without downtime
Enable GTID in BCP side
1. Make sure BCP master and
BCP slave are sync
2. Stop mysqld in BCP master and BCP slave,
add gtid_deployment_step=on,
gtid_mode=ON,
enforce-gtid-consistency into my.cnf
Restart mysqld in both servers.
3. Replication from prod master to
BCP master is good.
DNS
Prod master
BCP master
GTID_deployme
nt_step=on
Prod slave
BCP slave
GTID_deployme
nt_step=on
Enable GTID without downtime
Promote BCP master to Prod master
4. Prod master: set global read_only=on
5. BCP master:
set global gtid_deployment_step = off;
set global read_only=off;
6. The replication from BCP master to
Prod master is broken.
DNS
Prod master
BCP master
GTID_deployme
nt_step=off
Prod slave
BCP slave
GTID_deployme
nt_step=on
Enable GTID without downtime
Enable GTID in Prod master
7. Enable GTID on old prod master and prod slave
8. Fix replication from BCP master to prod master
CHANGE MASTER TO
MASTER_AUTO_POSITION = 1;
START SLAVE;
9. Enable GTID replication from
Prod master to BCP master
10. Enable MTS in all servers
stop slave;
set global slave_parallel_workers=16;
start slave;
DNS
Prod master
GTID enabled
BCP master
GTID_deployme
nt_step=off
Prod slave
GTID enabled
BCP slave
GTID_deployme
nt_step=on
Enable GTID without downtime
Switch back
10. Perform switchover in Prod master
Disable gtid_deployment_step across all servers.
DNS
Prod master
GTID enabled
BCP master
GTID_deployme
nt_step=off
Prod slave
GTID enabled
BCP slave
GTID_deployme
nt_step=off
Switchover Steps
	
  	
  
•  Enable global read_only=on in prod master
•  Sanity check to make sure BCP master catch up its master
(WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS)
•  Disable read_only in BCP master. BCP master becomes prod
master
Failover:
•  If prod master is unreachable, it will be failover without step 1 and 2.
	
  
GTID and MTS in Production : MySQL Ops
GTID and MTS in production : What did we learn?
▪  Errant Transactions
▪  Replication Monitoring
▪  Building slaves using xtrabackup
Errant Transaction
The errant transactions are:
They are only executed in slaves.
▪  Could result from a mistake
▪  Could be intentionally by design, such as report tables
▪  Why they cause problem
When the slave becomes the master during failover, it exchanges its own
set of executed GTIDs, then send any missing transactions to the slaves.
Errant Transaction Detection and Fix
Detect: GTID_SUBSET(slave-Executed_Gtid_Set, master-Executed_Gtid_Set)
If it returns true(1), no errant trx.
If it returns false(0), it does have errant trx.
Identify:GTID_SUBTRACT(slave-Executed_Gtid_Set, master-Executed_Gtid_Set)
It returns the errant GTID.
Fix: Inject empty transaction on all other servers or its master.
If the transaction must be executed in slave only, use
set sql_log_bin=0;
Inject Empty Transaction
Sql_skip_slave_counter=n no longer works
Execute a fake trx with the GTID that you want to skip
For example: GTID=68fb0071-299b-11e5-9cd6-78e7d15dbe38:501
STOP SLAVE;
SET GTID_NEXT="68fb0071-299b-11e5-9cd6-78e7d15dbe38:501";
BEGIN; COMMIT;
SET GTID_NEXT="AUTOMATIC";
START SLAVE;
SHOW SLAVE STATUSG # Verification
MySQL Replication Monitoring
	
  	
  
•  Seconds_Behind_Master
A good approximation of how late the slave is only when the slave
actively processes updates.
If the network is slow or not much updates in the master, this is NOT
a good measurement.
	
  
	
  
MySQL Replication Monitoring at Yahoo
▪  MySQL Health Heartbeat
1. Master generates heartbeat by updating timestamp (last_update)
2. Slave checks the difference between current time and last_update
GTID MTS Monitoring Challenge
▪  SHOW SLAVE STATUS
▪  Seconds_Behind_Master is still a good indication of the
replication lag
▪  Retrieved_Gtid_Set: List of GTIDs received by the I/O thread,
cleared after a server restart
▪  Executed_Gtid_Set: List of GTIDs executed by the SQL thread
▪  Auto_position: 1 if GTID-based replication is enabled
▪  5.7 is using performance_schema
Build Slaves Using Xtrabackup
▪  Start Xtrabackup from either master or slave
If the backup is taken from the master,
Please check the file xtrabackup_binlog_info in the backup folder
If the backup is from slave,
Please check the file xtrabackup_slave_info
$ cat xtrabackup_slave_info
SET GLOBAL gtid_purged='ffee1ff8-363f-11e5-af47-9cb654954cac:1-29123533';
CHANGE MASTER TO MASTER_AUTO_POSITION=1
Build Slave Using Xtrabackup
Enable Replication in Slave
Issue
mysql> SET GLOBAL gtid_purged='ffee1ff8-363f-11e5-af47-9cb654954cac:1-29123533';
ERROR 1840 (HY000): @@GLOBAL.GTID_PURGED can only be set when
@@GLOBAL.GTID_EXECUTED is empty.
How to fix
▪  RESET MASTER;
▪  SET GLOBAL gtid_purged='ffee1ff8-363f-11e5-af47-9cb654954cac:1-29123533’;
▪  CHANGE MASTER TO MASTER_HOST="mastername", master_user='rep_user',
master_password='rep_password', MASTER_AUTO_POSITION = 1;
▪  START SLAVE;
Build Slave Using Xtrabackup
Still issue?
mysql> start slave;
ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository
RESET SLAVE;
START SLAVE;
Summary
▪  GTID
▪  MTS
▪  GTID with MTS performance comparison
▪  GTID with MTS online rollout
▪  Things to watch out
▪  Rebuild slave
We would love to talk more ..
mysqlatyahoo.tumblr.com
Yashada Jadhav
yashada@yahoo-inc.com
Stacy Yuan
syuan@yahoo-inc.com

More Related Content

What's hot

OLTP Performance Benchmark Review
OLTP Performance Benchmark ReviewOLTP Performance Benchmark Review
OLTP Performance Benchmark Review
Jignesh Shah
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
Sveta Smirnova
 

What's hot (20)

MuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleysMuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleys
 
Load Testing - How to Stress Your Odoo with Locust
Load Testing - How to Stress Your Odoo with LocustLoad Testing - How to Stress Your Odoo with Locust
Load Testing - How to Stress Your Odoo with Locust
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
 
BlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for CephBlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for Ceph
 
An Introduction to MongoDB Ops Manager
An Introduction to MongoDB Ops ManagerAn Introduction to MongoDB Ops Manager
An Introduction to MongoDB Ops Manager
 
OLTP Performance Benchmark Review
OLTP Performance Benchmark ReviewOLTP Performance Benchmark Review
OLTP Performance Benchmark Review
 
ProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management Overview
 
Unrevealed Story Behind Viettel Network Cloud Hotpot | Đặng Văn Đại, Hà Mạnh ...
Unrevealed Story Behind Viettel Network Cloud Hotpot | Đặng Văn Đại, Hà Mạnh ...Unrevealed Story Behind Viettel Network Cloud Hotpot | Đặng Văn Đại, Hà Mạnh ...
Unrevealed Story Behind Viettel Network Cloud Hotpot | Đặng Văn Đại, Hà Mạnh ...
 
Testing strategies and best practices using MUnit
Testing strategies and best practices using MUnitTesting strategies and best practices using MUnit
Testing strategies and best practices using MUnit
 
OVN operationalization at scale at eBay
OVN operationalization at scale at eBayOVN operationalization at scale at eBay
OVN operationalization at scale at eBay
 
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
 
Using Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query PerformanceUsing Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query Performance
 
MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18
 
MySQL Database Monitoring: Must, Good and Nice to Have
MySQL Database Monitoring: Must, Good and Nice to HaveMySQL Database Monitoring: Must, Good and Nice to Have
MySQL Database Monitoring: Must, Good and Nice to Have
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
Mumbai MuleSoft Meetup:Batch Processing, Anypoint Messaging Queue and Custom ...
Mumbai MuleSoft Meetup:Batch Processing, Anypoint Messaging Queue and Custom ...Mumbai MuleSoft Meetup:Batch Processing, Anypoint Messaging Queue and Custom ...
Mumbai MuleSoft Meetup:Batch Processing, Anypoint Messaging Queue and Custom ...
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQL
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
 

Viewers also liked

August 2016 HUG: Better together: Fast Data with Apache Spark™ and Apache Ign...
August 2016 HUG: Better together: Fast Data with Apache Spark™ and Apache Ign...August 2016 HUG: Better together: Fast Data with Apache Spark™ and Apache Ign...
August 2016 HUG: Better together: Fast Data with Apache Spark™ and Apache Ign...
Yahoo Developer Network
 
MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016
Wagner Bianchi
 
ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016
Derek Downey
 
MySQL Database Replication - A Guide by RapidValue Solutions
MySQL Database Replication - A Guide by RapidValue SolutionsMySQL Database Replication - A Guide by RapidValue Solutions
MySQL Database Replication - A Guide by RapidValue Solutions
RapidValue
 
Ramp-Tutorial for MYSQL Cluster - Scaling with Continuous Availability
Ramp-Tutorial for MYSQL Cluster - Scaling with Continuous AvailabilityRamp-Tutorial for MYSQL Cluster - Scaling with Continuous Availability
Ramp-Tutorial for MYSQL Cluster - Scaling with Continuous Availability
Pythian
 

Viewers also liked (12)

Proxysql use case scenarios plam 2016
Proxysql use case scenarios    plam 2016Proxysql use case scenarios    plam 2016
Proxysql use case scenarios plam 2016
 
August 2016 HUG: Better together: Fast Data with Apache Spark™ and Apache Ign...
August 2016 HUG: Better together: Fast Data with Apache Spark™ and Apache Ign...August 2016 HUG: Better together: Fast Data with Apache Spark™ and Apache Ign...
August 2016 HUG: Better together: Fast Data with Apache Spark™ and Apache Ign...
 
MySQL 5.6 GTID in a nutshell
MySQL 5.6 GTID in a nutshellMySQL 5.6 GTID in a nutshell
MySQL 5.6 GTID in a nutshell
 
MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016
 
Running gtid replication in production
Running gtid replication in productionRunning gtid replication in production
Running gtid replication in production
 
Mysql 5.5 and 5.6 replication
Mysql 5.5 and 5.6 replicationMysql 5.5 and 5.6 replication
Mysql 5.5 and 5.6 replication
 
Proxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynoteProxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynote
 
ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016
 
MySQL Database Replication - A Guide by RapidValue Solutions
MySQL Database Replication - A Guide by RapidValue SolutionsMySQL Database Replication - A Guide by RapidValue Solutions
MySQL Database Replication - A Guide by RapidValue Solutions
 
How Apache Drives Music Recommendations At Spotify
How Apache Drives Music Recommendations At SpotifyHow Apache Drives Music Recommendations At Spotify
How Apache Drives Music Recommendations At Spotify
 
Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016
 
Ramp-Tutorial for MYSQL Cluster - Scaling with Continuous Availability
Ramp-Tutorial for MYSQL Cluster - Scaling with Continuous AvailabilityRamp-Tutorial for MYSQL Cluster - Scaling with Continuous Availability
Ramp-Tutorial for MYSQL Cluster - Scaling with Continuous Availability
 

Similar to Yahoo: Experiences with MySQL GTID and Multi Threaded Replication

Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Severalnines
 
MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014
Dave Stokes
 

Similar to Yahoo: Experiences with MySQL GTID and Multi Threaded Replication (20)

Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitations
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 
MySQL DBA
MySQL DBAMySQL DBA
MySQL DBA
 
MySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitationsMySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitations
 
M|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change MethodsM|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change Methods
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitations
 
Replication skeptic
Replication skepticReplication skeptic
Replication skeptic
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
 
IT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New FeaturesIT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New Features
 
MySQL/MariaDB Parallel Replication: inventory, use-case and limitations
MySQL/MariaDB Parallel Replication: inventory, use-case and limitationsMySQL/MariaDB Parallel Replication: inventory, use-case and limitations
MySQL/MariaDB Parallel Replication: inventory, use-case and limitations
 
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7
 
Configuring Sage 500 for Performance
Configuring Sage 500 for PerformanceConfiguring Sage 500 for Performance
Configuring Sage 500 for Performance
 
MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014
 
MariaDB 10.4 New Features
MariaDB 10.4 New FeaturesMariaDB 10.4 New Features
MariaDB 10.4 New Features
 
Pseudo GTID and Easy MySQL Replication Topology Management
Pseudo GTID and Easy MySQL Replication Topology ManagementPseudo GTID and Easy MySQL Replication Topology Management
Pseudo GTID and Easy MySQL Replication Topology Management
 
PostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesPostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major Features
 
The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...
The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...
The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Yahoo: Experiences with MySQL GTID and Multi Threaded Replication

  • 1. Yahoo Case Study: MySQL GTIDs and Parallel or Multithreaded Replication PRESENTED BY Stacy Yuan, Yashada Jadhav October 2015
  • 2. About Yahoo ▪  Yahoo is focused on making the world’s daily habits inspiring and entertaining. ▪  By creating highly personalized experiences for our users, we keep people connected to what matters most to them, across devices and around the world. ▪  In turn, we create value for advertisers by connecting them with the audiences that build their businesses ▪  More than 1B monthly active users across Yahoo and Tumblr ▪  More than 575M mobile monthly active users across Yahoo and Tumblr
  • 3. Ad Products Team Mission Statement: Delivering scalable and cost efficient data services through innovation and automation powering Yahoo Products ▪  Thousands of Production Servers ▪  OLTP systems & Data marts ▪  Database Design and Architecture ▪  Capacity Planning and Performance Reviews ▪  24x7 Monitoring and Operational Support
  • 4. MySQL at Yahoo ▪  MySQL powers many mission-critical products within Advertising and User space across Desktop and Mobile ▪  Multiple production configurations based on product requirement ▪  Yahoo Sports, Daily Fantasy: Mobile friendly ▪  Flickr: Sharded across thousands of servers ▪  DBaaS setup for multiple products ▪  Hot:Hot, Hot:Warm Configurations ▪  Versions range from Percona Server 5.5 to 5.6 including Percona XtraDB Cluster ▪  Operating systems running customized RHEL 6.x
  • 5. About Stacy ▪  14 years of experience on various flavors of relational databases. ▪  Focus on performance tuning, code reviews, database deployment and infrastructure management for MySQL ▪  In her spare time, she enjoys reading books and doing some volunteer work.
  • 6. About Yashada ▪  MySQL DevOps Engineer with a background in database design and performance tuning. ▪  4+ years of experience on various flavors of relational databases. ▪  Special Skills - Fluency in Sarcasm
  • 7. What are the next 45 minutes about? •  GTID Replication ● Advantages and Disadvantages ● Performance when compared to regular replication ▪  Multi threaded slaves ●  Why do we want MTS? ●  MTS vs single threaded replication - Performance tests ▪  Rolling out GTID and MTS to a live system with no downtime ▪  GTID and MTS in Production ●  Operational issues ●  Monitoring and HA ●  Backups using xtrabackup
  • 8. Why go for GTID and MTS ▪  Slave promotion becomes easier with a global transaction ID ▪  Multitenant database systems suffer from problems like resource contention due to bad queries, batch jobs etc. that affect replication. ▪  MTS without GTID - replication co-ordinates might no longer be accurate due to multiple parallel worker threads. ▪  MTS with GTID
  • 10. File-based Replication Enables data from one MySQL database server (the master) to be replicated to one or more MySQL database servers (the slaves) through MySQL log file and its position ▪  Have replication user, binlog is enabled ▪  Have a copy of master database ▪  Connect to master through master_host, port, replication user, master log file and its position. ▪  Each slave pulls the data from the master, and execute the events to the slave.
  • 11. GTID Replication A global transaction identifier (GTID) is a unique identifier created and associated with each transaction committed on the server of origin (master). GTID is unique not only to the server on which it originated, but is unique across all servers in a given replication setup. GTID = source_id:transaction_id ▪  The source_id identifies the originating server. ▪  The transaction_id is a sequence number determined by the order in which the transaction was committed on this server. Example: ▪  5c7401d3-3623-11e5-ae8c-78e7d15fd641:1-13476
  • 12. GTID Replication Advantage ▪  Replication topology is easy to change - binlog file name and position are not required any more instead we use master_auto_position=1 ▪  Failover is simplified ▪  Increase performance in relay slave - set sync_binlog=0 ▪  Managing multi-tiered replication is easier Master_log_file=‘mysql-bin.***’ Master_log_pos=**** master_auto_position=1
  • 13. Replication Failover Comparison Regular Rep Failover If S1 is bad, S4 S5 need to be rebuilt. M M GTID Rep Failover Redirect S4 to M S2 S3 S1 S4 S5 S2 S1 S3 S4 S5
  • 14. GTID Replication Limitations ▪  GTID does not provide replication monitoring ▪  SQL_SKIP_SLAVE_COUNTER does not work ▪  Can not force the database to start replication from specific position
  • 15. GTIDs Replication Caveats ▪  Updates involving non-transactional storage engines. ▪  CREATE TABLE ... SELECT statements is not supported. ▪  Temporary table is not supported inside a transaction To prevent GTID-based replication to fail: enforce-gtid-consistency
  • 16. Replication Performance GTID vs Regular Rep In terms of performance, GTID is almost same as regular replication. It is slightly slower. The reasons could be - ▪  GTIDs write more lines into binary log - information about GTID ▪  GTID performs additional checks for transactions
  • 21. Single threaded replication ▪ Applications multi-threaded parallel write into master ▪ Replication from master to slave is single-threaded, it becomes bottleneck in a busy system. Master Slave
  • 22. Multi-Threaded Slaves (MTS) ▪  Coordinator thread on slave dispatches work across several worker threads ▪  Each worker thread commit transaction individually. ▪  Multiple active schemas/databases can take advantage of parallel replication Master Slave
  • 23. MTS Prerequisites ▪  MySQL 5.6 above ▪  Transactions are independently based on different databases. ▪  Multitenant databases is the best to enable MTS ▪  N databases, use N parallel workers slave_parallel_workers = N ▪  Example: 3 databases in MySQL, better to set slave_parallel_workers =3 Master db1, db2, db3 Slave db1, db2, db3
  • 24. Configure MTS ▪  STOP SLAVE; ▪  SET GLOBAL slave_parallel_workers=3; ▪  START SLAVE;
  • 25. MTS Execution Gaps and Checkpoint ▪  Events are no longer guaranteed to be consecutive ▪  Execution gaps are tracked ▪  Checkpoints are performed from time to time Check settings slave_checkpoint_period default 300 ms slave_checkpoint_group default 512 trx ▪  Exec_Master_Log_Pos shows the latest checkpoint and not latest transaction ▪  How to fix execution gaps - STOP SLAVE; START SLAVE UNTIL SQL_AFTER_MTS_GAPS
  • 26. Convert MTS to Single-threaded ▪  Run MTS until no more gaps are found in the relay log ▪  Stop Replication ▪  Configure single threaded slave ▪  Start single threaded slave START SLAVE UNTIL SQL_AFTER_MTS_GAPS; SET @@GLOBAL.slave_parallel_workers = 0; START SLAVE;
  • 27. MTS Advantages and Limitations Advantages: ▪  Take advantage of multi-core servers ▪  Changes to each schema applied and committed independently by worker threads ▪  Smaller risk of data loss Limitations: ▪  START SLAVE UNTIL no longer support ▪  Foreign Keys cross-referencing DBs will disable MTS ▪  No implicit transaction retry after transient failure
  • 28. MTS Caveats ▪  Enforcing foreign key relationships between tables in different databases causes MTS to use sequential mode which can have negative impact on performance ▪  Single database replication, it slows down the replication performance
  • 29. MTS without GTID ▪  Exec_Master_Log_Pos in SHOW SLAVE STATUS is misleading. ▪  Skipping replication errors with SQL_SLAVE_SKIP_COUNTER=1 is dangerous ▪  Backup from slave, either mysqldump and xtrabackup might not get right position GTID comes to the rescue
  • 30. Performance Testing - GTID with MTS Setup Test scenario: ▪  one master, ▪  two slaves (one is single-threaded replication, another slave is multi- threaded replication both using GTID Master Slave1 Slave2 GTID Rep MTS GTID Rep
  • 32. Replication Performance Comparison QPS is increased about 3 or 4 times Load, CPU, and Writes per second are increased as well
  • 34. GTID with MTS enabled: Things to watch out for ▪  Exec_Master_Log_Pos is no longer reliable ▪  Executed_Gtid_Set is the reliable ▪  SQL_SLAVE_SKIP_COUNTER no longer works ▪  START SLAVE UNTIL is not supported ▪  Slave_transaction_retries is treated as 0, and can not be changed.
  • 35. MySQL57 GA ▪  Parallel replication improvement Slave can apply transaction in parallel with single database/schema with --slave-parallel- type=LOGICAL_CLOCK. ▪  GTID improvements: ●  Automatically tracks the replication position in replication stream. ●  Enable/disable GTID can be online without MySQL restart
  • 36. MySQL57 SLAVE_PARALLEL_TYPE STUDY Master  :  slave-­‐parallel-­‐type   DATABASE   LOGICAL_CLOCK   Master  generated  binary  logs(MB)   3924   3690   read/write  requests   18704820   17587168   read/write  requests/per  sec   20783.1   19541.25   response  Sme  AVG  ms   1.54   1.64   95  percenSle   2.21   2.36   15  mins  work   81   38   Slave  QPS   4614.648   9466.198  
  • 37. Rolling out GTID and MTS to production
  • 38. Online Rollout GTID with MTS in Percona Server ▪  MySQL56 requires downtime to enable GTID, it is not acceptable ▪  With Percona server 5.6, with almost no downtime The variable GTID_DEPLOYMENT_STEP plays an important role
  • 39. Database Servers Setup Dual masters setup ▪ Masters setup cross different colos. ▪ Each master carries one slave DNS Prod master BCP master Prod slave BCP slave
  • 40. Enable GTID without downtime Enable GTID in BCP side 1. Make sure BCP master and BCP slave are sync 2. Stop mysqld in BCP master and BCP slave, add gtid_deployment_step=on, gtid_mode=ON, enforce-gtid-consistency into my.cnf Restart mysqld in both servers. 3. Replication from prod master to BCP master is good. DNS Prod master BCP master GTID_deployme nt_step=on Prod slave BCP slave GTID_deployme nt_step=on
  • 41. Enable GTID without downtime Promote BCP master to Prod master 4. Prod master: set global read_only=on 5. BCP master: set global gtid_deployment_step = off; set global read_only=off; 6. The replication from BCP master to Prod master is broken. DNS Prod master BCP master GTID_deployme nt_step=off Prod slave BCP slave GTID_deployme nt_step=on
  • 42. Enable GTID without downtime Enable GTID in Prod master 7. Enable GTID on old prod master and prod slave 8. Fix replication from BCP master to prod master CHANGE MASTER TO MASTER_AUTO_POSITION = 1; START SLAVE; 9. Enable GTID replication from Prod master to BCP master 10. Enable MTS in all servers stop slave; set global slave_parallel_workers=16; start slave; DNS Prod master GTID enabled BCP master GTID_deployme nt_step=off Prod slave GTID enabled BCP slave GTID_deployme nt_step=on
  • 43. Enable GTID without downtime Switch back 10. Perform switchover in Prod master Disable gtid_deployment_step across all servers. DNS Prod master GTID enabled BCP master GTID_deployme nt_step=off Prod slave GTID enabled BCP slave GTID_deployme nt_step=off
  • 44. Switchover Steps     •  Enable global read_only=on in prod master •  Sanity check to make sure BCP master catch up its master (WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS) •  Disable read_only in BCP master. BCP master becomes prod master Failover: •  If prod master is unreachable, it will be failover without step 1 and 2.  
  • 45. GTID and MTS in Production : MySQL Ops
  • 46. GTID and MTS in production : What did we learn? ▪  Errant Transactions ▪  Replication Monitoring ▪  Building slaves using xtrabackup
  • 47. Errant Transaction The errant transactions are: They are only executed in slaves. ▪  Could result from a mistake ▪  Could be intentionally by design, such as report tables ▪  Why they cause problem When the slave becomes the master during failover, it exchanges its own set of executed GTIDs, then send any missing transactions to the slaves.
  • 48. Errant Transaction Detection and Fix Detect: GTID_SUBSET(slave-Executed_Gtid_Set, master-Executed_Gtid_Set) If it returns true(1), no errant trx. If it returns false(0), it does have errant trx. Identify:GTID_SUBTRACT(slave-Executed_Gtid_Set, master-Executed_Gtid_Set) It returns the errant GTID. Fix: Inject empty transaction on all other servers or its master. If the transaction must be executed in slave only, use set sql_log_bin=0;
  • 49. Inject Empty Transaction Sql_skip_slave_counter=n no longer works Execute a fake trx with the GTID that you want to skip For example: GTID=68fb0071-299b-11e5-9cd6-78e7d15dbe38:501 STOP SLAVE; SET GTID_NEXT="68fb0071-299b-11e5-9cd6-78e7d15dbe38:501"; BEGIN; COMMIT; SET GTID_NEXT="AUTOMATIC"; START SLAVE; SHOW SLAVE STATUSG # Verification
  • 50. MySQL Replication Monitoring     •  Seconds_Behind_Master A good approximation of how late the slave is only when the slave actively processes updates. If the network is slow or not much updates in the master, this is NOT a good measurement.    
  • 51. MySQL Replication Monitoring at Yahoo ▪  MySQL Health Heartbeat 1. Master generates heartbeat by updating timestamp (last_update) 2. Slave checks the difference between current time and last_update
  • 52. GTID MTS Monitoring Challenge ▪  SHOW SLAVE STATUS ▪  Seconds_Behind_Master is still a good indication of the replication lag ▪  Retrieved_Gtid_Set: List of GTIDs received by the I/O thread, cleared after a server restart ▪  Executed_Gtid_Set: List of GTIDs executed by the SQL thread ▪  Auto_position: 1 if GTID-based replication is enabled ▪  5.7 is using performance_schema
  • 53. Build Slaves Using Xtrabackup ▪  Start Xtrabackup from either master or slave If the backup is taken from the master, Please check the file xtrabackup_binlog_info in the backup folder If the backup is from slave, Please check the file xtrabackup_slave_info $ cat xtrabackup_slave_info SET GLOBAL gtid_purged='ffee1ff8-363f-11e5-af47-9cb654954cac:1-29123533'; CHANGE MASTER TO MASTER_AUTO_POSITION=1
  • 54. Build Slave Using Xtrabackup Enable Replication in Slave Issue mysql> SET GLOBAL gtid_purged='ffee1ff8-363f-11e5-af47-9cb654954cac:1-29123533'; ERROR 1840 (HY000): @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty. How to fix ▪  RESET MASTER; ▪  SET GLOBAL gtid_purged='ffee1ff8-363f-11e5-af47-9cb654954cac:1-29123533’; ▪  CHANGE MASTER TO MASTER_HOST="mastername", master_user='rep_user', master_password='rep_password', MASTER_AUTO_POSITION = 1; ▪  START SLAVE;
  • 55. Build Slave Using Xtrabackup Still issue? mysql> start slave; ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository RESET SLAVE; START SLAVE;
  • 56. Summary ▪  GTID ▪  MTS ▪  GTID with MTS performance comparison ▪  GTID with MTS online rollout ▪  Things to watch out ▪  Rebuild slave
  • 57. We would love to talk more .. mysqlatyahoo.tumblr.com Yashada Jadhav yashada@yahoo-inc.com Stacy Yuan syuan@yahoo-inc.com