From 070ddaf4cfaee4e2493edc499ba9a729b8224836 Mon Sep 17 00:00:00 2001 From: gmhdbjd Date: Thu, 10 Dec 2020 18:42:55 +0800 Subject: [PATCH] fix currentLocation not increase in rows event --- syncer/syncer.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/syncer/syncer.go b/syncer/syncer.go index f15419058e..8a330fc3b7 100644 --- a/syncer/syncer.go +++ b/syncer/syncer.go @@ -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 {