mirror of
https://gitee.com/wangbin579/cetus.git
synced 2024-12-03 12:27:42 +08:00
modify log level
This commit is contained in:
parent
69c249d592
commit
eec2674e8f
@ -192,34 +192,34 @@ group_replication_detect(network_backends_t *bs, cetus_monitor_t *monitor)
|
||||
gchar old_master[ADDRESS_LEN] = {""};
|
||||
|
||||
if(conn == NULL) {
|
||||
g_debug("get connection failed. error: %d, text: %s, backend: %s",
|
||||
g_message("get connection failed. error: %d, text: %s, backend: %s",
|
||||
mysql_errno(conn), mysql_error(conn), backend_addr);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(mysql_real_query(conn, L(sql1))) {
|
||||
g_debug("select primary info failed for group_replication. error: %d, text: %s, backend: %s",
|
||||
g_message("select primary info failed for group_replication. error: %d, text: %s, backend: %s",
|
||||
mysql_errno(conn), mysql_error(conn), backend_addr);
|
||||
continue;
|
||||
}
|
||||
|
||||
rs_set = mysql_store_result(conn);
|
||||
if(rs_set == NULL) {
|
||||
g_debug("get primary info result set failed for group_replication. error: %d, text: %s, backend: %s",
|
||||
g_message("get primary info result set failed for group_replication. error: %d, text: %s, backend: %s",
|
||||
mysql_errno(conn), mysql_error(conn), backend_addr);
|
||||
continue;
|
||||
}
|
||||
|
||||
row = mysql_fetch_row(rs_set);
|
||||
if(row == NULL || row[0] == NULL || row[1] == NULL) {
|
||||
g_debug("get primary info rows failed for group_replication. error: %d, text: %s, backend: %s",
|
||||
g_message("get primary info rows failed for group_replication. error: %d, text: %s, backend: %s",
|
||||
mysql_errno(conn), mysql_error(conn), backend_addr);
|
||||
mysql_free_result(rs_set);
|
||||
continue;
|
||||
}
|
||||
|
||||
if((get_ip_by_name(row[0], ip) != 0) || ip[0] == '\0') {
|
||||
g_debug("get master ip by name failed. error: %d, text: %s, backend: %s",
|
||||
g_message("get master ip by name failed. error: %d, text: %s, backend: %s",
|
||||
mysql_errno(conn), mysql_error(conn), backend_addr);
|
||||
mysql_free_result(rs_set);
|
||||
continue;
|
||||
@ -241,7 +241,7 @@ group_replication_detect(network_backends_t *bs, cetus_monitor_t *monitor)
|
||||
rs_set = NULL;
|
||||
|
||||
if(master_addr[0] == '\0') {
|
||||
g_debug("get master address failed. error: %d, text: %s, backend: %s",
|
||||
g_message("get master address failed. error: %d, text: %s, backend: %s",
|
||||
mysql_errno(conn), mysql_error(conn), backend_addr);
|
||||
continue;
|
||||
}
|
||||
@ -249,28 +249,28 @@ group_replication_detect(network_backends_t *bs, cetus_monitor_t *monitor)
|
||||
if(strcasecmp(backend_addr, master_addr)) {
|
||||
conn = get_mysql_connection(monitor, master_addr);
|
||||
if(conn == NULL) {
|
||||
g_debug("get connection failed. error: %d, text: %s, backend: %s",
|
||||
g_message("get connection failed. error: %d, text: %s, backend: %s",
|
||||
mysql_errno(conn), mysql_error(conn), master_addr);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(mysql_real_query(conn, L(sql2))) {
|
||||
g_debug("select slave info failed for group_replication. error: %d, text: %s, backend: %s",
|
||||
g_message("select slave info failed for group_replication. error: %d, text: %s, backend: %s",
|
||||
mysql_errno(conn), mysql_error(conn), master_addr);
|
||||
continue;
|
||||
}
|
||||
|
||||
rs_set = mysql_store_result(conn);
|
||||
if(rs_set == NULL) {
|
||||
g_debug("get slave info result set failed for group_replication. error: %d, text: %s",
|
||||
g_message("get slave info result set failed for group_replication. error: %d, text: %s",
|
||||
mysql_errno(conn), mysql_error(conn));
|
||||
continue;
|
||||
}
|
||||
while(row=mysql_fetch_row(rs_set)) {
|
||||
memset(ip, 0, ADDRESS_LEN);
|
||||
if((get_ip_by_name(row[0], ip) != 0) || ip[0] == '\0') {
|
||||
g_debug("get slave ip by name failed. error: %d, text: %s",
|
||||
g_message("get slave ip by name failed. error: %d, text: %s",
|
||||
mysql_errno(conn), mysql_error(conn));
|
||||
mysql_free_result(rs_set);
|
||||
continue;
|
||||
@ -279,9 +279,9 @@ group_replication_detect(network_backends_t *bs, cetus_monitor_t *monitor)
|
||||
snprintf(slave_addr, ADDRESS_LEN, "%s:%s", ip, row[1]);
|
||||
if(slave_addr[0] != '\0') {
|
||||
slave_list = g_list_append(slave_list, strdup(slave_addr));
|
||||
g_debug("add slave %s in list, %d", slave_addr, g_list_length(slave_list));
|
||||
g_message("add slave %s in list, %d", slave_addr, g_list_length(slave_list));
|
||||
} else {
|
||||
g_debug("get slave address failed. error: %d, text: %s",
|
||||
g_message("get slave address failed. error: %d, text: %s",
|
||||
mysql_errno(conn), mysql_error(conn));
|
||||
}
|
||||
}
|
||||
|
@ -1314,9 +1314,12 @@ gchar* show_sql_log_maxsize(gpointer param) {
|
||||
struct external_param *opt_param = (struct external_param *)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)) {
|
||||
if (CAN_SHOW_OPTS_PROPERTY(opt_type)) {
|
||||
return g_strdup_printf("%u M", srv->sql_mgr->sql_log_maxsize);
|
||||
}
|
||||
if (CAN_SAVE_OPTS_PROPERTY(opt_type)) {
|
||||
return g_strdup_printf("%u", srv->sql_mgr->sql_log_maxsize);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user