Readwritesplit: Graceful maintenance mode

By allowing transactions to the master to end even if the server is in
maintenance mode makes it possible to terminate connections at a known
point. This helps prevent interrupted transactions which can help reduce
errors that are visible to the clients.
This commit is contained in:
Markus Mäkelä
2019-04-02 10:18:33 +03:00
parent 319d9fa1c5
commit 5242cd5ebf
4 changed files with 33 additions and 5 deletions

View File

@ -395,7 +395,7 @@ static void log_server_connections(select_criteria_t criteria, const PRWBackends
RWBackend* get_root_master(const PRWBackends& backends, RWBackend* current_master,
const BackendSelectFunction& func)
{
if (current_master && current_master->in_use() && current_master->is_master())
if (current_master && current_master->in_use() && can_continue_using_master(current_master))
{
return current_master;
}