Connect without proxy information hangs if "proxy_protocol_networks" is enabled

Bug #1508909 reported by OrNix
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Invalid
Undecided
Unassigned
5.6
Triaged
Medium
Borys Belinsky
5.7
Triaged
Medium
Borys Belinsky

Bug Description

Server version: 5.6.26-74.0-log Percona Server (GPL), Release 74.0, Revision 32f8dfd
2.6.32-504.23.4.el6.x86_64

proxy_protocol_networks=192.168.167.70
Connects from 192.168.167.70 with proxy information from haproxy work fine. But simple mysql connect from this address (without proxy information) hangs:

192.168.167.70# mysql --host 192.168.167.73 -u wm_ro -p
Enter password:
...
...

And in processlist on server there is something like:
Connect 570935 login unauthen connecting 58:36.942

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

This behavior is necessitated by the protocol: in MySQL protocol, server speaks first; in proxy protocol, client speaks first. Here both parties wait for the other one to send something.

Converting this to doc bug so that this behavior is documented.

Additionally, the connection timeout in such scenario might be too long, see bug 1502411.

tags: added: proxy-protocol
tags: added: doc
Revision history for this message
OrNix (ornixx) wrote :

So is it impossible to make both mysql and haproxy connections workable from the same IP?

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Right. Protocol issues aside, this is also specified in the proxy protocol specification, to the best of my understanding:

"The receiver MUST be configured to only receive the protocol described in this
specification and MUST not try to guess whether the protocol header is present
or not. "

http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt

Revision history for this message
wodesuck (wodesuck) wrote :

I think there should be an option for the mysql client that make it enable to send a proxy protocol header. Client may send a LOCAL command as proxy protocol specified, indicating real connection endpoints are used. This would make more convenience and flexible while working with proxy protocol.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1659

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.