MySQL auto-positioning is an integral part of replication with GTID, but it’s neither required nor guaranteed to work. It’s possible to enable GTIDs but disable auto-positioning, and it’s possible that one MySQL instance cannot auto-position on another even when GTIDs are used. The former (GTID on but auto-pos off) is an issue for another time. The latter is the topic of this post: when MySQL GTID auto-positioning fails—and how to fix it.
This title may be suitable for the new age MySQL Users. Because
in 5.7 onwards its already supported to enable GTID online. But
still few of my mission critical databases are in 5.6 and
handling 70k QPS
. So I know enabling GTID needs
downtime for this. But in my case, the GTID has been already
implemented. But still the replication is using Binlog file name
and position for replicating the data.
This is my slave status. You can see the GTID has been enabled
but the Auto_Position
is still 0 which means still
my replication is binlog filename and position. No issues with
the replication. But the MySQL world already moved to GTID for
better control on replication and Failover.
Master_Server_Id: 10010
Master_UUID: c924545b-a3e3-11e8-8a39-42010a280410
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
SQL_Remaining_Delay: NULL …
[Read more]
So MySQL's group replication came out with MySQL 5.7. Now that is
has been out a little while people are starting to ask more about
it.
- https://dev.mysql.com/doc/refman/8.0/en/group-replication.html
- https://dev.mysql.com/doc/refman/8.0/en/group-replication-deploying-in-single-primary-mode.html
Below is an example of how to set this up and a few pain point
examples as I poked around with it.
I am using three different servers,
Server CENTOSA
mysql> INSTALL PLUGIN group_replication SONAME
'group_replication.so';
Query OK, 0 rows affected (0.02 sec)
vi my.cnf
…
Some months ago, Shlomi Noach published a series about Service Discovery. In his posts, Shlomi describes many ways for an application to find the master. He also gives detail on how these solutions cope with failing-over to a slave, including their integration with Orchestrator.
This is a great series, and I recommend its reading for everybody implementing master failover, with or without
This is a follow-up post in the MySQL Master Replication Crash Safety series. In the two previous posts, we explored the consequence of reducing durability on masters (including setting sync_binlog to a value different than 1) when slaves are using legacy file+position replication. In this post, we cover GTID replication. This introduces a new inconsistency scenario with a potential
In a MySQL hosting replication setup, the parameter Seconds_Behind_Master (SBM), as displayed by the SHOW SLAVE STATUS command, is commonly used as an indication of the current replication lag of the slave. In this blog post, we examine how to understand and interpret this value in various situations.
Possible Values of Seconds Behind Master
The value of SBM, as explained in the MySQL documentation, depends on the state of the MySQL slave in general, and the states of MySQL slave SQL_THREAD and IO_THREAD in particular. While IO_THREAD connects with the master and reads the updates, SQL_THREAD applies these updates on the slave. Let’s examine the possible values of SBM during different states of the MySQL Slave.
When SBM Value is Null
- SBM is …
Quickly Add a Node to an InnoDB Cluster or Group Replication (Shutterstock)
In this blog, we’ll look at how to quickly add a node to an InnoDB Cluster or Group Replication using Percona XtraBackup.
Adding nodes to a Group Replication cluster can be easy (documented here), but it only works if the existing nodes have retained all the binary logs since the creation of the cluster. Obviously, this is possible if you create a new cluster from scratch. The nodes rotate old logs after some time, however. Technically, if the
gtid_purged
set is non-empty, it means you will need another method to add a new node to a cluster. You also …
[Read more]MySQL supports replicating to a slave that is one release higher. This allows us to easily upgrade our MySQL setup to a new version, by promoting the slave and pointing the application to it. However, though unsupported, there are times when the MySQL version of slave deployed is one release lower. In this scenario, if your application has been performing much better on an older version of MySQL, you would like to have a convenient option to downgrade. You can simply promote the slave to get the old performance back.
The MySQL manual says that ROW based
replication can be used to replicate to a lower version, provided
that no DDLs replicated are incompatible with the slave. One such
incompatible command is ALTER USER
which is a new
feature in MySQL 5.7 and not available on 5.6. :
ALTER USER …[Read more]
A colleague brought an article to my attention. I did not see it on Planet MySQL where I get most of the MySQL news (or it did not catch my eye there). As it is interesting replication stuff, I think it is important to bring it to the attention of the MySQL Community, so I am writing this short post.
The surprising part for me is that it uses my 4-year-old work for online migration to GTID
This tutorial demands a service restart since some flags here presented can not be dynamically changed
What is GTID and why do I need it? Directly from the MySQL documentation (excerpt taken as
is with different jargons than used here, for
master
/slave
we are using
primary
/replica
):
A global transaction identifier (GTID) is a unique identifier created and associated with each transaction committed on the server of origin (the master). This identifier is unique not only to the server on which it originated, but is unique across all servers in a given replication topology.
GTID assignment distinguishes between client transactions, which are committed on the master, and replicated transactions, which are reproduced on a slave. When a client transaction is committed …
[Read more]