-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: fix phase time and session tracing for pausable portals #99410
Description
Originally, a query's lifecycle is expected to be complete in the closure of connExecutor.dispatchToExecutionEngine(). This is no longer true for pausable portals as we will rerun this function when re-executing the same portal. For example, the phase sessionphase.PlannerStartExecStmt maybe should only happen when the query is run for the first time.
cockroach/pkg/sql/conn_executor_exec.go
Line 1305 in d8ea15c
| ex.statsCollector.PhaseTimes().SetSessionPhaseTime(sessionphase.PlannerStartExecStmt, timeutil.Now()) |
Similarly, maybe we should set the sessionTracing.TracePlanEnd only when we close the portal.
cockroach/pkg/sql/conn_executor_exec.go
Line 1277 in 2bd2c80
| ex.sessionTracing.TracePlanEnd(ctx, err) |
Or maybe we have these phases to be execution-bound rather than query-bound, but we should make it more explicit for pausable portals. Alternatively, we may want to have both execution-bound and query-bound phase markers.
Jira issue: CRDB-25870
Epic CRDB-25183
Metadata
Metadata
Assignees
Labels
Type
Projects
Status