Skip to content

Conversation

@yuzefovich
Copy link
Member

@yuzefovich yuzefovich commented Oct 17, 2025

Backport 1/1 commits from #155655 on behalf of @yuzefovich.


This commit disables running EXPLAIN ANALYZE stmts via pausable portals model even if it's enabled. Previously, this led to a crash since different assumptions of how EXPLAIN ANALYZE is handled at the connExecutor level were broken, but it also doesn't make much sense to actually support this. After all, the result rows can only be produced after the query execution effectively completed, which contradicts the spirit of the pausable portal feature.

I briefly looked into making it work, but it doesn't seem worth it. There is a fundamental contradiction right now that we defer finishing the instrumentationHelper (which populates the output of EXPLAIN ANALYZE), and it currently happens after we close the commandResult in which we can write the output.

Fixes: #137597.

Release note (bug fix): Previously, CockroachDB would crash when executing EXPLAIN ANALYZE statements with the pausable portal model (meaning that it was run via the extended PGWire protocol using Parse, Bind, Execute, when multiple_active_portals_enabled session variable is enabled). The bug has been present since 23.2 and is now fixed.


Release justification: fix for a node crash.

This commit disables running EXPLAIN ANALYZE stmts via pausable portals
model even if it's enabled. Previously, this led to a crash since
different assumptions of how EXPLAIN ANALYZE is handled at the
connExecutor level were broken, but it also doesn't make much sense to
actually support this. After all, the result rows can only be produced
_after_ the query execution effectively completed, which contradicts the
spirit of the pausable portal feature.

I briefly looked into making it work, but it doesn't seem worth it.
There is a fundamental contradiction right now that we defer finishing
the instrumentationHelper (which populates the output of EXPLAIN
ANALYZE), and it currently happens after we close the commandResult in
which we can write the output.

Release note (bug fix): Previously, CockroachDB would crash when
executing EXPLAIN ANALYZE statements with the pausable portal model
(meaning that it was run via the extended PGWire protocol using Parse,
Bind, Execute, when `multiple_active_portals_enabled` session variable
is enabled). The bug has been present since 23.2 and is now fixed.
@yuzefovich yuzefovich requested review from a team as code owners October 17, 2025 23:45
@blathers-crl blathers-crl bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Oct 17, 2025
@blathers-crl blathers-crl bot requested review from a team, ZhouXing19 and michae2 October 17, 2025 23:45
@blathers-crl
Copy link

blathers-crl bot commented Oct 17, 2025

Thanks for opening a backport.

Before merging, please confirm that the change does not break backwards compatibility and otherwise complies with the backport policy. Include a brief release justification in the PR description explaining why the backport is appropriate. All backports must be reviewed by the TL for the owning area. While the stricter LTS policy does not yet apply, please exercise judgment and consider gating non-critical changes behind a disabled-by-default feature flag when appropriate.

@blathers-crl blathers-crl bot added backport Label PR's that are backports to older release branches T-sql-queries SQL Queries Team labels Oct 17, 2025
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich yuzefovich removed request for a team and ZhouXing19 October 17, 2025 23:50
Copy link
Collaborator

@michae2 michae2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: Thank you!

@michae2 reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @yuzefovich)

@yuzefovich yuzefovich merged commit 3bf4d8a into cockroachdb:release-25.4 Oct 20, 2025
24 of 25 checks passed
@yuzefovich yuzefovich deleted the blathers/backport-release-25.4-155655 branch October 20, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Label PR's that are backports to older release branches blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. T-sql-queries SQL Queries Team target-release-25.4.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants