-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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,*: stop writing payload and progress to system.jobs #99458
jobs,*: stop writing payload and progress to system.jobs #99458
Conversation
22d8a48
to
2fa8f74
Compare
@@ -1,4 +1,4 @@ | |||
# LogicTest: default-configs local-mixed-22.2-23.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc: @fqazi this test used to directly mutates the payload column in system.jobs
. In a local-mixed-22.2-23.1
the job_info
table does not exist until the relevant upgrades have been run. Is it true that under this mixed configuration this test will always run at V22_2 i.e. without running any of the V23_1 upgrades? In that case I can keep both the queries and conditionally run them based on the config the test is being run under.
2fa8f74
to
22d23d0
Compare
@@ -756,7 +756,7 @@ SELECT id, status | |||
payload, | |||
false -- emit_defaults | |||
) AS pl | |||
FROM system.jobs | |||
FROM crdb_internal.system_jobs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a concise explanation on who (what packages) should be allowed to access system.jobs? Is it only underlying jobs package (and maybe tests)? Should there be a lint to warn about
system.jobs usage instead of crdb_internal.system_jobs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we'd have everyone going through accessors but that cat is out of the bag for system.jobs
. Hopefully, we'll be a little stricter about directly reaching into job_info
in non-test code. As far as a linter I think it'll become much clearer once these columns are dropped at which point there is no option but to go to the job_info
table for payload and progress.
22d23d0
to
5d89703
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it was exceedingly tedious. 🙌
TFTR! bors r=miretskiy,dt |
Build failed (retrying...): |
Build failed (retrying...): |
Build failed (retrying...): |
Merge conflict. |
5d89703
to
3b1024b
Compare
bors r+ |
Build failed: |
bors retry |
Build failed: |
The failures are all |
This change introduces a cluster version after which the payload and progress of a job will not be written to the system.jobs table. This will ensure that the system.job_info table is the single, source of truth for these two pieces of information. This cluster version has an associated upgrade that schema changes the `payload` column of the `system.jobs` table to be nullable, thereby allowing us to stop writing to it. This upgrade step is necessary for a future patch where we will drop the payload and progress columns. Without this intermediate upgrade step the `ALTER TABLE ... DROP COLUMN` upgrade job will attempt to write to dropped columns as part of its execution thereby failing to run the upgrade. Informs: cockroachdb#97762 Release note: None
3b1024b
to
5d9b97a
Compare
let's try again bors r+ |
Build succeeded: |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from 5d9b97a to blathers/backport-release-23.1-99458: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 23.1.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
This change introduces a cluster version after which the
payload and progress of a job will not be written to the
system.jobs table. This will ensure that the system.job_info
table is the single, source of truth for these two pieces of
information.
This cluster version has an associated upgrade that schema changes
the
payload
column of thesystem.jobs
table to be nullable,thereby allowing us to stop writing to it. This upgrade step
is necessary for a future patch where we will drop the payload
and progress columns. Without this intermediate upgrade step the
ALTER TABLE ... DROP COLUMN
upgrade job will attempt to writeto dropped columns as part of its execution thereby failing to
run the upgrade.
Informs: #97762
Release note: None