Fix to http://bugs.skysql.com/show_bug.cgi?id=469, connection counter leaks in master.

Removed redundant counter increments.
This commit is contained in:
VilhoRaatikka
2014-08-05 16:38:00 +03:00
parent 4ef1df4e9d
commit f738b2e0cb

View File

@ -1132,6 +1132,8 @@ static int routeQuery(
break; break;
case MYSQL_COM_STMT_EXECUTE: case MYSQL_COM_STMT_EXECUTE:
/** Parsing is not needed for this type of packet */
#if defined(NOT_USED)
plainsqlbuf = gwbuf_clone_transform(querybuf, plainsqlbuf = gwbuf_clone_transform(querybuf,
GWBUF_TYPE_PLAINSQL); GWBUF_TYPE_PLAINSQL);
len = GWBUF_LENGTH(plainsqlbuf); len = GWBUF_LENGTH(plainsqlbuf);
@ -1140,7 +1142,8 @@ static int routeQuery(
memcpy(querystr, startpos, len); memcpy(querystr, startpos, len);
memset(&querystr[len], 0, 1); memset(&querystr[len], 0, 1);
qtype = skygw_query_classifier_get_type(querystr, 0, &mysql); qtype = skygw_query_classifier_get_type(querystr, 0, &mysql);
qtype |= QUERY_TYPE_EXEC_STMT; #endif
qtype = QUERY_TYPE_EXEC_STMT;
break; break;
case MYSQL_COM_SHUTDOWN: /**< 8 where should shutdown be routed ? */ case MYSQL_COM_SHUTDOWN: /**< 8 where should shutdown be routed ? */
@ -1923,7 +1926,8 @@ static bool select_connect_backend_servers(
} }
} }
} }
} } /*< log only */
/** /**
* Choose at least 1+min_nslaves (master and slave) and at most 1+max_nslaves * Choose at least 1+min_nslaves (master and slave) and at most 1+max_nslaves
* servers from the sorted list. First master found is selected. * servers from the sorted list. First master found is selected.
@ -2036,8 +2040,6 @@ static bool select_connect_backend_servers(
bref_set_state(&backend_ref[i], bref_set_state(&backend_ref[i],
BREF_IN_USE); BREF_IN_USE);
/** Increase backend connection counters */ /** Increase backend connection counters */
atomic_add(&b->backend_server->stats.n_current, 1);
atomic_add(&b->backend_server->stats.n_connections, 1);
atomic_add(&b->backend_conn_count, 1); atomic_add(&b->backend_conn_count, 1);
} }
else else
@ -2666,8 +2668,9 @@ static bool execute_sescmd_in_backend(
pthread_self(), pthread_self(),
dcb->fd, dcb->fd,
STRPACKETTYPE(cmd)))); STRPACKETTYPE(cmd))));
gwbuf_free(tmpbuf);
} }
#endif #endif /*< SS_DEBUG */
switch (scur->scmd_cur_cmd->my_sescmd_packet_type) { switch (scur->scmd_cur_cmd->my_sescmd_packet_type) {
case MYSQL_COM_CHANGE_USER: case MYSQL_COM_CHANGE_USER:
rc = dcb->func.auth( rc = dcb->func.auth(
@ -3065,7 +3068,7 @@ static bool router_option_configured(
} }
return succp; return succp;
} }
#endif #endif /*< NOT_USED */
static void rwsplit_process_router_options( static void rwsplit_process_router_options(
ROUTER_INSTANCE* router, ROUTER_INSTANCE* router,
@ -3346,7 +3349,7 @@ static void print_error_packet(
{ {
while ((buf = gwbuf_consume(buf, GWBUF_LENGTH(buf))) != NULL); while ((buf = gwbuf_consume(buf, GWBUF_LENGTH(buf))) != NULL);
} }
#endif #endif /*< SS_DEBUG */
} }
static int router_get_servercount( static int router_get_servercount(