Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#11733
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
wlwilliamx authored and ti-chi-bot committed Nov 15, 2024
1 parent 045d670 commit bb4f3cf
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions cdc/puller/ddl_puller.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ type ddlJobPullerImpl struct {
kvStorage tidbkv.Storage
schemaStorage entry.SchemaStorage
resolvedTs uint64
schemaVersion int64
filter filter.Filter
// ddlJobsTable is initialized when receive the first concurrent DDL job.
// It holds the info of table `tidb_ddl_jobs` of upstream TiDB.
Expand Down Expand Up @@ -375,6 +374,23 @@ func (p *ddlJobPullerImpl) handleJob(job *timodel.Job) (skip bool, err error) {
return false, nil
}

<<<<<<< HEAD
=======
if job.BinlogInfo.FinishedTS <= p.getResolvedTs() {
log.Info("ddl job finishedTs less than puller resolvedTs,"+
"discard the ddl job",
zap.String("namespace", p.changefeedID.Namespace),
zap.String("changefeed", p.changefeedID.ID),
zap.String("schema", job.SchemaName),
zap.String("table", job.TableName),
zap.Uint64("startTs", job.StartTS),
zap.Uint64("finishedTs", job.BinlogInfo.FinishedTS),
zap.String("query", job.Query),
zap.Uint64("pullerResolvedTs", p.getResolvedTs()))
return true, nil
}

>>>>>>> b38183b086 (ddl_puller.go(ticdc): fix DDLs are ignored when schema versions are out of order (#11733))
defer func() {
if skip && err == nil {
log.Info("ddl job schema or table does not match, discard it",
Expand Down Expand Up @@ -486,7 +502,6 @@ func (p *ddlJobPullerImpl) handleJob(job *timodel.Job) (skip bool, err error) {
}

p.setResolvedTs(job.BinlogInfo.FinishedTS)
p.schemaVersion = job.BinlogInfo.SchemaVersion

return p.checkIneligibleTableDDL(snap, job)
}
Expand Down

0 comments on commit bb4f3cf

Please sign in to comment.