Open
Description
This task introduces the job infrastructure for executing data consistency checks. Initially, the job will act as a no-op to allow incremental development and plumbing. The job will be triggered through the existing EXPERIMENTAL SCRUB command, gated behind a temporary feature flag.
Details
- Introduce a new job type for CHECK operations. The initial job implementation should complete immediately without performing any actual validation.
- Add a new cluster setting or feature flag, e.g.,
enable_scrub_job
, to control whether EXPERIMENTAL SCRUB triggers the new job or uses its current synchronous execution path. - Update EXPERIMENTAL SCRUB to submit a job when the flag is enabled.
- Since the job is asynchronous, adjust transaction semantics accordingly:
- If possible, the user-facing transaction should commit immediately once the job is created.
- The statement should block until the job finishes, similar to how schema changes behave.
- If the statement or transaction times out before the job finishes, a NOTICE should be emitted indicating that the job is still running, along with the job ID.
- This infrastructure will lay the groundwork for CHECK TABLE and CHECK DATABASE to later invoke the same job type.
Jira issue: CRDB-51518
Epic CRDB-30356