sql/inspect: record table version in INSPECT job to detect schema drift #158216
+117
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the INSPECT job only recorded the table IDs involved in the job. However, there is a time gap between when the job record is created and when the job is executed, during which schema changes amy occur. These changes can invalidate assumptions made at job creation (e.g. index ID existence).
This change introduces table version tracking into the job record. Before executing any checks, the job will verify that the current table versions match those stored at creation. If a mismatch is detected, the job will fail early.
This mechanism mirrors similar protections implemented in other jobs, such as TTL jobs.
Informs #158197
Release note: none