Original address: http://mysqllover.com/?p=87, excerpt, Memo
The Gtid is called the global transaction identifier, and can be translated as a Globals transaction identifier, and Gtid is created when the transaction commits on the original master. Gtid needs to remain unique in the global primary-standby topology, Gtid consists of two parts:
GTID = source_id:transaction_id source_id is used to indicate the source server, denoted by Server_uuid, which is generated at the first boot and written to the configuration file data/ The transaction_id in AUTO.CNF is determined based on the transaction committed on the source server. A Gtid life cycle includes: 1. The transaction is executed on the main library and committed to the transaction by assigning a gtid (the UUID of the main library and the smallest transaction sequence number not used on that server), the Gtid is written to Binlog. 2. The repository reads the Gtid in the Relaylog and sets the value of the session level Gtid_next to tell the repository that the next transaction must use the value 3. The repository checks to see if the Gtid has been used and recorded in his own binlog. Slave need to guarantee that the previous transaction did not use this gtid, but also to guarantee that the Gtid is read at this time, but the uncommitted transaction is not the same as the use of this Gtid.4. Because Gtid_next is not empty, slave does not generate a new gtid, but instead uses the Gtid obtained from the main library. This guarantees that the same transaction in one replication topology Gtid unchanged. Due to the uniqueness of Gtid in the global, through the Gtid, we can automatically switch to some of the complex replication topology to facilitate the new main library and new repositories, for example, by pointing to a specific gtid to determine the new repository replication coordinates. Of course, there are some restrictions on using Gtid: 1. Updates in transactions contain non-transactional storage engines, which can cause multiple gtid to be assigned to the same transaction. 2. The Create TABLE...SELECT statement is not supported because the statement is split into CREATE table and insert two transactions, and this two transaction is assigned the same gtid, which causes the insert to be ignored by the repository. 3. Create/drop temporary table operation not supported as you can see, support for Gtid replication has some limitations on some statements, and MySQL also provides an option disable-gtid-unsafe-statements to prohibit the execution of these statements. Reference: http://dev.mysql.com/doc/refman/5.6/en/replication-gtids.htmlhttp://dev.mysql.com/doc/refman/5.6/en/ replication-gtids-restrictions.htmlhttp://dev.mysql.com/doc/refman/5.6/En/replication-gtids-concepts.html
Original articles, reproduced please specify: Reproduced from simple life
This article link address: [MySQL5.6 new feature] global transaction identifier (GTID)
[MySQL5.6 new feature] global transaction identifier (GTID)