Skip to content

Conversation

@spilchen
Copy link
Contributor

Adds a new inspect operation to the schema change workload, enabling random generation of INSPECT TABLE and INSPECT DATABASE statements.

Features:

  • Support for TABLE/DB targets, AS OF SYSTEM TIME
  • Always runs in DETACHED mode so that it can be run inside a transaciton
  • Results checked post-run via SHOW INSPECT ERRORS

Errors reported in JSON, consistent with existing workload logs

Closes #155483
Epic: CRDB-55075
Release note: none

@spilchen spilchen self-assigned this Oct 27, 2025
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@spilchen spilchen requested a review from a team October 27, 2025 20:08
@spilchen spilchen marked this pull request as ready for review October 27, 2025 20:08
@spilchen spilchen requested a review from a team as a code owner October 27, 2025 20:08
@spilchen spilchen requested review from fqazi, shailendra-patel and williamchoe3 and removed request for a team October 27, 2025 20:08
Copy link
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments, nice work!

@fqazi reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @shailendra-patel and @williamchoe3)


pkg/workload/schemachange/schemachange.go line 210 at r1 (raw file):

	var totalErrors int
	for _, jobID := range jobIDs {
		query := fmt.Sprintf("SHOW INSPECT ERRORS FOR JOB %d WITH DETAILS", jobID)

Nit: Do we want to explicit select columns via SELECT <COLUMNS> FROM [SHOW ...] for future proofing (if the columns ever change?)


pkg/workload/schemachange/schemachange.go line 350 at r1 (raw file):

			shutdownErr := tracerProvider.Shutdown(ctx)
			s.schemaWorkloadResultAnnotator.logWorkloadStats(stdoutLog)
			return errors.CombineErrors(inspectErr, errors.CombineErrors(closeErr, shutdownErr))

Lets use errors.Join instead.


pkg/workload/schemachange/operation_generator.go line 3460 at r1 (raw file):

func (og *operationGenerator) inspect(ctx context.Context, tx pgx.Tx) (*opStmt, error) {
	stmt := makeOpStmt(OpStmtDML)

This workload runs on mixed version, is it safe to create the job in a mixed version setting? Think we may want a version gate.

@spilchen spilchen force-pushed the gh-155483/251027/1146/inspect-rsw/pr-ready branch from fafc743 to f881d3f Compare October 28, 2025 20:15
Copy link
Contributor Author

@spilchen spilchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @fqazi, @shailendra-patel, and @williamchoe3)


pkg/workload/schemachange/operation_generator.go line 3460 at r1 (raw file):

Previously, fqazi (Faizan Qazi) wrote…

This workload runs on mixed version, is it safe to create the job in a mixed version setting? Think we may want a version gate.

Good call. I updated optype.go for this.


pkg/workload/schemachange/schemachange.go line 350 at r1 (raw file):

Previously, fqazi (Faizan Qazi) wrote…

Lets use errors.Join instead.

Done.

Copy link
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@fqazi reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @shailendra-patel and @williamchoe3)

@github-actions
Copy link

Potential Bug(s) Detected

The three-stage Claude Code analysis has identified potential bug(s) in this PR that may warrant investigation.

Next Steps:
Please review the detailed findings in the workflow run.

Note: When viewing the workflow output, scroll to the bottom to find the Final Analysis Summary.

After you review the findings, please tag the issue as follows:

  • If the detected issue is real or was helpful in any way, please tag the issue with O-AI-Review-Real-Issue-Found
  • If the detected issue was not helpful in any way, please tag the issue with O-AI-Review-Not-Helpful

@github-actions github-actions bot added the o-AI-Review-Potential-Issue-Detected AI reviewer found potential issue. Never assign manually—auto-applied by GH action only. label Oct 28, 2025
Adds a new inspect operation to the schema change workload, enabling random
generation of INSPECT TABLE and INSPECT DATABASE statements.

Features:
- Support for TABLE/DB targets, AS OF SYSTEM TIME
- Always runs in DETACHED mode so that it can be run inside a transaciton
- Results checked post-run via SHOW INSPECT ERRORS

Errors reported in JSON, consistent with existing workload logs

Closes cockroachdb#155483
Epic: CRDB-55075
Release note: none
@spilchen spilchen force-pushed the gh-155483/251027/1146/inspect-rsw/pr-ready branch from f881d3f to dc72c30 Compare October 29, 2025 12:09
@spilchen spilchen added the O-AI-Review-Real-Issue-Found AI reviewer found real issue label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

o-AI-Review-Potential-Issue-Detected AI reviewer found potential issue. Never assign manually—auto-applied by GH action only. O-AI-Review-Real-Issue-Found AI reviewer found real issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workload: add INSPECT to random schema workload

3 participants