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

bug-fix: fix currentLocation not increase in rows event #1329

Merged
merged 2 commits into from
Dec 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1549,6 +1549,14 @@ func (s *Syncer) handleRowsEvent(ev *replication.RowsEvent, ec eventContext) err
originSchema, originTable := string(ev.Table.Schema), string(ev.Table.Table)
schemaName, tableName := s.renameShardingSchema(originSchema, originTable)

*ec.currentLocation = binlog.InitLocation(
mysql.Position{
Name: ec.lastLocation.Position.Name,
Pos: ec.header.LogPos,
},
ec.lastLocation.GetGTID(),
)

if ec.shardingReSync != nil {
ec.shardingReSync.currLocation = *ec.currentLocation
if binlog.CompareLocation(ec.shardingReSync.currLocation, ec.shardingReSync.latestLocation, s.cfg.EnableGTID) >= 0 {
Expand Down