Skip to content

Commit 046188b

Browse files
lintanghuisiddontang
authored andcommitted
do not sync persistent store when get a fake position (#397)
* do not sync persistent store when get a fake position
1 parent 8b9c05e commit 046188b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

canal/sync.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ func (c *Canal) runSyncBinlog() error {
5050

5151
// Update the delay between the Canal and the Master before the handler hooks are called
5252
c.updateReplicationDelay(ev)
53-
53+
// if log pos equal zero ,it is a fake rotate event,ignore it.
54+
// see https://github.com/mysql/mysql-server/blob/8cc757da3d87bf4a1f07dcfb2d3c96fed3806870/sql/rpl_binlog_sender.cc#L899
55+
if ev.Header.LogPos == 0 {
56+
continue
57+
}
5458
savePos = false
5559
force = false
5660
pos := c.master.Position()

0 commit comments

Comments
 (0)