Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions canal/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func (c *Canal) runSyncBinlog() error {

// next binlog pos
pos.Pos = ev.Header.LogPos
pos.Timestamp = ev.Header.Timestamp

// new file name received in the fake rotate event
if fakeRotateLogName != "" {
Expand Down
2 changes: 2 additions & 0 deletions mysql/position.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
type Position struct {
Copy link
Collaborator

@lance6716 lance6716 Nov 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this structure represents the binlog position which can starts a position-based replication, so we should not add other fields. Maybe you can add a new interface EventHandlerV2 with OnXID(nextPos mysql.Position, xidEvent *replication.XIDEvent) error.

And please translate the PR description to English so I can refer non-Chinese reviewers.

Name string
Pos uint32

Timestamp uint32 // for canal handler to show delay time
}

func (p Position) Compare(o Position) int {
Expand Down