In-depth understanding of MySQL 5.7 GTID series (1) and mysqlgtid
Author:Gao Peng (Eight monsters in Chongqing)
Original article address:
Http://www.jianshu.com/p/87f66cdeb49c
A total of 10 articles will be published this time. The source code version used in this article is percona 5.7.14, and the source code versions 5.7.17 and 5.6.25 have been compared. Currently, all MySQL source code versions are unavailable, if any, please forgive me.
The GTID feature of MySQL is a powerful feature added by MySQL 5.6. It aims to use GTID for MySQL to automatically switch over in the entire replication environment, rather than specifying files and locations as before, this must be the future direction. The well-known MGR is also based on GTID, so it is necessary to understand the principle of GTID.
GTID maintenance is completely automatic, but there are indeed many pitfalls in actual use, and many friends still feel afraid of GTID, this series of articles will analyze the source code of the GTID module, give a summary, and then conduct a comprehensive analysis based on the O & M and case studies. I hope to inspire others who want to know the source code, however, limited capabilities, especially the source code. If there are any errors, please point out and be able to communicate with each other. If you have any friends who have better cases, you are welcome to discuss them together.
Of course, there is also a reason for leaving such a series. It is better to have a good memory than a bad pen, so it is also a notebook of your own.
1. GTID transaction Lifecycle
GTID is calledGlobal transaction identifierIt is completely unique in the entire replication ecosystem. Next we will explain its entire lifecycle through a diagram. Suppose we haveMaster> slaveTo generate a GTID89dfa8a4-cb13-11e6-b504-000c29a879a3: 1GTID transaction, because the name is too long, I simplified it879a3: 1
We can see that the GTID Number of the entire transaction has not changed throughout the lifecycle, whether in the master database or slave database89dfa8a4-cb13-11e6-b504-000c29a879a3: 1, Which is also why it is called Global.
Ii. What content does this series of articles contain?
This series of articles is divided into ten sections:
In-depth understanding of MySQL 5.7 GTID series (1): Introduction
In-depth understanding of MySQL 5.7 GTID series (II): GTID-related internal data structures
In-depth understanding of MySQL 5.7 GTID series (III): generation time of GTID and Last_commt/sequnce_number
In-depth understanding of MySQL 5.7 GTID series (iv): Functions of MySQL. GTID_executed tables and changes of Previous GTID events
In-depth understanding of MySQL 5.7 GTID series (v): The timing for changing MySQL. GTID_executed table/GTID_executed variable/GTID_purged variable
In-depth understanding of MySQL 5.7 GTID series (6): MySQL starts to initialize the GTID Module
MySQL 5.7 GTID internal learning (7) summary of the impact of the binlog_GTID_simple_recovery Parameter
MySQL 5.7 GTID internal learning (8) O & M changes brought about by GTID
MySQL 5.7 GTID internal learning (9) Case 1)
MySQL 5.7 GTID internal learning (10) Case 2)
Each section contains a summary and a large number of text descriptions. It is helpful for common O & M DBAs and for DBAs who want to know the source code.
This section is just a guide, hoping to give you a basic understanding of GTID. If you want to continue understanding, please refer to the official documentation.
If you have any questions about this article, scan the QR code to add the original author.
Zhishutang
Ye Jinrong and Wu Bingxi jointly build
Leading IT elite training
Industry senior experts work together to customize
MySQL practice/MySQL optimization/Python/SQL Optimization
Several excellent courses
Follow the Technology Development Trend and regularly optimize training teaching plans
Integrates a large number of production cases to meet Enterprises' first-line needs
Community companion learning, one registration, three courses available
Required Courses for DBA and development engineers
Thousands of students have turned around, doubling their salary and improving their positions
The change happened quietly. What are you waiting?
Scan QR code to downloadPreview Video of zhishutang high-quality courses
(MySQL practice/optimization, Python development, and SQL optimization courses)
Password: hg3h