Added more trace logging to readcounnroute, schemarouter and tee.

This commit is contained in:
Markus Makela
2015-03-24 21:28:03 +02:00
parent 5eb223b92e
commit 5c68782050
3 changed files with 45 additions and 2 deletions

View File

@ -89,6 +89,8 @@
#include <mysql_client_server_protocol.h>
#include "modutil.h"
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
@ -535,6 +537,7 @@ BACKEND *master_host = NULL;
pthread_self(),
candidate->server->port,
candidate->current_connection_count)));
/*
* Open a backend connection, putting the DCB for this
* connection in the client_rses->backend_dcb
@ -564,7 +567,13 @@ BACKEND *master_host = NULL;
spinlock_release(&inst->lock);
CHK_CLIENT_RSES(client_rses);
skygw_log_write(
LOGFILE_TRACE,
"Readconnroute: New session for server %s. "
"Connections : %d",
candidate->server->unique_name,
candidate->current_connection_count);
return (void *)client_rses;
}
@ -718,10 +727,19 @@ routeQuery(ROUTER *instance, void *router_session, GWBUF *queue)
"Error : Failed to route MySQL command %d to backend "
"server.",
mysql_command)));
skygw_log_write(
LOGFILE_ERROR,
"Error : Failed to route MySQL command %d to backend "
"server %s.",
mysql_command,
router_cli_ses->backend->server->unique_name);
rc = 0;
goto return_rc;
}
char* trc = NULL;
switch(mysql_command) {
case MYSQL_COM_CHANGE_USER:
rc = backend_dcb->func.auth(
@ -730,7 +748,8 @@ routeQuery(ROUTER *instance, void *router_session, GWBUF *queue)
backend_dcb->session,
queue);
break;
case MYSQL_COM_QUERY:
trc = modutil_get_SQL(queue);
default:
rc = backend_dcb->func.write(backend_dcb, queue);
break;
@ -745,6 +764,15 @@ routeQuery(ROUTER *instance, void *router_session, GWBUF *queue)
mysql_command,
backend_dcb,
rc)));
skygw_log_write(
LOGFILE_TRACE,
"Routed command [%#x] to '%s'%s%s",
mysql_command,
backend_dcb->server->unique_name,
trc?": ":".",
trc?trc:"");
free(trc);
return_rc:
return rc;
}