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:
Markus Mäkelä 2020-07-03 08:28:33 +03:00
parent 9e91cfdded
commit 4fe71b41ed
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499

View File

@ -507,7 +507,8 @@ bool RWSplitSession::open_connections()
for (auto& backend : m_raw_backends)
{
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);
}