Merge branch '2.3' into develop
This commit is contained in:
commit
381940ce8c
@ -277,37 +277,41 @@ void GaleraMonitor::update_server_status(MonitorServer* monitored_server)
|
||||
/* Node is in desync - lets take it offline */
|
||||
if (strcmp(row[0], "wsrep_desync") == 0)
|
||||
{
|
||||
if (strcasecmp(row[1],"YES") || strcasecmp(row[1],"ON") || strcasecmp(row[1],"1") || strcasecmp(row[1],"true"))
|
||||
{
|
||||
info.joined = 0;
|
||||
}
|
||||
if (strcasecmp(row[1], "YES") == 0 || strcasecmp(row[1], "ON") == 0
|
||||
|| strcasecmp(row[1], "1") == 0 || strcasecmp(row[1], "true") == 0)
|
||||
{
|
||||
info.joined = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Node rejects queries - lets take it offline */
|
||||
if (strcmp(row[0], "wsrep_reject_queries") == 0)
|
||||
{
|
||||
if (strcasecmp(row[1],"ALL") || strcasecmp(row[1],"ALL_KILL"))
|
||||
{
|
||||
info.joined = 0;
|
||||
}
|
||||
if (strcasecmp(row[1], "ALL") == 0
|
||||
|| strcasecmp(row[1], "ALL_KILL") == 0)
|
||||
{
|
||||
info.joined = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Node rejects queries - lets take it offline */
|
||||
if (strcmp(row[0], "wsrep_sst_donor_rejects_queries") == 0)
|
||||
{
|
||||
if (strcasecmp(row[1],"YES") || strcasecmp(row[1],"ON") || strcasecmp(row[1],"1") || strcasecmp(row[1],"true"))
|
||||
{
|
||||
info.joined = 0;
|
||||
}
|
||||
if (strcasecmp(row[1], "YES") == 0 || strcasecmp(row[1], "ON") == 0
|
||||
|| strcasecmp(row[1], "1") == 0 || strcasecmp(row[1], "true") == 0)
|
||||
{
|
||||
info.joined = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Node is not ready - lets take it offline */
|
||||
if (strcmp(row[0], "wsrep_ready") == 0)
|
||||
{
|
||||
if (strcasecmp(row[1],"NO") || strcasecmp(row[1],"OFF") || strcasecmp(row[1],"0") || strcasecmp(row[1],"false"))
|
||||
{
|
||||
info.joined = 0;
|
||||
}
|
||||
if (strcasecmp(row[1], "NO") == 0 || strcasecmp(row[1], "OFF") == 0
|
||||
|| strcasecmp(row[1], "0") == 0 || strcasecmp(row[1], "false") == 0)
|
||||
{
|
||||
info.joined = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(row[0], "wsrep_cluster_state_uuid") == 0 && row[1] && *row[1])
|
||||
|
@ -243,7 +243,7 @@ bool file_in_dir(const char* dir, const char* file)
|
||||
*/
|
||||
void AvroSession::queue_client_callback()
|
||||
{
|
||||
auto worker = mxs::RoutingWorker::get(mxs::RoutingWorker::MAIN);
|
||||
auto worker = static_cast<mxs::RoutingWorker*>(dcb->owner);
|
||||
worker->execute([this]() {
|
||||
client_callback();
|
||||
}, mxs::RoutingWorker::EXECUTE_QUEUED);
|
||||
|
@ -242,7 +242,7 @@ static int blr_slave_send_columndef_with_status_schema(ROUTER_INSTANCE* router,
|
||||
int len,
|
||||
uint8_t seqno);
|
||||
static bool blr_send_slave_heartbeat(void* inst);
|
||||
static int blr_slave_send_heartbeat(ROUTER_INSTANCE* router,
|
||||
static void blr_slave_send_heartbeat(ROUTER_INSTANCE* router,
|
||||
ROUTER_SLAVE* slave);
|
||||
static int blr_set_master_ssl(ROUTER_INSTANCE* router,
|
||||
const ChangeMasterConfig& config,
|
||||
@ -6205,13 +6205,11 @@ static bool blr_send_slave_heartbeat(void* inst)
|
||||
sptr->heartbeat,
|
||||
(unsigned long)sptr->lastReply);
|
||||
|
||||
if (blr_slave_send_heartbeat(router, sptr))
|
||||
{
|
||||
/* Set last event */
|
||||
sptr->lastEventReceived = HEARTBEAT_EVENT;
|
||||
/* Set last time */
|
||||
sptr->lastReply = t_now;
|
||||
}
|
||||
blr_slave_send_heartbeat(router, sptr);
|
||||
/* Set last event */
|
||||
sptr->lastEventReceived = HEARTBEAT_EVENT;
|
||||
/* Set last time */
|
||||
sptr->lastReply = t_now;
|
||||
}
|
||||
|
||||
sptr = sptr->next;
|
||||
@ -6229,7 +6227,7 @@ static bool blr_send_slave_heartbeat(void* inst)
|
||||
* @param slave The current slave connection
|
||||
* @return Number of bytes sent or 0 in case of failure
|
||||
*/
|
||||
static int blr_slave_send_heartbeat(ROUTER_INSTANCE* router, ROUTER_SLAVE* slave)
|
||||
static void send_heartbeat(ROUTER_INSTANCE* router, ROUTER_SLAVE* slave)
|
||||
{
|
||||
REP_HEADER hdr;
|
||||
GWBUF* h_event;
|
||||
@ -6256,10 +6254,7 @@ static int blr_slave_send_heartbeat(ROUTER_INSTANCE* router, ROUTER_SLAVE* slave
|
||||
*
|
||||
* Total = 5 bytes + len
|
||||
*/
|
||||
if ((h_event = gwbuf_alloc(MYSQL_HEADER_LEN + 1 + len)) == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
h_event = gwbuf_alloc(MYSQL_HEADER_LEN + 1 + len);
|
||||
|
||||
/* The OK/Err byte is part of payload */
|
||||
hdr.payload_len = len + 1;
|
||||
@ -6307,11 +6302,18 @@ static int blr_slave_send_heartbeat(ROUTER_INSTANCE* router, ROUTER_SLAVE* slave
|
||||
}
|
||||
|
||||
/* Write the packet */
|
||||
mxs::RoutingWorker* worker = (mxs::RoutingWorker*)slave->dcb->owner;
|
||||
mxs::RoutingWorker* worker = static_cast<mxs::RoutingWorker*>(slave->dcb->owner);
|
||||
worker->execute([slave, h_event]() {
|
||||
MXS_SESSION_ROUTE_REPLY(slave->dcb->session, h_event);
|
||||
}, mxs::RoutingWorker::EXECUTE_AUTO);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void blr_slave_send_heartbeat(ROUTER_INSTANCE* router, ROUTER_SLAVE* slave)
|
||||
{
|
||||
mxs::RoutingWorker* worker = static_cast<mxs::RoutingWorker*>(slave->dcb->owner);
|
||||
worker->execute([router, slave]() {
|
||||
send_heartbeat(router, slave);
|
||||
}, mxs::RoutingWorker::EXECUTE_AUTO);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user