Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ZhouXing19 opened this issue Mar 23, 2023 · 0 comments
Open

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

ZhouXing19 opened this issue Mar 23, 2023 · 0 comments
Labels
A-pausable-portals Issues related to multiple active portals C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@ZhouXing19
Copy link
Collaborator

ZhouXing19 commented Mar 23, 2023

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

@ZhouXing19 ZhouXing19 added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-pausable-portals Issues related to multiple active portals T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Mar 23, 2023
@ZhouXing19 ZhouXing19 changed the title sql: fix phase time for pausable portals sql: fix phase time and session tracing for pausable portals Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pausable-portals Issues related to multiple active portals C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

1 participant