Fix possible ProtocolOutOfSync when using prepared statements#913
Open
Fix possible ProtocolOutOfSync when using prepared statements#913
Conversation
issue 0 test flip
This comment has been minimized.
This comment has been minimized.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
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.rsto 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.