cockroachdb / cockroachdb/cockroach

sql: fix `stmtTraceThreshold` for pausable portals

Open
#99,404 0 comments 0 reactions 0 assignees View on GitHub
A-pausable-portals C-bug T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Since a pausable portal can be re-executed by re-calling `connExecutor.ExecStmtInOpenState()`, we should better record the trace threshold for all executions.
https://github.com/cockroachdb/cockroach/blob/d8ea15c875bcdce02cc6325037460b2a3ef7054a/pkg/sql/conn_executor_exec.go#L726
Specifically, now each re-execution will get a fresh budget and we won't include details about the previous executions, only about the last one.

Jira issue: CRDB-25867

Epic CRDB-25183

Contributor guide

Open the contributing guide

Research direction

Start at pkg/sql/conn_executor_exec.go around line 726 and inspect connExecutor.ExecStmtInOpenState(), focusing on how trace thresholds are recorded when a pausable portal is re-executed. Done means the trace threshold reflects all executions rather than only the most recent execution; the payload does not name a test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.