Skip to content

Commit

Permalink
importccl: reload job progress on retry
Browse files Browse the repository at this point in the history
Release note (bug fix): Fix a bug where IMPORT internal retries (ie due
to node failures) may not pick up latest progress updates.
  • Loading branch information
pbardea committed Aug 27, 2021
1 parent 56afa9f commit 30ec5a0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/ccl/importccl/import_stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -2152,9 +2152,21 @@ func ingestWithRetry(
}

if utilccl.IsPermanentBulkJobError(err) {
return roachpb.BulkOpSummary{}, err
return res, err
}

// Re-load the job in order to update our progress object, which may have
// been updated by the changeFrontier processor since the flow started.
reloadedJob, reloadErr := execCtx.ExecCfg().JobRegistry.LoadJob(ctx, job.ID())
if reloadErr != nil {
if ctx.Err() != nil {
return res, ctx.Err()
}
log.Warningf(ctx, `IMPORT job %d could not reload job progress when retrying: %+v`,
int64(job.ID()), reloadErr)
} else {
job = reloadedJob
}
log.Warningf(ctx, `encountered retryable error: %+v`, err)
}

Expand Down

0 comments on commit 30ec5a0

Please sign in to comment.