Skip to content

sql: indicate that the statement was retried in statement bundles #142674

@DrewKimball

Description

@DrewKimball

We saw a case where an EXPLAIN ANALYZE statement ran for 8 hours, but the collected bundle only covered a successful 20-second execution. The statement was retrying due to contention during most of that time. We should surface information about retries as part of the statement bundle to avoid confusion in the future.

Snippet from conversation with @yuzefovich:

hm, I’d expect that we’d collect a separate bundle for each execution attempt, and then there is a question of which bundle actually gets stored:
if the bundle was collected via explicit EXPLAIN ANALYZE (DEBUG) call, then it looks like the last bundle should be returned, and all prior iterations should still be stored in the system table
if the bundle was collected due to “activate diagnostics”, then the first bundle would be stored and all others would be ignored. (This is because such bundle will have requestID being non-zero which modifies the behavior of InsertStatementDiagnostics)

Jira issue: CRDB-48469

Metadata

Metadata

Assignees

Labels

C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-supportWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docsP-3Issues/test failures with no fix SLAT-sql-queriesSQL Queries Teambranch-release-24.1Used to mark GA and release blockers, technical advisories, and bugs for 24.1branch-release-24.3Used to mark GA and release blockers, technical advisories, and bugs for 24.3branch-release-25.1v24.1.18v24.3.12v25.1.6

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions