SlideShare a Scribd company logo
Gtid Concepts ,
Implementation and Challenges
Who am I ?
o Santhinesh Kumar Nagendran
o Currently working as Senior Database
Administrator @ Tesla Inc. Over 12 years
Industry experience in supporting
environments like healthcare, social
networking applications like AOL, IBIBO,
Sify etc. I primarily focus on Database
High availability and DB automations at
large scale.
Agenda
Concepts Implementation
Challenges in
Implementations
and Operations
Concepts
GTID Concepts
v A global transaction identifier (GTID) is a unique identifier created for each
transaction committed on the server. This identifier is unique not only to the server
on which it originated but is unique across all servers in a given replication cluster.
v A GTID is represented as a pair of coordinates, separated by a colon character (:), as
shown here:
v GTID = Server_uuid :transaction_id
Principles of GTID
v auto-skip functionality in GTID ensures that transactions are not applied twice.
v A transaction which has started with a gtid on a server but did not commit or
rollback, any attempt to start a concurrent transaction with the same GTID will
block
Drawbacks of Binlog Positioning
Ø So the bottom-line is setting up a simple slave setup becomes a
complex thing with binlog positioning if you don’t have the backup from
right source
S1 S2 S3
Ø Getting Master position will be a complicated procedure for
replication topology as below
Ø For an example as below, S denotes Server1/2/3
ü Master position for S2 will be different than the master position for S3
ü The backup with binlog position of S1 cannot be easily used to build S3 as
slave of S2. However, we can still achieve that using below procedure
ü We can still do this by building S3 slave of S1
ü Do an exercise to make S2/S3 to stop at same position
ü Get master status from S2
ü Run change master in S3 with the coordinates collected from S2 in
above step
Benefits of Auto Positioning
Ø Change master with master_auto_position=1 can be run with any host as master in
the cluster and replication will just work fine
Ø Don’t have to deal with the complexity involved for finding the correct position from
the binlog to form the change master statement
Ø Backup from one source can be used to setup replication from any host in the cluster
Ø Master/Slave Failover becomes easy just with one command
Ø Life improvisation for DBAs J
gtid_executed
o Primary Node – Gtids of transactions committed gets updated in gtid_executed
o Secondary/Slave nodes – Stores the latest transaction slave have applied
o From 5.7 and later gtid_executed gets stored in a system table mysql.gtid_executed
gtid_purged
o Primary Node – Gtids of the transactions that mysql has committed and corresponding binary
log has been purged
What sets GTID_PURGED system variable globally ??
Ø When binary logs has been purged manually or as a regular event due to expire_logs_days value
Ø GTID_PURGED can be set explicitly by the below statement . Only prerequisite is the server
should be in read-only mode to not accept any writes when we do reset master.
Ø RESET MASTER;
Ø SET @@GLOBAL.gtid_purged=‘gtid-set’;
Every binlog starts with the previous GTIDs as shown in the example below.
gtid_purged Cont..
Implementation
GTID Implementation
u 5.6
u 5.7
u 8.0
Common parameters
gtid_mode - Will generate GTIDs for all client transactions
enforce_gtid_consistency - Allows only transactionally safe transactions
Transactionally un-safe statements
Before enabling GTID make sure application is not having transactionally
unsafe statements as below. Otherwise this will cause unnecessary
outages.
1. CREATE TABLE ... SELECT statements
2. CREATE TEMPORARY TABLE statements inside transactions
3. Transactions or statements that update both transactional and
nontransactional tables.
Let's take an environment in which [ master – Slave ] are already in synchronize so the gtid enabling
process will be as below
o Set read-only ON on both the servers
o Shutdown MySQL
o Restart both servers with below parameters in the config file along with disable statements not
compatible for GTID-based replication.
[mysqld]
skip-slave-start
read_only = ON
gtid_mode = ON
enforce-gtid-consistency = ON
log-slave-updates = 1
binlog_format = row
log-bin =/mysql/logs/mysql-bin
o Instruct the slave to use the master as the replication data source and to use auto-positioning.
o Change master to master_auto_position=1;
o Take a new xtrabackup or mysqldump or mysqlbackup as the backups taken until this migration are
unusable hereafter
o Start the slave, then disable read-only mode again on primary/master servers, so that it can accept
updates.
Implementation With Downtime
S1 S2
GTID Modes
Gtid modes Functionality
OFF - Master server will not generate any GTIDs for any client connections
- If the Server is a replication slave it will only accept transactions
without GTID
OFF_PERMISSIVE - Servers will not generate any GTIDs for any client connections
- However, If the Server is a replication slave it will accept transactions
with and without GTID
ON_PERMISSIVE - Master server will generate GTIDs for any new client connections
- However, If the Server is a replication slave it will only accept
transactions without GTID
ON - Master server will generate GTIDs for all client connections
- If the Server is a replication slave it will only accept transactions with
GTID
Online Implementation
Let's continue with the same environment with gtid_mode as OFF across the whole cluster.
1. Validate if all the servers are in non-gtid enabled state.
2. Keeping server to not generate GTID for new transactions but it enables servers to
accepts transactions with and without GTID
3. Configure servers to generate GTID for new transactions and retain the forgiving
behavior of accepting transactions with and without GTID
4. Last stage is to enforce servers to generate GTID for new transactions and also accept
transactions only with GTID
Online
Implementation
Cont..
Exact commands to enable GTID transactions:
Prerequisite
q SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY =
WARN;
q If your application queries are suitable for
gtid then you shouldn’t be seeing any errors
in the log
GTID Enabling sequence
1. SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY =
ON;
2. SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE;
3. SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE;
4. SHOW STATUS LIKE
'ONGOING_ANONYMOUS_TRANSACTION_COUNT’;
u make sure all the transactions got replicated
till step 5
5. SET @@GLOBAL.GTID_MODE = ON;
Challenges
Replication Issues [ Very Common ]
Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data
from binary log: 'The slave is connecting using CHANGE MASTER TO
MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing
GTIDs that the slave requires.’
- Master purges the binlog [ accidentally or planned ] before slaves caught up
- Event of failover to a slave and slave might had some local transactions which
other slaves in the cluster might have not been aware of. Example :
- Specific Indexes on slaves to help reads
- Specific users on slaves alone for reporting and read-only purposes
- Specific reporting or analytical data on slave
3 Node Replication Setup
Inconsistency
Scenarios
u Slave 1 / Master will be unaware of
users/properties created @ slave 2
u Slave 2 / Master will be unaware of
users/properties created @ slave 1
u These users might have got created over
the period of time on the slaves for which
the binlogs also might have already got
purged.
u So when failover happens, we would
promote one of the slaves which is most
up to date with the master
u So with the above conditions when we try
to auto-position slave 2 to replicate from
slave 1 where slave 2 is completely
unware of transactions happened on slave
1 and slave 1 also purged the binlogs
associated with such transactions we
would encounter the error I mentioned
above
Challenges
Here are few ways to fix the inconsistency
discussed earlier
u Gtid_purged cannot be set without
RESET MASTER until 8.0
u Any Unplanned or accidental RESET
MASTER on a critical master/slave
will break the whole cluster
u Set GTID purged on the slave [ using
there most recent gtid_executed by
itself ] + [ GTIDs which master has
purged ]
u Find the missing GTIDs on the slave
that is broken
u Skip the GTIDs that slave is looking
for which master has already purged.
NOTE: Beware sql_slave_skip_counter
will not work with GTID based replication
Use Case
Host4 – Master
GTID_PURGED :
0923xxxx-40c2-11e7-915d-0050569ade41:1-173383470,
1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39,
3079xxxx-892a-11e7-bef9-0050569a2e78:1-17,
3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177,
491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450,
8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936,
67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-6426609,
e187xxxx-65f5-11e8-bc96-1866daa373fc:1-19,
3703xxxx-7816-11e8-8db9-000af7ba6042:1-8
Server - Host2
Slave Master - Host1
GTID_EXECUTED :
0923xxxx-40c2-11e7-915d-0050569ade41:1-173383470,
1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39,
3079xxxx-892a-11e7-bef9-0050569a2e78:1-17,
3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177,
491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450,
8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936,
67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-16869434,
e187xxxx-65f5-11e8-bc96-1866daa373fc:1-27
b542xxxx-6079-11e8-9e44-1866daa37e46:1-8142,
Pointing Host2/Host3 to new Master Host4
Host4 – Master
GTID_PURGED :
0923xxxx-40c2-11e7-915d-0050569ade41:1-173383470,
1a02fxxxx-000a-11e8-a2c6-0050569a481a:1-39,
3079xxxx-892a-11e7-bef9-0050569a2e78:1-17,
3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177,
491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450,
8caefxxxx-2f25-11e8-a6fd-1866daa3d37d:1-936,
67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-6426609,
e187xxxx-65f5-11e8-bc96-1866daa373fc:1-19,
3703xxxx-7816-11e8-8db9-000af7ba6042:1-8
Server - Host2
Slave Master - Host1
GTID_EXECUTED :
0923xxxx-40c2-11e7-915d-0050569ade41:1-173383470,
1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39,
3079xxxx-892a-11e7-bef9-0050569a2e78:1-17,
3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177,
491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450,
8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936,
67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-16869434,
e187xxxx-65f5-11e8-bc96-1866daa373fc:1-27
b542xxxx-6079-11e8-9e44-1866daa37e46:1-8142,
Current master - Host1
New Master - Host4
set global gtid_purged="0923xxxx-40c2-11e7-915d-0050569ade41:1-173383470,
1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39,
3079xxxx-892a-11e7-bef9-0050569a2e78:1-17,
3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177,
491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450,
8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936,
67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-16869434,
e187xxxx-65f5-11e8-bc96-1866daa373fc:1-27,
3703xxxx-7816-11e8-8db9-000af7ba6042:1-8";
Pointing Replication to new Master
Run this in Host2
ü stop slave;
ü reset master;
ü set global gtid_purged=“
0923xxxx-40c2-11e7-915d-0050569ade41:1-173383470,
1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39,
3079xxxx-892a-11e7-bef9-0050569a2e78:1-17,
3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177,
491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450,
8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936,
67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-16869434,
e187xxxx-65f5-11e8-bc96-1866daa373fc:1-27,
3703xxxx-7816-11e8-8db9-000af7ba6042:1-8”;
ü change master to master_host=‘host4',master_port=3306,master_auto_position=1;
ü start slave;
Pointing Replication to new Master Cont.
mysql> select gtid_subtract('092311dc-40c2-11e7-915d-
0050569ade41:1-173383470,
'> 1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39,
'> 3079xxxx-892a-11e7-bef9-0050569a2e78:1-17,
'> 3703xxxx-7816-11e8-8db9-000af7ba6042:1-8,
'> 3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177,
'> 491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450,
'> 67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-6426609,
'> 8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936,
'> e187xxxx-65f5-11e8-bc96-1866daa373fc:1-19',
-> '092cxxxx-40c2-11e7-915d-0050569ade41:1-173383470,
'> 1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39,
'> 3079xxxx-892a-11e7-bef9-0050569a2e78:1-17,
'> 3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177,
'> 491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450,
'> 67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-16869434,
'> 8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936,
'> b542xxxx-6079-11e8-9e44-1866daa37e46:1-8142,
'> e187xxxx-65f5-11e8-bc96-1866daa373fc:1-27') as
missing_gtid_set;
+------------------------------------------+
| missing_gtid_set |
+------------------------------------------+
| 3703xxxx-7816-11e8-8db9-000af7ba6042:1-8 |
+------------------------------------------+
1 row in set (0.00 sec)
GTID_SUBTRACT
Empty Transactions
Generate Empty transactions for the missing GTIDs in slave there is a script shared
by percona team on the below reference
SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:1';
BEGIN;COMMIT;
SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:2';
BEGIN;COMMIT;
SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:3';
BEGIN;COMMIT;
SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:4';
BEGIN;COMMIT;
SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:5';
BEGIN;COMMIT;
SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:6';
BEGIN;COMMIT;
SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:7';
BEGIN;COMMIT;
SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:8';
BEGIN;COMMIT;
Reference : https://www.percona.com/blog/2018/07/02/fixing-
er_master_has_purged_required_gtids-when-pointing-a-slave-to-a-different-
master/
mysqlslavetrx
Injecting Single GTIDs set
mysqlslavetrx --gtid-set=3703xxxx-7816-11e8-8db9-000af7ba6042:1-8 --verbose --
slaves=root:password@localhost:3306
WARNING: Using a password on the command line interface can be insecure.
#
# GTID set to be skipped for each server:
# - localhost@3306: 46fdxxxx-5852-11e6-92c9-0800274fb806:1-8
#
# Injecting empty transactions for 'localhost:3306'...
# - 3703xxxx-7816-11e8-8db9-000af7ba6042:1
# - 3703xxxx-7816-11e8-8db9-000af7ba6042:2
# - 3703xxxx-7816-11e8-8db9-000af7ba6042:3
# - 3703xxxx-7816-11e8-8db9-000af7ba6042:4
# - 3703xxxx-7816-11e8-8db9-000af7ba6042:5
# - 3703xxxx-7816-11e8-8db9-000af7ba6042:6
# - 3703xxxx-7816-11e8-8db9-000af7ba6042:7
# - 3703xxxx-7816-11e8-8db9-000af7ba6042:8
#
#...done.
#
Injecting Multiple empty GTIDs sets
mysqlslavetrx --gtid-set=3703xxxx-7816-11e8-8db9-000af7ba6042:9-12,8caexxxx-2f25-
11e8-a6fd-1866daa3d37d:936-945 --verbose --slaves=root:password@localhost:3306
Best way to deal with GTID is by NOT GETTING PANIC at any point of time
1) Collect the show slave status
2) Collect global variables value for gtid_purged and gtid_executed.
3) Gtid_executed has the last position the slave was able to apply correctly
4) Gtid_purged has the [ starting position -1 ]
5) All we need is higher gtid_executed values than gtid_purged
6) gtid_subtract ( master_gtid_purged – slave_gtid_executed ) will give the gtids
missing in slave
7) Generate empty transactions for the gtids missing obtained using gtid_subtract
using mysqlslavetrx as showed before or use a shell script to generate empty
transactions
8) Once empty transactions are loaded start replication. It should fix the issue
9) Don’t do RESET MASTER if you don’t know what else to do instead Call OUT for
help !!!!
10) Use Pt-table-checksum to identify inconsistency between master/Slave.
Is RESET MASTER a Scary Option ? Then what else ?
o GTID is one of The best features in MySQL.
o With the enhancements in MySQL 8.0 which addressed most of the limitations
around setting up gtid_purged at runtime makes its even more powerful to be
implemented
o Enabling and stabilizing the environment for the first time might be a little bit of
task but in long run it would eventually save lots of operation time and efforts
Conclusion
MySQL GTID Concepts, Implementation and troubleshooting

More Related Content

What's hot

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
Jean-François Gagné
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
Altinity Ltd
 
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and OrchestratorAlmost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Jean-François Gagné
 
Planning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera ClusterPlanning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera Cluster
Codership Oy - Creators of Galera Cluster
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼
NeoClova
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
Colin Charles
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxKeepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
NeoClova
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
Codership Oy - Creators of Galera Cluster
 
MySQL Performance Schema in Action
MySQL Performance Schema in ActionMySQL Performance Schema in Action
MySQL Performance Schema in Action
Sveta Smirnova
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient Backups
Mydbops
 
InnoDB Performance Optimisation
InnoDB Performance OptimisationInnoDB Performance Optimisation
InnoDB Performance Optimisation
Mydbops
 
Replication Troubleshooting in Classic VS GTID
Replication Troubleshooting in Classic VS GTIDReplication Troubleshooting in Classic VS GTID
Replication Troubleshooting in Classic VS GTID
Mydbops
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용
I Goo Lee
 
Galera Cluster Best Practices for DBA's and DevOps Part 1
Galera Cluster Best Practices for DBA's and DevOps Part 1Galera Cluster Best Practices for DBA's and DevOps Part 1
Galera Cluster Best Practices for DBA's and DevOps Part 1
Codership Oy - Creators of Galera Cluster
 
Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0
Mydbops
 
MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼
NeoClova
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
MariaDB plc
 
MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016Wagner Bianchi
 
MySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptxMySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptx
NeoClova
 
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Severalnines
 

What's hot (20)

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
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
 
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and OrchestratorAlmost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
 
Planning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera ClusterPlanning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera Cluster
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxKeepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
 
MySQL Performance Schema in Action
MySQL Performance Schema in ActionMySQL Performance Schema in Action
MySQL Performance Schema in Action
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient Backups
 
InnoDB Performance Optimisation
InnoDB Performance OptimisationInnoDB Performance Optimisation
InnoDB Performance Optimisation
 
Replication Troubleshooting in Classic VS GTID
Replication Troubleshooting in Classic VS GTIDReplication Troubleshooting in Classic VS GTID
Replication Troubleshooting in Classic VS GTID
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용
 
Galera Cluster Best Practices for DBA's and DevOps Part 1
Galera Cluster Best Practices for DBA's and DevOps Part 1Galera Cluster Best Practices for DBA's and DevOps Part 1
Galera Cluster Best Practices for DBA's and DevOps Part 1
 
Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0
 
MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
 
MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016
 
MySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptxMySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptx
 
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
 

Similar to MySQL GTID Concepts, Implementation and troubleshooting

Yahoo: Experiences with MySQL GTID and Multi Threaded Replication
Yahoo: Experiences with MySQL GTID and Multi Threaded ReplicationYahoo: Experiences with MySQL GTID and Multi Threaded Replication
Yahoo: Experiences with MySQL GTID and Multi Threaded Replication
Yashada Jadhav
 
Webinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera ClusterWebinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera ClusterSeveralnines
 
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
Jean-François Gagné
 
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
Jean-François Gagné
 
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
 
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
 
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
Mydbops
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
Mydbops
 
Managing and Visualizing your Replication Topologies with Orchestrator
Managing and Visualizing your Replication Topologies with OrchestratorManaging and Visualizing your Replication Topologies with Orchestrator
Managing and Visualizing your Replication Topologies with Orchestrator
Shlomi Noach
 
How Booking.com avoids and deals with replication lag
How Booking.com avoids and deals with replication lagHow Booking.com avoids and deals with replication lag
How Booking.com avoids and deals with replication lag
Jean-François Gagné
 
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
Jean-François Gagné
 
MySQL Timeout Variables Explained
MySQL Timeout Variables Explained MySQL Timeout Variables Explained
MySQL Timeout Variables Explained
Mydbops
 
Running gtid replication in production
Running gtid replication in productionRunning gtid replication in production
Running gtid replication in production
Balazs Pocze
 
Replication skeptic
Replication skepticReplication skeptic
Replication skeptic
Giuseppe Maxia
 
Pseudo gtid & easy replication topology management
Pseudo gtid & easy replication topology managementPseudo gtid & easy replication topology management
Pseudo gtid & easy replication topology management
Shlomi Noach
 
Monitoring with Ganglia
Monitoring with GangliaMonitoring with Ganglia
Monitoring with Ganglia
Fastly
 
Oracle Golden Gate Interview Questions
Oracle Golden Gate Interview QuestionsOracle Golden Gate Interview Questions
Oracle Golden Gate Interview Questions
Arun Sharma
 
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
MariaDB plc
 

Similar to MySQL GTID Concepts, Implementation and troubleshooting (20)

Yahoo: Experiences with MySQL GTID and Multi Threaded Replication
Yahoo: Experiences with MySQL GTID and Multi Threaded ReplicationYahoo: Experiences with MySQL GTID and Multi Threaded Replication
Yahoo: Experiences with MySQL GTID and Multi Threaded Replication
 
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
 
Webinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera ClusterWebinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera Cluster
 
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
 
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
 
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
 
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
 
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
 
Managing and Visualizing your Replication Topologies with Orchestrator
Managing and Visualizing your Replication Topologies with OrchestratorManaging and Visualizing your Replication Topologies with Orchestrator
Managing and Visualizing your Replication Topologies with Orchestrator
 
How Booking.com avoids and deals with replication lag
How Booking.com avoids and deals with replication lagHow Booking.com avoids and deals with replication lag
How Booking.com avoids and deals with replication lag
 
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
 
MySQL Timeout Variables Explained
MySQL Timeout Variables Explained MySQL Timeout Variables Explained
MySQL Timeout Variables Explained
 
MySQL 5.1 Replication
MySQL 5.1 ReplicationMySQL 5.1 Replication
MySQL 5.1 Replication
 
Running gtid replication in production
Running gtid replication in productionRunning gtid replication in production
Running gtid replication in production
 
Replication skeptic
Replication skepticReplication skeptic
Replication skeptic
 
Pseudo gtid & easy replication topology management
Pseudo gtid & easy replication topology managementPseudo gtid & easy replication topology management
Pseudo gtid & easy replication topology management
 
Monitoring with Ganglia
Monitoring with GangliaMonitoring with Ganglia
Monitoring with Ganglia
 
Oracle Golden Gate Interview Questions
Oracle Golden Gate Interview QuestionsOracle Golden Gate Interview Questions
Oracle Golden Gate Interview Questions
 
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
 

More from Mydbops

Efficient MySQL Indexing and what's new in MySQL Explain
Efficient MySQL Indexing and what's new in MySQL ExplainEfficient MySQL Indexing and what's new in MySQL Explain
Efficient MySQL Indexing and what's new in MySQL Explain
Mydbops
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
Mydbops
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
Mydbops
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Mydbops
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mydbops
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Mydbops
 
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
Mydbops
 
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventData-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Mydbops
 
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
Mydbops
 
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Mydbops
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mydbops
 
Data Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLData Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQL
Mydbops
 
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsNavigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Mydbops
 
Data High Availability With TIDB
Data High Availability With TIDBData High Availability With TIDB
Data High Availability With TIDB
Mydbops
 
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mydbops
 
Enhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesEnhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificates
Mydbops
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops
Mydbops
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops
Mydbops
 
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsTiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
Mydbops
 
Achieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLAchieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQL
Mydbops
 

More from Mydbops (20)

Efficient MySQL Indexing and what's new in MySQL Explain
Efficient MySQL Indexing and what's new in MySQL ExplainEfficient MySQL Indexing and what's new in MySQL Explain
Efficient MySQL Indexing and what's new in MySQL Explain
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
 
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
 
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventData-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
 
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
 
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
 
Data Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLData Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQL
 
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsNavigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
 
Data High Availability With TIDB
Data High Availability With TIDBData High Availability With TIDB
Data High Availability With TIDB
 
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
 
Enhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesEnhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificates
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops
 
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsTiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
 
Achieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLAchieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQL
 

Recently uploaded

急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
VivekSinghShekhawat2
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 

Recently uploaded (20)

急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 

MySQL GTID Concepts, Implementation and troubleshooting

  • 2. Who am I ? o Santhinesh Kumar Nagendran o Currently working as Senior Database Administrator @ Tesla Inc. Over 12 years Industry experience in supporting environments like healthcare, social networking applications like AOL, IBIBO, Sify etc. I primarily focus on Database High availability and DB automations at large scale.
  • 5. GTID Concepts v A global transaction identifier (GTID) is a unique identifier created for each transaction committed on the server. This identifier is unique not only to the server on which it originated but is unique across all servers in a given replication cluster. v A GTID is represented as a pair of coordinates, separated by a colon character (:), as shown here: v GTID = Server_uuid :transaction_id Principles of GTID v auto-skip functionality in GTID ensures that transactions are not applied twice. v A transaction which has started with a gtid on a server but did not commit or rollback, any attempt to start a concurrent transaction with the same GTID will block
  • 6. Drawbacks of Binlog Positioning Ø So the bottom-line is setting up a simple slave setup becomes a complex thing with binlog positioning if you don’t have the backup from right source S1 S2 S3 Ø Getting Master position will be a complicated procedure for replication topology as below Ø For an example as below, S denotes Server1/2/3 ü Master position for S2 will be different than the master position for S3 ü The backup with binlog position of S1 cannot be easily used to build S3 as slave of S2. However, we can still achieve that using below procedure ü We can still do this by building S3 slave of S1 ü Do an exercise to make S2/S3 to stop at same position ü Get master status from S2 ü Run change master in S3 with the coordinates collected from S2 in above step
  • 7. Benefits of Auto Positioning Ø Change master with master_auto_position=1 can be run with any host as master in the cluster and replication will just work fine Ø Don’t have to deal with the complexity involved for finding the correct position from the binlog to form the change master statement Ø Backup from one source can be used to setup replication from any host in the cluster Ø Master/Slave Failover becomes easy just with one command Ø Life improvisation for DBAs J
  • 8. gtid_executed o Primary Node – Gtids of transactions committed gets updated in gtid_executed o Secondary/Slave nodes – Stores the latest transaction slave have applied o From 5.7 and later gtid_executed gets stored in a system table mysql.gtid_executed
  • 9. gtid_purged o Primary Node – Gtids of the transactions that mysql has committed and corresponding binary log has been purged What sets GTID_PURGED system variable globally ?? Ø When binary logs has been purged manually or as a regular event due to expire_logs_days value Ø GTID_PURGED can be set explicitly by the below statement . Only prerequisite is the server should be in read-only mode to not accept any writes when we do reset master. Ø RESET MASTER; Ø SET @@GLOBAL.gtid_purged=‘gtid-set’; Every binlog starts with the previous GTIDs as shown in the example below.
  • 12. GTID Implementation u 5.6 u 5.7 u 8.0 Common parameters gtid_mode - Will generate GTIDs for all client transactions enforce_gtid_consistency - Allows only transactionally safe transactions
  • 13. Transactionally un-safe statements Before enabling GTID make sure application is not having transactionally unsafe statements as below. Otherwise this will cause unnecessary outages. 1. CREATE TABLE ... SELECT statements 2. CREATE TEMPORARY TABLE statements inside transactions 3. Transactions or statements that update both transactional and nontransactional tables.
  • 14. Let's take an environment in which [ master – Slave ] are already in synchronize so the gtid enabling process will be as below o Set read-only ON on both the servers o Shutdown MySQL o Restart both servers with below parameters in the config file along with disable statements not compatible for GTID-based replication. [mysqld] skip-slave-start read_only = ON gtid_mode = ON enforce-gtid-consistency = ON log-slave-updates = 1 binlog_format = row log-bin =/mysql/logs/mysql-bin o Instruct the slave to use the master as the replication data source and to use auto-positioning. o Change master to master_auto_position=1; o Take a new xtrabackup or mysqldump or mysqlbackup as the backups taken until this migration are unusable hereafter o Start the slave, then disable read-only mode again on primary/master servers, so that it can accept updates. Implementation With Downtime S1 S2
  • 15. GTID Modes Gtid modes Functionality OFF - Master server will not generate any GTIDs for any client connections - If the Server is a replication slave it will only accept transactions without GTID OFF_PERMISSIVE - Servers will not generate any GTIDs for any client connections - However, If the Server is a replication slave it will accept transactions with and without GTID ON_PERMISSIVE - Master server will generate GTIDs for any new client connections - However, If the Server is a replication slave it will only accept transactions without GTID ON - Master server will generate GTIDs for all client connections - If the Server is a replication slave it will only accept transactions with GTID
  • 16. Online Implementation Let's continue with the same environment with gtid_mode as OFF across the whole cluster. 1. Validate if all the servers are in non-gtid enabled state. 2. Keeping server to not generate GTID for new transactions but it enables servers to accepts transactions with and without GTID 3. Configure servers to generate GTID for new transactions and retain the forgiving behavior of accepting transactions with and without GTID 4. Last stage is to enforce servers to generate GTID for new transactions and also accept transactions only with GTID
  • 17. Online Implementation Cont.. Exact commands to enable GTID transactions: Prerequisite q SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = WARN; q If your application queries are suitable for gtid then you shouldn’t be seeing any errors in the log GTID Enabling sequence 1. SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = ON; 2. SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE; 3. SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE; 4. SHOW STATUS LIKE 'ONGOING_ANONYMOUS_TRANSACTION_COUNT’; u make sure all the transactions got replicated till step 5 5. SET @@GLOBAL.GTID_MODE = ON;
  • 19. Replication Issues [ Very Common ] Last_IO_Errno: 1236 Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.’ - Master purges the binlog [ accidentally or planned ] before slaves caught up - Event of failover to a slave and slave might had some local transactions which other slaves in the cluster might have not been aware of. Example : - Specific Indexes on slaves to help reads - Specific users on slaves alone for reporting and read-only purposes - Specific reporting or analytical data on slave
  • 21. Inconsistency Scenarios u Slave 1 / Master will be unaware of users/properties created @ slave 2 u Slave 2 / Master will be unaware of users/properties created @ slave 1 u These users might have got created over the period of time on the slaves for which the binlogs also might have already got purged. u So when failover happens, we would promote one of the slaves which is most up to date with the master u So with the above conditions when we try to auto-position slave 2 to replicate from slave 1 where slave 2 is completely unware of transactions happened on slave 1 and slave 1 also purged the binlogs associated with such transactions we would encounter the error I mentioned above
  • 22. Challenges Here are few ways to fix the inconsistency discussed earlier u Gtid_purged cannot be set without RESET MASTER until 8.0 u Any Unplanned or accidental RESET MASTER on a critical master/slave will break the whole cluster u Set GTID purged on the slave [ using there most recent gtid_executed by itself ] + [ GTIDs which master has purged ] u Find the missing GTIDs on the slave that is broken u Skip the GTIDs that slave is looking for which master has already purged. NOTE: Beware sql_slave_skip_counter will not work with GTID based replication
  • 24. Host4 – Master GTID_PURGED : 0923xxxx-40c2-11e7-915d-0050569ade41:1-173383470, 1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39, 3079xxxx-892a-11e7-bef9-0050569a2e78:1-17, 3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177, 491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450, 8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936, 67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-6426609, e187xxxx-65f5-11e8-bc96-1866daa373fc:1-19, 3703xxxx-7816-11e8-8db9-000af7ba6042:1-8 Server - Host2 Slave Master - Host1 GTID_EXECUTED : 0923xxxx-40c2-11e7-915d-0050569ade41:1-173383470, 1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39, 3079xxxx-892a-11e7-bef9-0050569a2e78:1-17, 3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177, 491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450, 8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936, 67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-16869434, e187xxxx-65f5-11e8-bc96-1866daa373fc:1-27 b542xxxx-6079-11e8-9e44-1866daa37e46:1-8142, Pointing Host2/Host3 to new Master Host4
  • 25. Host4 – Master GTID_PURGED : 0923xxxx-40c2-11e7-915d-0050569ade41:1-173383470, 1a02fxxxx-000a-11e8-a2c6-0050569a481a:1-39, 3079xxxx-892a-11e7-bef9-0050569a2e78:1-17, 3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177, 491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450, 8caefxxxx-2f25-11e8-a6fd-1866daa3d37d:1-936, 67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-6426609, e187xxxx-65f5-11e8-bc96-1866daa373fc:1-19, 3703xxxx-7816-11e8-8db9-000af7ba6042:1-8 Server - Host2 Slave Master - Host1 GTID_EXECUTED : 0923xxxx-40c2-11e7-915d-0050569ade41:1-173383470, 1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39, 3079xxxx-892a-11e7-bef9-0050569a2e78:1-17, 3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177, 491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450, 8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936, 67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-16869434, e187xxxx-65f5-11e8-bc96-1866daa373fc:1-27 b542xxxx-6079-11e8-9e44-1866daa37e46:1-8142, Current master - Host1 New Master - Host4 set global gtid_purged="0923xxxx-40c2-11e7-915d-0050569ade41:1-173383470, 1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39, 3079xxxx-892a-11e7-bef9-0050569a2e78:1-17, 3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177, 491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450, 8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936, 67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-16869434, e187xxxx-65f5-11e8-bc96-1866daa373fc:1-27, 3703xxxx-7816-11e8-8db9-000af7ba6042:1-8"; Pointing Replication to new Master
  • 26. Run this in Host2 ü stop slave; ü reset master; ü set global gtid_purged=“ 0923xxxx-40c2-11e7-915d-0050569ade41:1-173383470, 1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39, 3079xxxx-892a-11e7-bef9-0050569a2e78:1-17, 3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177, 491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450, 8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936, 67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-16869434, e187xxxx-65f5-11e8-bc96-1866daa373fc:1-27, 3703xxxx-7816-11e8-8db9-000af7ba6042:1-8”; ü change master to master_host=‘host4',master_port=3306,master_auto_position=1; ü start slave; Pointing Replication to new Master Cont.
  • 27. mysql> select gtid_subtract('092311dc-40c2-11e7-915d- 0050569ade41:1-173383470, '> 1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39, '> 3079xxxx-892a-11e7-bef9-0050569a2e78:1-17, '> 3703xxxx-7816-11e8-8db9-000af7ba6042:1-8, '> 3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177, '> 491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450, '> 67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-6426609, '> 8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936, '> e187xxxx-65f5-11e8-bc96-1866daa373fc:1-19', -> '092cxxxx-40c2-11e7-915d-0050569ade41:1-173383470, '> 1a02xxxx-000a-11e8-a2c6-0050569a481a:1-39, '> 3079xxxx-892a-11e7-bef9-0050569a2e78:1-17, '> 3f90xxxx-fd7f-11e7-b787-0050569a4168:1-201198177, '> 491axxxx-136e-11e8-b54d-000af7ba704a:1-1351372450, '> 67a8xxxx-5a5d-11e8-b3f2-000af7ba4704:1-16869434, '> 8caexxxx-2f25-11e8-a6fd-1866daa3d37d:1-936, '> b542xxxx-6079-11e8-9e44-1866daa37e46:1-8142, '> e187xxxx-65f5-11e8-bc96-1866daa373fc:1-27') as missing_gtid_set; +------------------------------------------+ | missing_gtid_set | +------------------------------------------+ | 3703xxxx-7816-11e8-8db9-000af7ba6042:1-8 | +------------------------------------------+ 1 row in set (0.00 sec) GTID_SUBTRACT
  • 28. Empty Transactions Generate Empty transactions for the missing GTIDs in slave there is a script shared by percona team on the below reference SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:1'; BEGIN;COMMIT; SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:2'; BEGIN;COMMIT; SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:3'; BEGIN;COMMIT; SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:4'; BEGIN;COMMIT; SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:5'; BEGIN;COMMIT; SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:6'; BEGIN;COMMIT; SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:7'; BEGIN;COMMIT; SET GTID_NEXT='3703xxxx-7816-11e8-8db9-000af7ba6042:8'; BEGIN;COMMIT; Reference : https://www.percona.com/blog/2018/07/02/fixing- er_master_has_purged_required_gtids-when-pointing-a-slave-to-a-different- master/
  • 29. mysqlslavetrx Injecting Single GTIDs set mysqlslavetrx --gtid-set=3703xxxx-7816-11e8-8db9-000af7ba6042:1-8 --verbose -- slaves=root:password@localhost:3306 WARNING: Using a password on the command line interface can be insecure. # # GTID set to be skipped for each server: # - localhost@3306: 46fdxxxx-5852-11e6-92c9-0800274fb806:1-8 # # Injecting empty transactions for 'localhost:3306'... # - 3703xxxx-7816-11e8-8db9-000af7ba6042:1 # - 3703xxxx-7816-11e8-8db9-000af7ba6042:2 # - 3703xxxx-7816-11e8-8db9-000af7ba6042:3 # - 3703xxxx-7816-11e8-8db9-000af7ba6042:4 # - 3703xxxx-7816-11e8-8db9-000af7ba6042:5 # - 3703xxxx-7816-11e8-8db9-000af7ba6042:6 # - 3703xxxx-7816-11e8-8db9-000af7ba6042:7 # - 3703xxxx-7816-11e8-8db9-000af7ba6042:8 # #...done. # Injecting Multiple empty GTIDs sets mysqlslavetrx --gtid-set=3703xxxx-7816-11e8-8db9-000af7ba6042:9-12,8caexxxx-2f25- 11e8-a6fd-1866daa3d37d:936-945 --verbose --slaves=root:password@localhost:3306
  • 30. Best way to deal with GTID is by NOT GETTING PANIC at any point of time 1) Collect the show slave status 2) Collect global variables value for gtid_purged and gtid_executed. 3) Gtid_executed has the last position the slave was able to apply correctly 4) Gtid_purged has the [ starting position -1 ] 5) All we need is higher gtid_executed values than gtid_purged 6) gtid_subtract ( master_gtid_purged – slave_gtid_executed ) will give the gtids missing in slave 7) Generate empty transactions for the gtids missing obtained using gtid_subtract using mysqlslavetrx as showed before or use a shell script to generate empty transactions 8) Once empty transactions are loaded start replication. It should fix the issue 9) Don’t do RESET MASTER if you don’t know what else to do instead Call OUT for help !!!! 10) Use Pt-table-checksum to identify inconsistency between master/Slave. Is RESET MASTER a Scary Option ? Then what else ?
  • 31. o GTID is one of The best features in MySQL. o With the enhancements in MySQL 8.0 which addressed most of the limitations around setting up gtid_purged at runtime makes its even more powerful to be implemented o Enabling and stabilizing the environment for the first time might be a little bit of task but in long run it would eventually save lots of operation time and efforts Conclusion