????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??????????????????о????????????
???????MySQL High Availability???????У???????????????GTID???????????commit?????????????????????gtid???????????gtid??????????λ??????????????????????MySQL???????????????????????????????
???????
????MySQL HA??????????????????????????г????Щ???о??????????Щ???????????go-mysql??????
????????
?????????????????????о???????????????????????????MySQL HA????????????????????????????????????????HA????????facebook??????????????????????facebook????????????????????????????????о??????????????
?????μ?HA???????????GTID?????????????????????????replication???????????????????????GTID???汾MySQL???????????????????????MySQL?????????5.6????????GTID???
?????????fb????????mysqlbinlog???????semi-sync replicationЭ?飬?????go-mysql??replication?????semi-sync replicationЭ?飬???????????MySQL??binlog??????????????檔??????????fb?????????????
????????binlog????????????slave?????????????binlog????event????????????????????slaves?????????????????????????????semi-sync replication????????????MHA????????????????й??????????
??????????????MHA????????????????????????????????????????perl????????????????á?MHA???????????????????????????????飬??????????д????????????????????????zookeeper?????????дagent???
??????????????????????????????HA???????????????????????????????????????????????????ó??????????????????????????:-)