MXS-2011 Lock router only when needed
This commit is contained in:
@ -4185,13 +4185,6 @@ int blr_handle_change_master(ROUTER_INSTANCE* router,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
MasterServerConfig current_master;
|
|
||||||
|
|
||||||
spinlock_acquire(&router->lock);
|
|
||||||
|
|
||||||
/* save current config option data */
|
|
||||||
blr_master_get_config(router, ¤t_master);
|
|
||||||
|
|
||||||
/* Abort if MASTER_USE_GTID is in use and
|
/* Abort if MASTER_USE_GTID is in use and
|
||||||
* router->mariadb10_master_gtid is not set
|
* router->mariadb10_master_gtid is not set
|
||||||
*/
|
*/
|
||||||
@ -4204,8 +4197,6 @@ int blr_handle_change_master(ROUTER_INSTANCE* router,
|
|||||||
|
|
||||||
MXS_ERROR("%s: %s", router->service->name, error);
|
MXS_ERROR("%s: %s", router->service->name, error);
|
||||||
|
|
||||||
spinlock_release(&router->lock);
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4231,8 +4222,6 @@ int blr_handle_change_master(ROUTER_INSTANCE* router,
|
|||||||
|
|
||||||
MXS_ERROR("%s: %s", router->service->name, error);
|
MXS_ERROR("%s: %s", router->service->name, error);
|
||||||
|
|
||||||
spinlock_release(&router->lock);
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4253,12 +4242,17 @@ int blr_handle_change_master(ROUTER_INSTANCE* router,
|
|||||||
|
|
||||||
MXS_ERROR("%s: %s", router->service->name, error);
|
MXS_ERROR("%s: %s", router->service->name, error);
|
||||||
|
|
||||||
spinlock_release(&router->lock);
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MasterServerConfig current_master;
|
||||||
|
|
||||||
|
spinlock_acquire(&router->lock);
|
||||||
|
|
||||||
|
/* save current config option data */
|
||||||
|
blr_master_get_config(router, ¤t_master);
|
||||||
|
|
||||||
/* Change the heartbeat */
|
/* Change the heartbeat */
|
||||||
if (h_val != -1)
|
if (h_val != -1)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user