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

bulkio: Fix transaction semantics in job scheduler. #53049

Merged
merged 2 commits into from
Aug 20, 2020

Conversation

miretskiy
Copy link
Contributor

@miretskiy miretskiy commented Aug 19, 2020

Fixes #53033
Fixes #52959

Use transaction when querying for the schedules to run.
In addition, ensure that a single bad schedule does not cause
all of the previous work to be wasted by using transaction savepoints.

Release Notes: None

@miretskiy miretskiy requested a review from dt August 19, 2020 16:18
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@@ -252,8 +254,20 @@ func (s *jobScheduler) executeSchedules(
continue
}

sp, err := txn.CreateSavepoint(ctx)
Copy link
Member

Choose a reason for hiding this comment

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

@knz or @nvanbenschoten can you just double-check we're using the Savepoint API correctly?

Copy link
Contributor

@knz knz 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! 0 of 0 LGTMs obtained (waiting on @nvanbenschoten)


pkg/jobs/job_scheduler.go, line 257 at r1 (raw file):

Previously, dt (David Taylor) wrote…

@knz or @nvanbenschoten can you just double-check we're using the Savepoint API correctly?

looks good

@miretskiy miretskiy force-pushed the scheduler_txn branch 3 times, most recently from c051cdd to 73f7d62 Compare August 20, 2020 16:12
@miretskiy
Copy link
Contributor Author

bors r+

Yevgeniy Miretskiy added 2 commits August 20, 2020 14:30
Fix show jobs delegation code to correclty handle
`FOR SCHEDUL(s)` clause.

Release Notes: None
Use transaction when querying for the schedules to run.
In addition, ensure that a single bad schedule does not cause
all of the previous work to be wasted by using transaction savepoints.

Release Notes: None
@craig
Copy link
Contributor

craig bot commented Aug 20, 2020

Canceled.

@miretskiy
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 20, 2020

Build succeeded:

@craig craig bot merged commit 979127c into cockroachdb:master Aug 20, 2020
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.

bulkio: Incorrect transaction semantics in job_scheduler jobs: TestJobSchedulerDaemonProcessesJobs failed
4 participants