Bug #45417 Proxy should return "normal" SQLStates/Error Codes when all backends are down
Submitted: 9 Jun 2009 20:50 Modified: 7 Dec 2010 11:07
Reporter: Mark Matthews Email Updates:
Status: QA testing Impact on me:
None 
Category:MySQL Proxy: Core Severity:S2 (Serious)
Version:0.8.0 OS:Any
Assigned to: Jan Kneschke CPU Architecture:Any
Tags: windmill

[9 Jun 2009 20:50] Mark Matthews
Description:
Proxy returns an error message with a non-standard SQLState (and a message in what looks to be wrong form, because clients are not extracting SQLStates from the message itself) when all backends are down:

"#07000(proxy) all backends are down"

This causes issues with clients that have "retry" logic, as they won't cover these "custom" SQL States. 

We should consider using the normal "08S..." states for communications failures, or discuss with the connector team one which can be used for this state.

Therefore, at least in failure modes, the proxy is *not* transparent from an application's point of view.

How to repeat:
Configure the proxy to use a non-existent backend. Inspect the error message returned. It's not "08S..." or "HY000", which are states clients will look for.
[10 Jun 2009 5:15] Sveta Smirnova
Thank you for the report.

Verified as described.
[11 Jun 2009 14:42] Kay Roepke
A link to the list of SQL states:
http://dev.mysql.com/doc/refman/5.1/en/error-messages-server.html

Whoever is working on this needs to either figure out which ones apply or seek feedback from the Connectors group.
[14 Jul 2009 15:00] Enterprise Tools JIRA Robot
Heidi Bergh-Hoff writes: 
Mark Matthews: could you please suggest what error code should be returned?  What do the connectors expect to get?
[16 Mar 2010 16:05] Enterprise Tools JIRA Robot
Mark Matthews writes: 
"08S01" would be the code that's used for at least Connector/ODBC and Connector/J. We *may* consider making this configurable so that applications that depend on *different* behavior (perl, ruby, etc) can still work correctly. In many cases they look for "HY000". Unfortunately these codes are usually generated client-side as they happen when communications with the mysql server has been lost, and there is no -real- standard for this error code.
[24 Mar 2010 14:52] Enterprise Tools JIRA Robot
Jan Kneschke writes: 
This packet is expected to be in the pre-4.1 protocol which doesn't have a SQLstate field in the ERR packet.

Instead of:

  "#07000(proxy) all backends are down"

the error-msg should be:

  "(proxy) all backends are down"
[24 Mar 2010 14:56] Enterprise Tools JIRA Robot
Jan Kneschke writes: 
revno: 1026
committer: jan@mysql.com
branch nick: trunk
timestamp: Wed 2010-03-24 15:54:53 +0100
message:
  send the initial ERR packet as pre-4.1 version (fixes #45417)
------------------------------------------------------------
revno: 1025
committer: jan@mysql.com
branch nick: trunk
timestamp: Wed 2010-03-24 15:54:14 +0100
message:
  added a pre-4.1 version of the ERR packet