Skip to content

Commit

Permalink
do not sync persistent store when get a fake position (#397)
Browse files Browse the repository at this point in the history
* do not sync persistent store when get a fake position
  • Loading branch information
lintanghui authored and siddontang committed Jul 20, 2019
1 parent 8b9c05e commit 046188b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion canal/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ func (c *Canal) runSyncBinlog() error {

// Update the delay between the Canal and the Master before the handler hooks are called
c.updateReplicationDelay(ev)

// if log pos equal zero ,it is a fake rotate event,ignore it.
// see https://github.com/mysql/mysql-server/blob/8cc757da3d87bf4a1f07dcfb2d3c96fed3806870/sql/rpl_binlog_sender.cc#L899
if ev.Header.LogPos == 0 {
continue
}
savePos = false
force = false
pos := c.master.Position()
Expand Down

0 comments on commit 046188b

Please sign in to comment.