Merge branch 'release-1.0beta-refresh' of https://github.com/skysql/MaxScale into release-1.0beta-refresh

This commit is contained in:
VilhoRaatikka 2014-09-12 14:11:29 +03:00
commit e618adb930
6 changed files with 37 additions and 7 deletions

View File

@ -375,23 +375,23 @@ char *stat;
if (ptr)
{
dcb_printf(dcb, "Servers.\n");
dcb_printf(dcb, "-------------------+-----------------+-------+----------------------+------------\n");
dcb_printf(dcb, "%-18s | %-15s | Port | %-20s | Connections\n",
dcb_printf(dcb, "-------------------+-----------------+-------+-------------+--------------------\n");
dcb_printf(dcb, "%-18s | %-15s | Port | Connections | %-20s",
"Server", "Address", "Status");
dcb_printf(dcb, "-------------------+-----------------+-------+----------------------+------------\n");
dcb_printf(dcb, "-------------------+-----------------+-------+-------------+--------------------\n");
}
while (ptr)
{
stat = server_status(ptr);
dcb_printf(dcb, "%-18s | %-15s | %5d | %-20s | %4d\n",
dcb_printf(dcb, "%-18s | %-15s | %5d | %11d | %s\n",
ptr->unique_name, ptr->name,
ptr->port, stat,
ptr->stats.n_current);
ptr->port,
ptr->stats.n_current, stat);
free(stat);
ptr = ptr->next;
}
if (allServers)
dcb_printf(dcb, "-------------------+-----------------+-------+----------------------+------------\n\n");
dcb_printf(dcb, "-------------------+-----------------+-------+-------------+--------------------\n");
spinlock_release(&server_spin);
}
@ -424,6 +424,8 @@ char *status = NULL;
strcat(status, "Slave of External Server, ");
if (server->status & SERVER_STALE_STATUS)
strcat(status, "Stale Status, ");
if (server->status & SERVER_AUTH_ERROR)
strcat(status, "Auth Error, ");
if (server->status & SERVER_RUNNING)
strcat(status, "Running");
else

View File

@ -694,6 +694,7 @@ int i;
return 0;
}
session->tail = *tail;
free(tail);
}
return 1;

View File

@ -105,6 +105,7 @@ typedef struct server {
#define SERVER_MAINT 0x0020 /**<< Server is in maintenance mode */
#define SERVER_SLAVE_OF_EXTERNAL_MASTER 0x0040 /**<< Server is slave of a Master outside the provided replication topology */
#define SERVER_STALE_STATUS 0x0080 /**<< Server stale status, monitor didn't update it */
#define SERVER_AUTH_ERROR 0x1000 /**<< Authentication erorr from monitor */
/**
* Is the server running - the macro returns true if the server is marked as running

View File

@ -335,10 +335,18 @@ char *server_string;
database->server->port,
mysql_error(database->con))));
server_clear_status(database->server, SERVER_RUNNING);
if (mysql_errno(database->con) == ER_ACCESS_DENIED_ERROR)
{
server_set_status(database->server, SERVER_AUTH_ERROR);
}
database->server->node_id = -1;
free(dpwd);
return;
}
else
{
server_clear_status(database->server, SERVER_AUTH_ERROR);
}
free(dpwd);
}

View File

@ -400,6 +400,11 @@ char *server_string;
* Store server NOT running in server and monitor server pending struct
*
*/
if (mysql_errno(database->con) == ER_ACCESS_DENIED_ERROR)
{
server_set_status(database->server, SERVER_AUTH_ERROR);
monitor_set_pending_status(database, SERVER_AUTH_ERROR);
}
server_clear_status(database->server, SERVER_RUNNING);
monitor_clear_pending_status(database, SERVER_RUNNING);
@ -417,6 +422,11 @@ char *server_string;
return;
}
else
{
server_clear_status(database->server, SERVER_AUTH_ERROR);
monitor_clear_pending_status(database, SERVER_AUTH_ERROR);
}
free(dpwd);
}
/* Store current status in both server and monitor server pending struct */

View File

@ -329,10 +329,18 @@ char *server_string;
database->server->port,
mysql_error(database->con))));
server_clear_status(database->server, SERVER_RUNNING);
if (mysql_errno(database->con) == ER_ACCESS_DENIED_ERROR)
{
server_set_status(database->server, SERVER_AUTH_ERROR);
}
database->server->node_id = -1;
free(dpwd);
return;
}
else
{
server_clear_status(database->server, SERVER_AUTH_ERROR);
}
free(dpwd);
}