Skip to content

Fix possible ProtocolOutOfSync when using prepared statements#913

Open
meskill wants to merge 6 commits intomainfrom
fix/protocol_out_of_sync_prepared_statements
Open

Fix possible ProtocolOutOfSync when using prepared statements#913
meskill wants to merge 6 commits intomainfrom
fix/protocol_out_of_sync_prepared_statements

Conversation

@meskill
Copy link
Copy Markdown
Contributor

@meskill meskill commented Apr 19, 2026

This is continue of #876

While one of the cases of unexpected ProtocolOutOfSync errors was fixed in the #887 the issue can still appear when using prepared_statements = "full"

This pr focuses on the refactoring the pgdog/src/backend/protocol/state.rs to provide fix for this case and also other possible issues that could also lead to issues in the future and therefore make the code less error-prone. Although right now they don't impose significant threat since it's not reproducible by the current pgdog architecture for processing commands. But I do think it's useful to clean this up to prevent any degradation in the future.

The details are described in the doc file https://github.com/pgdogdev/pgdog/pull/913/changes#diff-fa25f12c8c64f8778cd0849682b0310883829c9eed403e4cde728e08ff980f29 and tests for different cases were added.

@blacksmith-sh

This comment has been minimized.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

Codecov Report

❌ Patch coverage is 99.38080% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pgdog/src/backend/protocol/state.rs 99.41% 1 Missing ⚠️
pgdog/src/backend/server.rs 99.34% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@meskill meskill changed the title Fix possible Protocol Out Of Sync when using prepared statements Fix possible ProtocolOutOfSync when using prepared statements Apr 19, 2026
@meskill meskill marked this pull request as ready for review April 19, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant