Merge branch 'release-1.0beta-refresh' of https://github.com/skysql/MaxScale into release-1.0beta-refresh
This commit is contained in:
@ -375,23 +375,23 @@ char *stat;
|
|||||||
if (ptr)
|
if (ptr)
|
||||||
{
|
{
|
||||||
dcb_printf(dcb, "Servers.\n");
|
dcb_printf(dcb, "Servers.\n");
|
||||||
dcb_printf(dcb, "-------------------+-----------------+-------+----------------------+------------\n");
|
dcb_printf(dcb, "-------------------+-----------------+-------+-------------+--------------------\n");
|
||||||
dcb_printf(dcb, "%-18s | %-15s | Port | %-20s | Connections\n",
|
dcb_printf(dcb, "%-18s | %-15s | Port | Connections | %-20s",
|
||||||
"Server", "Address", "Status");
|
"Server", "Address", "Status");
|
||||||
dcb_printf(dcb, "-------------------+-----------------+-------+----------------------+------------\n");
|
dcb_printf(dcb, "-------------------+-----------------+-------+-------------+--------------------\n");
|
||||||
}
|
}
|
||||||
while (ptr)
|
while (ptr)
|
||||||
{
|
{
|
||||||
stat = server_status(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->unique_name, ptr->name,
|
||||||
ptr->port, stat,
|
ptr->port,
|
||||||
ptr->stats.n_current);
|
ptr->stats.n_current, stat);
|
||||||
free(stat);
|
free(stat);
|
||||||
ptr = ptr->next;
|
ptr = ptr->next;
|
||||||
}
|
}
|
||||||
if (allServers)
|
if (allServers)
|
||||||
dcb_printf(dcb, "-------------------+-----------------+-------+----------------------+------------\n\n");
|
dcb_printf(dcb, "-------------------+-----------------+-------+-------------+--------------------\n");
|
||||||
spinlock_release(&server_spin);
|
spinlock_release(&server_spin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -424,6 +424,8 @@ char *status = NULL;
|
|||||||
strcat(status, "Slave of External Server, ");
|
strcat(status, "Slave of External Server, ");
|
||||||
if (server->status & SERVER_STALE_STATUS)
|
if (server->status & SERVER_STALE_STATUS)
|
||||||
strcat(status, "Stale Status, ");
|
strcat(status, "Stale Status, ");
|
||||||
|
if (server->status & SERVER_AUTH_ERROR)
|
||||||
|
strcat(status, "Auth Error, ");
|
||||||
if (server->status & SERVER_RUNNING)
|
if (server->status & SERVER_RUNNING)
|
||||||
strcat(status, "Running");
|
strcat(status, "Running");
|
||||||
else
|
else
|
||||||
|
|||||||
@ -694,6 +694,7 @@ int i;
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
session->tail = *tail;
|
session->tail = *tail;
|
||||||
|
free(tail);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@ -105,6 +105,7 @@ typedef struct server {
|
|||||||
#define SERVER_MAINT 0x0020 /**<< Server is in maintenance mode */
|
#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_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_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
|
* Is the server running - the macro returns true if the server is marked as running
|
||||||
|
|||||||
@ -335,10 +335,18 @@ char *server_string;
|
|||||||
database->server->port,
|
database->server->port,
|
||||||
mysql_error(database->con))));
|
mysql_error(database->con))));
|
||||||
server_clear_status(database->server, SERVER_RUNNING);
|
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;
|
database->server->node_id = -1;
|
||||||
free(dpwd);
|
free(dpwd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
server_clear_status(database->server, SERVER_AUTH_ERROR);
|
||||||
|
}
|
||||||
free(dpwd);
|
free(dpwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -400,6 +400,11 @@ char *server_string;
|
|||||||
* Store server NOT running in server and monitor server pending struct
|
* 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);
|
server_clear_status(database->server, SERVER_RUNNING);
|
||||||
monitor_clear_pending_status(database, SERVER_RUNNING);
|
monitor_clear_pending_status(database, SERVER_RUNNING);
|
||||||
|
|
||||||
@ -417,6 +422,11 @@ char *server_string;
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
server_clear_status(database->server, SERVER_AUTH_ERROR);
|
||||||
|
monitor_clear_pending_status(database, SERVER_AUTH_ERROR);
|
||||||
|
}
|
||||||
free(dpwd);
|
free(dpwd);
|
||||||
}
|
}
|
||||||
/* Store current status in both server and monitor server pending struct */
|
/* Store current status in both server and monitor server pending struct */
|
||||||
|
|||||||
@ -329,10 +329,18 @@ char *server_string;
|
|||||||
database->server->port,
|
database->server->port,
|
||||||
mysql_error(database->con))));
|
mysql_error(database->con))));
|
||||||
server_clear_status(database->server, SERVER_RUNNING);
|
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;
|
database->server->node_id = -1;
|
||||||
free(dpwd);
|
free(dpwd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
server_clear_status(database->server, SERVER_AUTH_ERROR);
|
||||||
|
}
|
||||||
free(dpwd);
|
free(dpwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user