In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. A GTID will be obtained when the transaction commits, and the GTID will be recorded in the binary log in front of the transaction. If the transaction is not logged in the binary log, it will not get the GTID.
two。 The GTID of the transaction is logged to the binary log as Gtid_log_event, and when the binary log is rotated or the instance is shut down, MySQL flushes the GTID of all transactions that have been written to the binary log to the system table mysql.gtid_executed.
3. After a transaction commits, its GTID is added to a GTID collection in a very short time (note that the process is not atomic), that is, the global system variable gtid_executed, which represents the GTID of all committed transactions. In the replication relationship, it also indicates which transactions have been performed by the slave instance, based on which the master node determines which GTID needs to be sent.
4. When the binary log is sent to the slave node and dumped into the relay log, the slave node reads the GTID and assigns the GTID to the session system variable gtid_next at the session level, which tells the slave node what the GTID of the next transaction is.
5. The slave node confirms that the GTID in the session system variable gtid_next is not occupied, assigns a thread to it, and uses the global system variable gtid_owned (@ @ GLOBAL.gtid_owned) to identify the GTID and the ID of the thread using it. If the GTID is already in use, the transaction is ignored.
6. If this GTID is not used, the slave node plays back the transaction. The slave node uses the GTID in the session system variable gtid_next as the GTID for the transaction instead of regenerating the GTID for it.
7. If the binary log is opened from the node, the GTID will be recorded in the binary log together with the transaction in the form of Gtid_log_event. When the binary log is rotated or the instance is closed, the GTID of all committed transactions is flushed to the system table mysql.gtid_executed (same as 2).
8. If the binary log is not enabled in the slave node, MySQL will play back the transaction and write its GTID directly to the system table mysql.gtid_executed as a transaction, but this is limited to DML statements in MySQL version 5.7. in version 8.0, DDL is fine.
9. When the transaction is played back from the slave node, the change of the global system variable gtid_executed on the slave node is the same as 3.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.