Skip to content

sql: fix phase time and session tracing for pausable portals #99410

@ZhouXing19

Description

@ZhouXing19

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.

ex.statsCollector.PhaseTimes().SetSessionPhaseTime(sessionphase.PlannerStartExecStmt, timeutil.Now())

Similarly, maybe we should set the sessionTracing.TracePlanEnd only when we close the portal.

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

No one assigned

    Labels

    A-pausable-portalsIssues related to multiple active portalsC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-queriesSQL Queries Team

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions