Skip to content

Commit 0ad7055

Browse files
committed
crosscluster/logical: zero catchup/initial scan metrics on flow shutdown
Informs #147620 Release note: none
1 parent 075c4bc commit 0ad7055

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/crosscluster/logical/logical_replication_job.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,15 @@ func (r *logicalReplicationResumer) ingest(
321321
return err
322322
}
323323

324+
defer func() {
325+
if l := payload.MetricsLabel; l != "" {
326+
metrics.LabeledScanningRanges.Update(map[string]string{"label": l}, 0)
327+
metrics.LabeledCatchupRanges.Update(map[string]string{"label": l}, 0)
328+
}
329+
metrics.ScanningRanges.Update(0)
330+
metrics.CatchupRanges.Update(0)
331+
}()
332+
324333
err = ctxgroup.GoAndWait(ctx, execPlan, replanner, startHeartbeat)
325334
if errors.Is(err, sql.ErrPlanChanged) {
326335
metrics.ReplanCount.Inc(1)

0 commit comments

Comments
 (0)