Skip to content

sql/inspect: support row count validation for INSPECT after IMPORT #155472

@spilchen

Description

@spilchen

IMPORT currently triggers an async INSPECT job after completion. That job runs a general index consistency check between primary and secondary indexes. While that validation is useful, what we really want is a check that verifies the completeness of the import -- specifically, that no rows were missed.

Instead of the existing index consistency check, IMPORT should trigger a new INSPECT check that compares the imported table’s row count against the expected count. This approach works because the table is offline during IMPORT, and the INSPECT job runs with an AS OF timestamp taken from before the table is made public again.

Implementation notes

  • No new SQL is required, since IMPORT starts the INSPECT job directly.
  • Add a new check type to the INSPECT job spec and invoke it from IMPORT.
  • Ensure an AS OF timestamp is always set when this check runs.
  • Add a new INSPECT error type for row count mismatches.

Jira issue: CRDB-55448

Epic CRDB-58692

Metadata

Metadata

Assignees

Labels

C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)branch-release-26.1Used to mark GA and release blockers, technical advisories, and bugs for 26.1target-release-26.2.0v26.2.0-prerelease

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions