fix: don't drop the Describe response on deferred transactions#1231
Merged
levkk merged 1 commit intoJul 19, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Fixes pgdogdev#1196. A deferred BEGIN/COMMIT/ROLLBACK now answers the client's Describe message (ParameterDescription + NoData for a statement, NoData for a portal) instead of dropping it, which broke extended-protocol clients.
Kerem-Kurt
force-pushed
the
fix/deferred-transaction-describe
branch
from
July 19, 2026 00:48
f1eac90 to
506553d
Compare
Contributor
Author
|
Rebased onto latest main. Turns out my branch was a commit behind and missing #1232 (hot mutex in comms), which lines up with that checkout timeout in test_schema_sharding. Pretty sure it was unrelated to this change, so hopefully the rebase sorts it out. Hope it's green now |
Collaborator
|
Good stuff, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1196.
Problem
When the query parser defers a transaction-control statement (
BEGIN/COMMIT/ROLLBACK) because no server is attached yet,extended_transaction_replybuilds the reply but ignores the client'sDescribe. Extended-protocol clients (tokio-postgres and friends) get noParameterDescription/NoDataand abort withunexpected message from server.Fix
Answer the
Describe. Always sendingNoDataisn't enough: a statement describe ('S') must be answered withParameterDescriptionfirst. tokio-postgres sends one while preparing and expectsParameterDescriptionbefore anything else.So:
Describe→ParameterDescription+NoDataDescribe→NoDatamatching the extended-query protocol for utility statements (no params, no rows).
Tests
The existing
tokio_postgrestests only runSELECT/INSERT/COPY, so nothing exercised transaction control over the extended protocol. Addedtokio_postgres/transaction.rs, plus protocol-level unit tests inquery_engine/test/extended_transaction.rs.