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 <[email protected]>
  • Loading branch information
wlwilliamx authored and ti-chi-bot committed Nov 15, 2024
1 parent 3e411bf commit 89b30f3
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 @@ -73,7 +73,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 @@ -342,6 +341,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 @@ -455,7 +471,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 89b30f3

Please sign in to comment.