Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pgwire: send BackendKeyData message for pgpool compatibility #13009

Closed
wants to merge 1 commit into from
Closed

pgwire: send BackendKeyData message for pgpool compatibility #13009

wants to merge 1 commit into from

Conversation

asubiotto
Copy link
Contributor

@asubiotto asubiotto commented Jan 19, 2017

pgpool doesn't open a connection succesfully to a server unless a BackendKeyData
message is received before a ReadyForQuery message. This message is meaningless
for now.


This change is Reviewable

pgpool doesn't open a connection succesfully to a server unless a BackendKeyData
message is received before a ReadyForQuery message. This message is meaningless
for now.
@asubiotto asubiotto requested a review from tamird January 19, 2017 20:33
@tamird
Copy link
Contributor

tamird commented Jan 19, 2017

Can we test this somehow? Perhaps we need a new acceptance test; we can add pgpool to the "postgres" test image.


Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks pending.


Comments from Reviewable

@maddyblue
Copy link
Contributor

This either needs a test with multiple connections to make sure using process IDs of 0 works with pgpool, or we need to generate process IDs and secret keys that are useful.


Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

@asubiotto
Copy link
Contributor Author

I've been working on adding an acceptance test with pgpool in front of a secure cluster for the last couple of days. I got to the point where everything ran up until pgpool tried to perform authentication with the cluster but never provided any certificates. This is an issue with the version of pgpool I was using and I think that upgrading will probably fix it.
However, I think I've spent a little too much time on this so I'm going to leave it for a while and focus on draining work since compatibility with pgpool is not a top priority right now.

@asubiotto asubiotto removed the request for review from tamird January 26, 2017 20:00
@tamird
Copy link
Contributor

tamird commented Jan 26, 2017 via email

@tamird
Copy link
Contributor

tamird commented Jan 27, 2017

According to jordan, this is also required by a python client; it may be easier to add a test that uses that client that it is to add a pgpool test.

@jordanlewis
Copy link
Member

The code LGTM. I think we should add a test that uses the official libpq to negotiate a connection if we don't already have one of those. Clients have quirks - I think having a test against a reference library (and the Go one?) is probably good enough.

@tamird
Copy link
Contributor

tamird commented Jan 27, 2017 via email

@jordanlewis
Copy link
Member

In that case, now that this issue is relevant for more than just pgpool, I would personally feel comfortable merging this without additional testing because the libpq test would fail if we did not provide a valid connection handshake.

pgpool compatibility (and in particular the multiple-connection test that @mjibson mentions) could be tracked in a separate issue/PR.

@tamird
Copy link
Contributor

tamird commented Jan 27, 2017 via email

@knz
Copy link
Contributor

knz commented Jan 28, 2017

Fixes #13191.

@maddyblue
Copy link
Contributor

If lib/pq#535 gets merged then we can test this with a Go client really easily, using context methods.

@tamird
Copy link
Contributor

tamird commented Jan 28, 2017 via email

@asubiotto
Copy link
Contributor Author

I would rather wait until we generate process IDs and secret keys that are useful once we support CancelRequest on our end. The thing is that figuring out whether sending this meaningless BackendKeyData is harmful depends on the frontend and how it uses this BackendKeyData so no tests would convince me that adding this won't break some other client.

@tamird
Copy link
Contributor

tamird commented Oct 9, 2017

@asubiotto all the prerequisites for this are in place now, right?

@asubiotto
Copy link
Contributor Author

Sorry for the late response, this got lost in my inbox.

No, I think the wire-level support for cancellation was decided against: #17252 (comment). The way to move forward with this might be to generate random data and return some "unimplemented" message when cancellation messages are sent.

@asubiotto
Copy link
Contributor Author

Closing this (for now?) since there is no work being done on this PR.

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.

5 participants