MXS-3038: Don't connect to lagging slaves
There's no use connecting to a lagging slave if a replication lag limit has been set.
This commit is contained in:
@ -507,7 +507,8 @@ bool RWSplitSession::open_connections()
|
|||||||
for (auto& backend : m_raw_backends)
|
for (auto& backend : m_raw_backends)
|
||||||
{
|
{
|
||||||
if (!backend->in_use() && backend->can_connect() && valid_for_slave(backend, master)
|
if (!backend->in_use() && backend->can_connect() && valid_for_slave(backend, master)
|
||||||
&& backend->server()->rank() == current_rank)
|
&& backend->server()->rank() == current_rank
|
||||||
|
&& rpl_lag_is_ok(backend, get_max_replication_lag()))
|
||||||
{
|
{
|
||||||
candidates.push_back(backend);
|
candidates.push_back(backend);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user