????GTID
??????????????????MySQL 5.6?????????GTID???????uuid:gid??uuid?MySQL server??uuid???????????gid?????????????????id?????????????????????????????????binlog?е????????GTID??????????????????failover??????
??????????????????????b??????????a?????GTID?3E11FA47-71CA-11E1-9E33-C80AA9429562:23????c???3E11FA47-71CA-11E1-9E33-C80AA9429562:15????c????μ?master b????????????GTID?????????????b?е?binlog?????GTID?3E11FA47-71CA-11E1-9E33-C80AA9429562:15???event?????c??????????????event??λ??????????????????binlog?????????????????????Ч?????????????????????2??????filename??position?????????????
????google????????????Global Transaction ID??????????????????????????????Σ?LedisDB??????????·?????failover???????googleò????????????????MariaDB????????
????MariaDB??GTID????MySQL 5.6???????????????????鷳?????????MySQL?????go-mysql???????ζ???д?????????????????GTID??????????????????MariaDB???????ɡ?
????Pseudo GTID
????GTID?????????????????????MySQL 5.6+?????????д?????????????5.6????汾???????????5.5???????Щ????????????????????????5.6??????????????????????????????master binlog??filename???position??
????????????????о?MHA??????????????????????relay log??????????event????????????????????relay log???????MHA???????perl??????????????????????????????????????о???
??????????????????????orchestrator??????????????????????????????????????????Pseudo GTID??????????????????
????create database if not exists meta;
????drop event if exists meta.create_pseudo_gtid_view_event;
????delimiter ;;
????create event if not exists
????meta.create_pseudo_gtid_view_event
????on schedule every 10 second starts current_timestamp
????on completion preserve
????enable
????do
????begin
????set @pseudo_gtid := uuid();
????set @_create_statement := concat('create or replace view meta.pseudo_gtid_view as select /''?? @pseudo_gtid?? '/' as pseudo_gtid_unique_val from dual');
????PREPARE st FROM @_create_statement;
????EXECUTE st;
????DEALLOCATE PREPARE st;
????end
????;;
????delimiter ;
????set global event_scheduler := 1;
????????MySQL???洴???????????????10s???????uuidд?????view???棬????????????binlog?е??????????????????GTID????????λ?????event????????λ?????10s??????????????????????С???????????????????MySQL??binlog???
??????????????????????c????γ???uuid??λ???s1????????b?????????uuid??λ???s2????????ζ???????event?????????£??????????????????????????????c?????binlog event??????????????b?????event?????filename???position????????c??????λ?????????
???????Pseudo GTID???slave??log-slave-update??????????GTID??????????????????о????????????
?????????????????????failover????????????????Pseudo GTID????????
???????MySQL High Availability???????У???????????????GTID???????????commit?????????????????????gtid???????????gtid??????????λ??????????????????????MySQL???????????????????????????????