Skip to content

Conversation

yuzefovich
Copy link
Member

Backport 1/1 commits from #155655.

/cc @cockroachdb/release


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 a review from michae2 October 17, 2025 23:58
@yuzefovich yuzefovich requested review from a team as code owners October 17, 2025 23:58
Copy link

blathers-crl bot commented Oct 17, 2025

Thanks for opening a backport.

Before merging, please confirm that it falls into one of the following categories (select one):

  • Non-production code changes. Includes test-only changes, build system changes, etc.
  • Fixes for serious issues. Defined in the policy as correctness, stability, or security issues, data corruption/loss, significant performance regressions, breaking working and widely used functionality, or an inability to detect and debug production issues.
  • Other approved changes. These changes must be gated behind a disabled-by-default feature flag unless there is a strong justification not to.

Add a brief release justification to the PR description explaining your selection.

Also, confirm that the change does not break backward compatibility and complies with all aspects of the backport policy.

All backports must be reviewed by the TL and EM for the owning area.

@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

Copy link

blathers-crl bot commented Oct 17, 2025

✅ PR #155667 is compliant with backport policy

Confidence: high
Critical bug criteria met: [Stability or security issues]
Backward compatible: true
Explanation: The pull request backports a fix for a node crash issue, consistent with the critical bug criteria under the CockroachDB backport policy. A node crash is considered a stability issue, thus qualifying the change as addressing a critical bug. The PR description and the 'Release justification' explicitly mentions a crash caused by the 'pausable portal' feature, which is directly related to how 'EXPLAIN ANALYZE' statements were handled. Furthermore, none of the changes involve backward compatibility issues such as removal of version gates or break existing APIs. All changes are relevant to fixing the described issue without introducing features that require gating. Considering these factors, the PR is compliant with the backport policy.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@yuzefovich yuzefovich merged commit 58e26b7 into cockroachdb:release-25.2 Oct 20, 2025
16 checks passed
@yuzefovich yuzefovich deleted the backport25.2-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 T-sql-queries SQL Queries Team target-release-25.2.8

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants