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: Job scheduler should not expose txn to scheduled job implementations. #78466

Open
miretskiy opened this issue Mar 25, 2022 · 1 comment
Labels
A-jobs C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-jobs

Comments

@miretskiy
Copy link
Contributor

miretskiy commented Mar 25, 2022

Currently, job scheduler exposes txn to job schedule implementation.
While the intent was to enable atomic schedule execution together with schedule record update,
exposing txn directly is dangerous. The implementation may use the transaction to perform wide reads, which then could result
in schedule txn being retried indefinitely, as show in #78465

In general, job scheduler should avoid locking records, should avoid using for update clause, and should not
expose low level primitives (txn) to job implementations. It should assume that job implementations are buggy, and must ensure
that an error in one of the job implementations does not destabilize the rest of the system (show jobs, show schedules, etc).

Jira issue: CRDB-14144

@miretskiy miretskiy added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-jobs labels Mar 25, 2022
@blathers-crl blathers-crl bot added the A-jobs label Mar 25, 2022
@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) T-jobs
Projects
None yet
Development

No branches or pull requests

1 participant