This repository was archived by the owner on Jan 14, 2025. It is now read-only.
fix: make the order of commands the same as with node-pg #9
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.
So, wireshark has been super helpful today, here's what I found out (see the image):
The first 16 packets are from node-pg library, which is guaranteed to work perfectly with HyperDrive. The next four packets are from our fork of tokio-postgres, the version that runs right now in production. The last four packets are from my fixed version of tokio-postgres. We see here, how there is our login to postgres, the first
>
, then a normal series of packets back<R/S/S/S/S/S/S/S/S/S/S/S.../K/Z
. After that node-postgres sends packets in this order, in separate packages:P
(Parse)B
(Bind)D
(Describe)E
(Execute)S
(Flush)Now, what we send is
P/D/B/E/S
, we can see that describe and bind are in the wrong order, and we also send the whole series in one package (which should be possible per docs, and faster).This PR changes the order of describe and bind, so we bind first and describe right after that. It also removes matches of
CloseComplete
from two spots, which were added when we explicitly closed after the flush.The next step is to test this with the script from @tomhoule, and if it succeeds, then we deploy to production and pray.