diff --git a/plugins/shard/shard-plugin.c b/plugins/shard/shard-plugin.c index 1ffec69..8cf893b 100644 --- a/plugins/shard/shard-plugin.c +++ b/plugins/shard/shard-plugin.c @@ -1294,6 +1294,11 @@ proxy_get_pooled_connection(network_mysqld_con *con, if (type == BACKEND_TYPE_RW) { backend = backend_group->master; /* may be NULL if master down */ if (!backend || (backend->state != BACKEND_STATE_UP && backend->state != BACKEND_STATE_UNKNOWN)) { + if (backend) { + g_message("%s: backend->state:%d", G_STRLOC, backend->state); + } else { + g_message("%s: backend is nil", G_STRLOC); + } *server_unavailable = 1; return FALSE; } @@ -1313,6 +1318,7 @@ proxy_get_pooled_connection(network_mysqld_con *con, con->slave_conn_shortaged = 1; } + g_message("%s: conn shortaged, type:%d", G_STRLOC, type); return FALSE; } diff --git a/src/network-mysqld.c b/src/network-mysqld.c index 075107b..7dd48b1 100644 --- a/src/network-mysqld.c +++ b/src/network-mysqld.c @@ -2327,7 +2327,6 @@ handle_query_wait_stats(network_mysqld_con *con) static void process_service_unavailable(network_mysqld_con *con) { - con->state = ST_SEND_QUERY_RESULT; g_message("%s: service unavailable for con:%p", G_STRLOC, con); @@ -2342,6 +2341,7 @@ process_service_unavailable(network_mysqld_con *con) con->server_to_be_closed = 1; con->dist_tran = 0; + con->is_in_transaction = 0; } #ifndef SIMPLE_PARSER if (con->servers != NULL) {