Skip to content

Commit

Permalink
Merge pull request cockroachdb#102632 from cockroachdb/blathers/backp…
Browse files Browse the repository at this point in the history
…ort-release-23.1-102623

release-23.1: changefeedccl: Terminate retries when loosing claim
  • Loading branch information
miretskiy authored Jun 30, 2023
2 parents 845bcfb + 41dfc53 commit 525a9b7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/ccl/changefeedccl/changefeed_stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,8 @@ func (b *changefeedResumer) resumeWithRetries(
}

// All other errors retry.
log.Warningf(ctx, `WARNING: CHANGEFEED job %d encountered retryable error: %v`, jobID, err)
log.Warningf(ctx, `WARNING: CHANGEFEED job %d encountered retryable error: %v (attempt %d)`,
jobID, err, 1+r.CurrentAttempt())
lastRunStatusUpdate = b.setJobRunningStatus(ctx, lastRunStatusUpdate, "retryable error: %s", err)
if metrics, ok := execCfg.JobRegistry.MetricsStruct().Changefeed.(*Metrics); ok {
sli, err := metrics.getSLIMetrics(details.Opts[changefeedbase.OptMetricsScope])
Expand All @@ -1234,8 +1235,11 @@ func (b *changefeedResumer) resumeWithRetries(
// been updated by the changeFrontier processor since the flow started.
reloadedJob, reloadErr := execCfg.JobRegistry.LoadClaimedJob(ctx, jobID)
if reloadErr != nil {
if ctx.Err() != nil {
switch {
case ctx.Err() != nil:
return ctx.Err()
case jobs.HasJobNotFoundError(reloadErr):
return reloadErr
}
log.Warningf(ctx, `CHANGEFEED job %d could not reload job progress; `+
`continuing from last known high-water of %s: %v`,
Expand Down

0 comments on commit 525a9b7

Please sign in to comment.