jobs: Job scheduler should not expose txn to scheduled job implementations. #78466
Labels
A-jobs
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-jobs
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
The text was updated successfully, but these errors were encountered: