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

jobs: move span registration to existing calls to in runStateMachine #67661

Closed
ajwerner opened this issue Jul 15, 2021 · 1 comment
Closed

jobs: move span registration to existing calls to in runStateMachine #67661

ajwerner opened this issue Jul 15, 2021 · 1 comment
Labels
A-jobs C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) no-issue-activity X-stale

Comments

@ajwerner
Copy link
Contributor

ajwerner commented Jul 15, 2021

Is your feature request related to a problem? Please describe.

In #65322 we added code to record the trace ID of a job before we run it. This has a somewhat unfortunate side-effect of doing an extra round-trip to update the job row every time we resume a job. We currently already write to the jobs table when we resume the job for the first time. With #44594, we're going to be writing to the jobs table every time we go to run the job. We ought to just plumb the trace ID into the point where we write to the job inside (*Registry).runStateMachine as opposed to having this separate write above it.

cockroach/pkg/jobs/adopt.go

Lines 271 to 278 in 41a58d0

if err := job.Update(ctx, nil /* txn */, func(txn *kv.Txn, md JobMetadata,
ju *JobUpdater) error {
md.Progress.TraceID = span.TraceID()
ju.UpdateProgress(md.Progress)
return nil
}); err != nil {
return err
}

cc @sajjadrizvi @adityamaru

Jira issue: CRDB-8656

@ajwerner ajwerner added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-jobs labels Jul 15, 2021
@github-actions
Copy link

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-jobs C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) no-issue-activity X-stale
Projects
None yet
Development

No branches or pull requests

1 participant