When no users are loaded from backends, instead of counting it as a failure the service is started and the next time a client connects an attempt to load the users from the backends is made.
Added a header which contains the locations for the testing directory and its subfolders which enables
the test to write into the right logfiles. Also added a calls to skygw_log_sync_all before assertions
forcing all logs to be written to disk at the time the test might fail.
service.h:Added the 'serviceStartFailed' function which tries to start services with successfully started routers but no successfully started listeners.
mysql_mon.c:Added a call to ServiceStartFailed when servers come available.
readwritesplit.c:route_session_write failed if the last backend on all backends list was not in use. THe situation where not all backends are used by routing session is normal especially if max_slave_connections is not set to 100%. Thus session commands may have failed if user was bit unlucky.
Changed the logic so that the function fails (and session is closed) if routing fails to any such backend which is in use in the session.
Added server references to services instead of using a raw pointers to server instances.
Changed all references to service->database to service->dbref.
tee.c:routeQuery cloned partial MySQL packets to be routed to child router. Problems were due to the use of gwbuf_clone and modutil_MySQL_query which clone/examine only the first buffer from the buffer list which composes GWBUF.
modutil.c: Added function modutil_MySQL_query_len which calculates MySQL packet length and the missing bytecount
tee.c: Added details about the freeing of orphaned sessions.
session.: Added missing cases of session state into the session_state function in debug builds.
tee.c: Created a static, module-wide list of orphaned branch sessions which holds the branch sessions that can't be freed at the
time the parent session is being freed. This list is processed every time a a tee filter session is freeing its memory.
dcb.c:dcb_hashtable_stats:division by zero
hashtable.c:hashtable_get_stats: NULL-pointer reference
service.c:serviceStartPort:set service->users NULL to avoid referring to freed memory
users.c:dcb_usersPrintf: NULL-pointer reference
debugcmd.c:convert_arg: changed return value to 1 in case of error, 0 (==NULL) is valid but it indicates that there are no users loaded.
execute_cmd: fixed command handling
Tee filter now receives two client replies, one from the parent service and
one from the child service. These replies are checked before cloning any more queries
into the child service. If the reply isn't sent fast enough, the child session is closed.
Added clientReply and setUpstream entry points
Tee filter now waits for the branch session to be replied to and if the reply isn't received in five seconds it closes the branch session.
dcb.h:
Added the DCBF_REPLIED flag that is currently only set in dcb_null_write
dcb.c:
The DCBF_REPLIED flag is now set in dcb_null_write