Rwsplit handles ERRACT_NEW_CONNECTION by clearing backend reference, removing callbacks and associating backend reference with new backend server. If it succeeds and the router session can continue, handleError returns true. Otherwise false. When ever false is returned it means that session must be closed.
Rwsplit now tolerates backend failures in a way that it searches new backends when monitor, backend, or client operation fails due to backend failure.
Added flags to those backend references which have sent something to backend which causes the backend to send results or reply back. Didn't add removal of the flag since there's currently no way to tell whether response from backend contains anything else than session command reply - which aren't counted when BREF_WAITING_RESULT is set and cleared.
dcb.h: define ERRHAND temporarily since changes are still behind that macro
Defined two error handling actions in router.h: ERRACT_NEW_COMMECTION and ERRACT_REPLY_CLIENT.
Failed database is logged at expanding frequence to error and to message log due changes in mysql_mon.c. Added two new members in MONITOR_SERVERS: mon_err_count, and mon_prev_status so that each backend can be treated individually.
Error handling: if mysql_backend.c:dcb_read fails, router's handleError is called instead of closing session.
If mysql_client.c:SESSION_ROUTE_QUERY fails router's handleError is called instead of sending error to client.
readwritesplit.c:select_connect_backend_servers is modified so that in can be called during active router session. When called, it attempts to find one master and maximum number of configured slaves in correct state if necessary.
When handleError needs to replace failed unit it now calls select_connect_backend_servers.
Added a lot of logging to error, trace and message logs which should help the user to handle errors which can't be automatically resolved, like attempt to use nonexisting database.
The regexfilter is an example of a query rewriting filter that uses
regular expressions to match the SQL text and allows a replacement text
to be used for each match of the regular expression.
Regexfilter has no special SQL undertanding, it merely uses the features
avialable inthe regex library to perform matches.
Statements that span multiple packets are not supported by the regex
filter.