Skip to content

Commit fba9c96

Browse files
gleonidsiddontang
authored andcommitted
handle edge condition on recoonect - repeated network errors while parsing same long transaction (go-mysql-org#438)
1 parent e4fc336 commit fba9c96

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

replication/binlogsyncer.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,10 @@ func (b *BinlogSyncer) parseEvent(s *BinlogStreamer, data []byte) error {
761761
prev := b.currGset.Clone()
762762
err := b.currGset.Update(gtid)
763763
if err == nil {
764-
b.prevGset = prev
764+
// right after reconnect we will see same gtid as we saw before, thus currGset will not get changed
765+
if !b.currGset.Equal(prev) {
766+
b.prevGset = prev
767+
}
765768
}
766769
return err
767770
}

0 commit comments

Comments
 (0)