From 694fca2463ce627110a2e66c857fc934aec7189d Mon Sep 17 00:00:00 2001 From: 3AceShowHand Date: Wed, 13 Dec 2023 18:10:57 +0800 Subject: [PATCH] refactor ddl puller handle jobs. --- cdc/puller/ddl_puller.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cdc/puller/ddl_puller.go b/cdc/puller/ddl_puller.go index ece08816672..2b55481b80b 100644 --- a/cdc/puller/ddl_puller.go +++ b/cdc/puller/ddl_puller.go @@ -663,6 +663,9 @@ func NewDDLPuller(ctx context.Context, } func (h *ddlPullerImpl) add2Pending(job *timodel.Job) { + if job == nil { + return + } if job.ID == h.lastDDLJobID { log.Warn("ignore duplicated DDL job", zap.String("namespace", h.changefeedID.Namespace), @@ -713,6 +716,7 @@ func (h *ddlPullerImpl) Run(ctx context.Context) error { if entry.CRTs > atomic.LoadUint64(&h.resolvedTS) { atomic.StoreUint64(&h.resolvedTS, entry.CRTs) lastResolvedTsAdvancedTime = cc.Now() + continue } } h.add2Pending(entry.Job)