Skip to content

Commit

Permalink
changefeed(ticdc): fix barrier ts set incorrectly cause monitor becom…
Browse files Browse the repository at this point in the history
…e year (#11560) (#11598)

close #11553
  • Loading branch information
ti-chi-bot committed Sep 13, 2024
1 parent 8dee428 commit 0830122
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cdc/owner/changefeed.go
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,6 @@ func (c *changefeed) preflightCheck(captures map[model.CaptureID]*model.CaptureI
// barrierTs is used to control the data that can be flush to downstream.
func (c *changefeed) handleBarrier(ctx cdcContext.Context, barrier *schedulepb.BarrierWithMinTs) error {
barrierTp, barrierTs := c.barriers.Min()
c.metricsChangefeedBarrierTsGauge.Set(float64(oracle.ExtractPhysical(barrierTs)))

// It means:
// 1. All data before the barrierTs was sent to downstream.
// 2. No more data after barrierTs was sent to downstream.
Expand Down Expand Up @@ -998,6 +996,8 @@ func (c *changefeed) handleBarrier(ctx cdcContext.Context, barrier *schedulepb.B
barrier.MinTableBarrierTs = barrierTs
}

// MinTableBarrierTs is always the next barrier that blocking the global resolvedTs.
c.metricsChangefeedBarrierTsGauge.Set(float64(oracle.ExtractPhysical(barrier.MinTableBarrierTs)))
return nil
}

Expand Down

0 comments on commit 0830122

Please sign in to comment.