MXS-2313: Fix candidate selection
If a master with a better rank and a slave with a worse rank were available and master_accept_reads wasn't enabled, the slave would be preferred over the master. The check for master_accept_reads was done twice and also in the wrong place.
This commit is contained in:
parent
b2bf4d125b
commit
6befc7f7d4
@ -672,7 +672,7 @@ RWBackend* RWSplitSession::get_slave_backend(int max_rlag)
|
||||
{
|
||||
bool can_take_slave_into_use = !backend->in_use() && can_recover_servers()
|
||||
&& backend->can_connect() && counts.second < m_router->max_slave_count()
|
||||
&& (backend->is_slave() || (backend->is_master() && m_config.master_accept_reads));
|
||||
&& (backend->is_slave() || backend->is_master());
|
||||
|
||||
bool master_or_slave = backend->is_master() || backend->is_slave();
|
||||
bool is_usable = backend->in_use() || can_take_slave_into_use;
|
||||
|
Loading…
x
Reference in New Issue
Block a user