Open
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This comment has been minimized.
This comment has been minimized.
868131b to
b246b84
Compare
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.
More details are in the https://github.com/pgdogdev/pgdog/pull/876/changes#diff-fa25f12c8c64f8778cd0849682b0310883829c9eed403e4cde728e08ff980f29
The pr fixes couple of issues that could potentially cause the unexpected ProtocolOutOfSync errors, but only the issue 1 looks like highly possible in the real environments.
Issue 1
The issue 1 is reproducible when
prepared_statements = "full"and the error happens duringPREPAREpart of the query execution. After thePREPAREfail the previous code was dropping all the remaining expected codes from the stream and stopped. But the backend will actually return the errors forEXECUTEanyway and this error will appear as the response to some another query and maybe even for another client.The nature of the issue makes it harder to trace since the failed state of protocol is passed back to pool where another connection picks it up and breaks.
The integration test
integration/prepared_statements_full/protocol_out_of_sync_spec.rbreproduces the issue with different configuration and it shows the errors in the https://github.com/pgdogdev/pgdog/actions/runs/24104237887/job/70323280283I'm not sure why the ci doesn't show all logs, but the server logs locally are

The fix is mostly inside https://github.com/pgdogdev/pgdog/pull/876/changes#diff-8495b645d11def521aee36a05448da7fc100d632e6ad513d04fb7a47512bd08d
Other
The other issues not that important, but I've tried to fix them anyway just to be sure. Also extend logs in case we'll still face the issue in the future.