Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: don't ignore job status update errors #22337

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pkg/sql/backfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,7 @@ func (sc *SchemaChanger) backfillIndexes(
if details.ReadAsOf == (hlc.Timestamp{}) {
details.ReadAsOf = txn.OrigTimestamp()
if err := sc.job.WithTxn(txn).SetDetails(ctx, details); err != nil {
log.Warningf(ctx, "failed to store readAsOf on job %v after completing state machine: %v",
sc.job.ID(), err)
return errors.Wrapf(err, "failed to store readAsOf on job %d", *sc.job.ID())
}
}
sc.readAsOf = details.ReadAsOf
Expand Down
3 changes: 1 addition & 2 deletions pkg/sql/schema_changer.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,7 @@ func (sc *SchemaChanger) done(ctx context.Context, isRollback bool) (*sqlbase.De
return nil
}, func(txn *client.Txn) error {
if err := sc.job.WithTxn(txn).Succeeded(ctx, jobs.NoopFn); err != nil {
log.Warningf(ctx, "schema change ignoring error while marking job %d as successful: %+v",
*sc.job.ID(), err)
return errors.Wrapf(err, "failed to mark job %d as as successful", *sc.job.ID())
}

schemaChangeEventType := EventLogFinishSchemaChange
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ func (p *planner) createSchemaChangeJob(
}
job := p.ExecCfg().JobRegistry.NewJob(jobRecord)
if err := job.WithTxn(p.txn).Created(ctx); err != nil {
return sqlbase.InvalidMutationID, nil
return sqlbase.InvalidMutationID, err
}
tableDesc.MutationJobs = append(tableDesc.MutationJobs, sqlbase.TableDescriptor_MutationJob{
MutationID: mutationID, JobID: *job.ID()})
Expand Down