Fix warnings and problems related to server timeout revealed by tcpcopy

This commit is contained in:
wangbin579 2018-08-13 11:05:20 +08:00
parent bd9ca0e41c
commit dcd3305d54
4 changed files with 18 additions and 10 deletions

View File

@ -1858,7 +1858,7 @@ void admin_sql_log_status(network_mysqld_con* con) {
cached = g_strdup("NULL");
}
APPEND_ROW_3_COL(rows, "sql-log-cached", cached, "Internal");
gchar *cursize = g_strdup_printf("%u", con->srv->sql_mgr->sql_log_cursize);
gchar *cursize = g_strdup_printf("%d", con->srv->sql_mgr->sql_log_cursize);
APPEND_ROW_3_COL(rows, "sql-log-cursize", cursize, "Internal");
network_mysqld_con_send_resultset(con->client, fields, rows);

View File

@ -1296,7 +1296,7 @@ gchar* show_sql_log_maxsize(gpointer param) {
chassis *srv = opt_param->chas;
gint opt_type = opt_param->opt_type;
if (CAN_SHOW_OPTS_PROPERTY(opt_type) || CAN_SAVE_OPTS_PROPERTY(opt_type)) {
return g_strdup_printf("%u M", srv->sql_mgr->sql_log_maxsize);
return g_strdup_printf("%d M", srv->sql_mgr->sql_log_maxsize);
}
return NULL;
}

View File

@ -53,20 +53,21 @@ struct rfifo {
};
struct sql_log_mgr {
gchar *sql_log_filename;
guint sql_log_bufsize;
SQL_LOG_SWITCH sql_log_switch;
SQL_LOG_MODE sql_log_mode;
gchar *sql_log_path;
gulong sql_log_maxsize;
gint sql_log_maxsize;
gint sql_log_cursize;
volatile guint sql_log_action;
volatile SQL_LOG_ACTION sql_log_idletime;
volatile guint sql_log_maxnum;
gchar *sql_log_filename;
gchar *sql_log_path;
GThread *thread;
FILE *sql_log_fp;
gulong sql_log_cursize;
gchar *sql_log_fullname;
volatile guint sql_log_action;
struct rfifo *fifo;
GQueue *sql_log_filelist;
};

View File

@ -2992,12 +2992,14 @@ check_server_status(network_mysqld_con *con, int *srv_down_count, int *srv_respo
server_session_t *ss = g_ptr_array_index(con->servers, i);
if (!ss->participated) {
g_debug("%s: server not participated", G_STRLOC);
g_debug("%s: server:%d is not participated for con:%p",
G_STRLOC, i, con);
continue;
}
network_socket *server = ss->server;
if (server->unavailable) {
g_debug("%s: server:%d is unavailable for con:%p", G_STRLOC, i, con);
(*srv_down_count)++;
continue;
}
@ -3076,9 +3078,13 @@ disp_resp_workers_not_matched(network_mysqld_con *con, int *disp_flag)
if (con->is_attr_adjust) {
g_critical("%s: attr adj met problems here for con:%p", G_STRLOC, con);
con->server_to_be_closed = 1;
} else if (con->is_timeout) {
g_critical("%s: server timeout for con:%p", G_STRLOC, con);
con->server_to_be_closed = 1;
} else {
if (con->dist_tran_state < NEXT_ST_XA_CANDIDATE_OVER) {
g_debug("%s: build xa stmt for failure, state:%d", G_STRLOC, con->state);
g_debug("%s: build xa stmt for failure, dist state:%d",
G_STRLOC, con->dist_tran_state);
build_xa_statements(con);
if (con->dist_tran_state != NEXT_ST_XA_OVER) {
*disp_flag = DISP_CONTINUE;
@ -3317,7 +3323,8 @@ disp_after_resp(network_mysqld_con *con, int srv_down_count, int srv_response_co
static int
handle_read_mul_servers_resp(network_mysqld_con *con)
{
g_debug("%s: visit handle_read_mul_servers_resp for con:%p", G_STRLOC, con);
g_debug("%s: visit handle_read_mul_servers_resp for con:%p, num pending:%d",
G_STRLOC, con, con->num_read_pending);
int disp_flag = 0;
int srv_down_count = 0, srv_response_count = 0;