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,schedule: Annotate context with schedule ID. #69922

Merged
merged 1 commit into from
Sep 8, 2021

Conversation

miretskiy
Copy link
Contributor

@miretskiy miretskiy commented Sep 8, 2021

Annotate context passed to job execution with the schedule ID.

Release Justification: Low danger, observability imporovement; category 4.
Release Notes: None

@miretskiy miretskiy requested review from dt and a team September 8, 2021 13:30
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @dt)

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @dt and @miretskiy)


pkg/ccl/backupccl/schedule_exec.go, line 112 at r2 (raw file):

func invokeBackup(ctx context.Context, backupFn sql.PlanHookRowFn) error {
	resultCh := make(chan tree.Datums) // No need to close

wait, why this change? If an error gets returned from backupFn then the context will be canceled hence No need to close.

@miretskiy miretskiy requested a review from ajwerner September 8, 2021 13:39
Copy link
Contributor Author

@miretskiy miretskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner and @dt)


pkg/ccl/backupccl/schedule_exec.go, line 112 at r2 (raw file):

Previously, ajwerner wrote…

wait, why this change? If an error gets returned from backupFn then the context will be canceled hence No need to close.

I'm not sure the context will be cancelled. This is the context passed from the scheduler, and afaik, it is never cancelled.

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @dt and @miretskiy)


pkg/ccl/backupccl/schedule_exec.go, line 112 at r2 (raw file):

Previously, miretskiy (Yevgeniy Miretskiy) wrote…

I'm not sure the context will be cancelled. This is the context passed from the scheduler, and afaik, it is never cancelled.

Notice the use of ctxgroup. The context passed to the GoCtx functions is canceled once any such function returns an error.

@miretskiy miretskiy requested a review from ajwerner September 8, 2021 14:03
Copy link
Contributor Author

@miretskiy miretskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner and @dt)


pkg/ccl/backupccl/schedule_exec.go, line 112 at r2 (raw file):

Previously, ajwerner wrote…

Notice the use of ctxgroup. The context passed to the GoCtx functions is canceled once any such function returns an error.

Ahh.. You're right. I'll backout this change.

@miretskiy
Copy link
Contributor Author

@ajwerner -- ctxgroup change backed out; keeping ctx annotation change.

@miretskiy miretskiy changed the title jobs,backupcc: Correctly handle scheduled backup invocation errors. jobs,schedule: Annotate context with schedule ID. Sep 8, 2021
Annotate context passed to job execution with the schedule ID.

Release Justification: Low danger, observability imporovement; category 4.
Release Notes: None
@miretskiy
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 8, 2021

Build succeeded:

@craig craig bot merged commit 478a4d8 into cockroachdb:master Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants