Added missing spinlock calls to all monitors.
This commit is contained in:
@ -133,8 +133,10 @@ MONITOR *ptr;
|
|||||||
void
|
void
|
||||||
monitorStart(MONITOR *monitor, void* params)
|
monitorStart(MONITOR *monitor, void* params)
|
||||||
{
|
{
|
||||||
|
spinlock_acquire(&monitor->lock);
|
||||||
monitor->handle = (*monitor->module->startMonitor)(monitor,params);
|
monitor->handle = (*monitor->module->startMonitor)(monitor,params);
|
||||||
monitor->state = MONITOR_STATE_RUNNING;
|
monitor->state = MONITOR_STATE_RUNNING;
|
||||||
|
spinlock_release(&monitor->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -405,15 +405,19 @@ static void
|
|||||||
monitorMain(void *arg)
|
monitorMain(void *arg)
|
||||||
{
|
{
|
||||||
MONITOR* mon = (MONITOR*)arg;
|
MONITOR* mon = (MONITOR*)arg;
|
||||||
GALERA_MONITOR *handle = (GALERA_MONITOR *)mon->handle;
|
GALERA_MONITOR *handle;
|
||||||
MONITOR_SERVERS *ptr;
|
MONITOR_SERVERS *ptr;
|
||||||
size_t nrounds = 0;
|
size_t nrounds = 0;
|
||||||
MONITOR_SERVERS *candidate_master = NULL;
|
MONITOR_SERVERS *candidate_master = NULL;
|
||||||
int master_stickiness = handle->disableMasterFailback;
|
int master_stickiness;
|
||||||
int is_cluster=0;
|
int is_cluster=0;
|
||||||
int log_no_members = 1;
|
int log_no_members = 1;
|
||||||
monitor_event_t evtype;
|
monitor_event_t evtype;
|
||||||
|
|
||||||
|
spinlock_acquire(&mon->lock);
|
||||||
|
handle = (GALERA_MONITOR *)mon->handle;
|
||||||
|
spinlock_release(&mon->lock);
|
||||||
|
master_stickiness = handle->disableMasterFailback;
|
||||||
if (mysql_thread_init())
|
if (mysql_thread_init())
|
||||||
{
|
{
|
||||||
LOGIF(LE, (skygw_log_write_flush(
|
LOGIF(LE, (skygw_log_write_flush(
|
||||||
|
@ -494,12 +494,17 @@ static void
|
|||||||
monitorMain(void *arg)
|
monitorMain(void *arg)
|
||||||
{
|
{
|
||||||
MONITOR* mon = (MONITOR*)arg;
|
MONITOR* mon = (MONITOR*)arg;
|
||||||
MM_MONITOR *handle = (MM_MONITOR *)mon->handle;
|
MM_MONITOR *handle;
|
||||||
MONITOR_SERVERS *ptr;
|
MONITOR_SERVERS *ptr;
|
||||||
int detect_stale_master = handle->detectStaleMaster;
|
int detect_stale_master;
|
||||||
MONITOR_SERVERS *root_master;
|
MONITOR_SERVERS *root_master;
|
||||||
size_t nrounds = 0;
|
size_t nrounds = 0;
|
||||||
|
|
||||||
|
spinlock_acquire(&mon->lock);
|
||||||
|
handle = (MM_MONITOR *)mon->handle;
|
||||||
|
spinlock_release(&mon->lock);
|
||||||
|
detect_stale_master = handle->detectStaleMaster;
|
||||||
|
|
||||||
if (mysql_thread_init())
|
if (mysql_thread_init())
|
||||||
{
|
{
|
||||||
LOGIF(LE, (skygw_log_write_flush(
|
LOGIF(LE, (skygw_log_write_flush(
|
||||||
|
@ -507,15 +507,21 @@ static void
|
|||||||
monitorMain(void *arg)
|
monitorMain(void *arg)
|
||||||
{
|
{
|
||||||
MONITOR* mon = (MONITOR*) arg;
|
MONITOR* mon = (MONITOR*) arg;
|
||||||
MYSQL_MONITOR *handle = (MYSQL_MONITOR *)mon->handle;
|
MYSQL_MONITOR *handle;
|
||||||
MONITOR_SERVERS *ptr;
|
MONITOR_SERVERS *ptr;
|
||||||
int replication_heartbeat = handle->replicationHeartbeat;
|
int replication_heartbeat;
|
||||||
int detect_stale_master = handle->detectStaleMaster;
|
int detect_stale_master;
|
||||||
int num_servers=0;
|
int num_servers=0;
|
||||||
MONITOR_SERVERS *root_master = NULL;
|
MONITOR_SERVERS *root_master = NULL;
|
||||||
size_t nrounds = 0;
|
size_t nrounds = 0;
|
||||||
int log_no_master = 1;
|
int log_no_master = 1;
|
||||||
|
|
||||||
|
spinlock_acquire(&mon->lock);
|
||||||
|
handle = (MYSQL_MONITOR *)mon->handle;
|
||||||
|
spinlock_release(&mon->lock);
|
||||||
|
replication_heartbeat = handle->replicationHeartbeat;
|
||||||
|
detect_stale_master = handle->detectStaleMaster;
|
||||||
|
|
||||||
if (mysql_thread_init())
|
if (mysql_thread_init())
|
||||||
{
|
{
|
||||||
LOGIF(LE, (skygw_log_write_flush(
|
LOGIF(LE, (skygw_log_write_flush(
|
||||||
|
@ -346,10 +346,14 @@ static void
|
|||||||
monitorMain(void *arg)
|
monitorMain(void *arg)
|
||||||
{
|
{
|
||||||
MONITOR* mon = arg;
|
MONITOR* mon = arg;
|
||||||
MYSQL_MONITOR *handle = (MYSQL_MONITOR *)mon->handle;
|
MYSQL_MONITOR *handle;
|
||||||
MONITOR_SERVERS *ptr;
|
MONITOR_SERVERS *ptr;
|
||||||
size_t nrounds = 0;
|
size_t nrounds = 0;
|
||||||
|
|
||||||
|
spinlock_acquire(&mon->lock);
|
||||||
|
handle = (MYSQL_MONITOR *)mon->handle;
|
||||||
|
spinlock_release(&mon->lock);
|
||||||
|
|
||||||
if (mysql_thread_init())
|
if (mysql_thread_init())
|
||||||
{
|
{
|
||||||
LOGIF(LE, (skygw_log_write_flush(
|
LOGIF(LE, (skygw_log_write_flush(
|
||||||
|
Reference in New Issue
Block a user