- 深入理解MySQL主从原理
- 高鹏
- 92字
- 2025-02-21 07:58:37
1.1.4 GTID的生成
在发起commit命令后,当order commit执行到FLUSH阶段,需要生成GTID Event时,会获取GTID,3.3节将会详细描述它的生成过程。MySQL内部维护了一个全局的GTID计数器next_free_gno,用于生成gno。可以参考Gtid_state::get_automatic_gno函数,部分代码如下。


在发起commit命令后,当order commit执行到FLUSH阶段,需要生成GTID Event时,会获取GTID,3.3节将会详细描述它的生成过程。MySQL内部维护了一个全局的GTID计数器next_free_gno,用于生成gno。可以参考Gtid_state::get_automatic_gno函数,部分代码如下。