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: persist planner for a pausable portal #99625

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

sql: persist planner for a pausable portal #99625

ZhouXing19 opened this issue Mar 27, 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 27, 2023

We now store the meta data needed for a portal's re-execution in PreparedPortal.portalPauseInfo. This field includes things such as instrumentationHelper and planTop which are to override the planner for each execution. But this can be error-prone and confusing as now we reset most of the fields of a planner, even though the underlying query is the same.

One more bullet-proof approach would be to embed planner object into the pause info struct, and then use that planner instance whenever we're operating with the pausable portals. pauseInfo.planner would be modified ("initialized") on the first execution of the portal, but then we will not call resetPlanner() on it. This way, with every re-execution we will let the resumed flow to modify our planner as the flow needs, and then we'll keep the state of the planner unchanged until the portal is resumed again. This approach will also let us remove fields like portal.pauseInfo.ihWrapper.

The key here is to determine what in planner should be retained and what should be updated for each execution.

Jira issue: CRDB-25987

Epic CRDB-25183

@ZhouXing19 ZhouXing19 added 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) A-pausable-portals Issues related to multiple active portals labels Mar 27, 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
No open projects
Development

No branches or pull requests

1 participant