Skip to content

Commit df2cd65

Browse files
LordofAvernusffffwh
authored and
ffffwh
committed
reduce the number of interactions between MySQL incremental synchronization and consul
1 parent 55cb5c8 commit df2cd65

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/mysql/mysql/applier.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,13 @@ func (a *Applier) Run() {
288288
return
289289
}
290290
a.ai.EntryExecutedHook = func(entry *common.BinlogEntry) {
291-
err = a.storeManager.SaveOracleSCNPos(a.subject, entry.Coordinates.LogPos, entry.Coordinates.LastCommitted)
292-
if err != nil {
293-
a.onError(common.TaskStateDead, errors.Wrap(err, "SaveOracleSCNPos"))
294-
return
291+
if entry.Coordinates.SID == [16]byte{0} {
292+
err = a.storeManager.SaveOracleSCNPos(a.subject, entry.Coordinates.LogPos, entry.Coordinates.LastCommitted)
293+
if err != nil {
294+
a.onError(common.TaskStateDead, errors.Wrap(err, "SaveOracleSCNPos"))
295+
return
296+
}
295297
}
296-
297298
if entry.Final {
298299
a.gtidCh <- &entry.Coordinates
299300
}

0 commit comments

Comments
 (0)