From be7b835c5c81acd401f5161b0d9cd1dcffa9148d Mon Sep 17 00:00:00 2001 From: amyangfei Date: Thu, 22 Oct 2020 20:04:07 +0800 Subject: [PATCH] cherry pick #1017 to release-4.0 Signed-off-by: ti-srebot --- cdc/processor.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cdc/processor.go b/cdc/processor.go index 10d813f8f0c..dd125b768a7 100644 --- a/cdc/processor.go +++ b/cdc/processor.go @@ -551,8 +551,11 @@ func (p *processor) flushTaskStatusAndPosition(ctx context.Context) error { for _, tableID := range tablesToRemove { p.removeTable(tableID) } - p.statusModRevision = newModRevision - p.status = newTaskStatus + // newModRevision == 0 means status is not updated + if newModRevision > 0 { + p.statusModRevision = newModRevision + p.status = newTaskStatus + } syncTableNumGauge. WithLabelValues(p.changefeedID, p.captureInfo.AdvertiseAddr). Set(float64(len(p.status.Tables)))