Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

relay: retry for upstream bad connection #265

Merged
merged 15 commits into from
Sep 3, 2019
Next Next commit
relay: only update GTID for DDL query (and XID)
  • Loading branch information
csuzhangxc committed Sep 2, 2019
commit e856e282f14d8ceb926f7c69cc7260581d964c70
8 changes: 4 additions & 4 deletions relay/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ func (t *transformer) Transform(e *replication.BinlogEvent) Result {
// NOTE: we need to get the first binlog filename from fake RotateEvent when using auto position
case *replication.QueryEvent:
// when RawModeEnabled not true, QueryEvent will be parsed.
// even for `BEGIN`, we still update pos/GTID, but only save GTID for DDL.
result.GTIDSet = ev.GSet
isDDL := common.CheckIsDDL(string(ev.Query), t.parser2)
if isDDL {
if common.CheckIsDDL(string(ev.Query), t.parser2) {
// we only update/save GTID for DDL/XID event
// if the query is something like `BEGIN`, we do not update/save GTID.
result.GTIDSet = ev.GSet
result.CanSaveGTID = true
}
case *replication.XIDEvent:
Expand Down