server: start jobs registry before running startup migrations#45828
Merged
dt merged 2 commits intocockroachdb:masterfrom Mar 7, 2020
Merged
server: start jobs registry before running startup migrations#45828dt merged 2 commits intocockroachdb:masterfrom
dt merged 2 commits intocockroachdb:masterfrom
Conversation
This was supposed to get baked in two releases ago. Whoops. Release note: none.
Member
Migrations sometimes try to run jobs, for example running schema changes or other operations that are executed as jobs. Thus the jobs system must be started before the migrations are run. Release note: none.
c93185c to
2cefc00
Compare
spaskob
approved these changes
Mar 7, 2020
Contributor
spaskob
left a comment
There was a problem hiding this comment.
Thanks for taking care of this!
Please stress test jobs_test.go locally - it has helped me uncover a lot of subtle issues with jobs.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis, @lucy-zhang, and @spaskob)
Contributor
Author
|
|
Contributor
Author
|
@lucy-zhang I tested this locally on top of 497f15e and it looked like the startup deadlock is gone |
|
Thanks for dealing with this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This contains two changes: one bakes in the startup migration that adds the
progresscolumn and family to the jobs table, and the other moves the execution of startup migrations to after the jobs registry has been started.The later is important since migrations themselves often run commands such as REVOKE or CREATE TABLE that themselves can spawn jobs.
Release note: none.