This task introduces new SQL grammar for a INSPECT command that supports data consistency validation. It serves as an alternative to the existing EXPERIMENTAL SCRUB command. While SCRUB was originally framed around hardware error correction concepts (see RFC), the new INSPECT command aims to present a clearer and more intuitive interface focused on validation, not repair. Since consistency issues are expected to be rare, the emphasis is on confirming integrity.
This issue is focused on defining the grammar and plumbing. Execution will be gated behind a feature flag and initially implemented as a no-op.
Proposed SQL Syntax
INSPECT TABLE <table> [AS OF SYSTEM TIME <expr>] [WITH OPTIONS (<option> [, ...])]
INSPECT DATABASE <database> [AS OF SYSTEM TIME <expr>] [WITH OPTIONS (<option> [, ...])]
SHOW INSPECT FAILURES [FOR TABLE <name>] [FOR LATEST RUN] [WITH DETAILS]
Options:
INDEX ALL — Validates all indexes (default).
INDEX (<indexname>...) — Run an inspect against the specific indexes
These options are mutually exclusive.
Scope of This Task
- Add grammar for INSPECT and SHOW INSPECT FAILURES.
- Introduce a cluster setting
enable_inspect_command in vars.go.
- By default,
INSPECT fails with an error message referencing the setting.
- If enabled,
INSPECT will return successfully as a no-op.
SHOW INSPECT FAILURES will always return successfully as a no-op
EXPERIMENTAL SCRUB remains available. Execution logic for INSPECT will be implemented in follow-up tasks.
Jira issue: CRDB-51507
Epic CRDB-30356
This task introduces new SQL grammar for a
INSPECTcommand that supports data consistency validation. It serves as an alternative to the existingEXPERIMENTAL SCRUBcommand. WhileSCRUBwas originally framed around hardware error correction concepts (see RFC), the newINSPECTcommand aims to present a clearer and more intuitive interface focused on validation, not repair. Since consistency issues are expected to be rare, the emphasis is on confirming integrity.This issue is focused on defining the grammar and plumbing. Execution will be gated behind a feature flag and initially implemented as a no-op.
Proposed SQL Syntax
Options:
INDEX ALL— Validates all indexes (default).INDEX (<indexname>...)— Run an inspect against the specific indexesThese options are mutually exclusive.
Scope of This Task
enable_inspect_commandinvars.go.INSPECTfails with an error message referencing the setting.INSPECTwill return successfully as a no-op.SHOW INSPECT FAILURESwill always return successfully as a no-opEXPERIMENTAL SCRUBremains available. Execution logic forINSPECTwill be implemented in follow-up tasks.Jira issue: CRDB-51507
Epic CRDB-30356