MXS-2919: Don't use slaves with unknown lag
If a limit on the replication lag is configured, servers with unmeasured replication lag should not be used. The code in question did use them even when a limit was set as the value used for undefined lag was -1 which always measured lower than the limit.
This commit is contained in:
@ -472,5 +472,6 @@ std::string extract_error(GWBUF* buffer);
|
|||||||
*/
|
*/
|
||||||
static inline bool rpl_lag_is_ok(mxs::RWBackend* backend, int max_rlag)
|
static inline bool rpl_lag_is_ok(mxs::RWBackend* backend, int max_rlag)
|
||||||
{
|
{
|
||||||
return max_rlag == SERVER::RLAG_UNDEFINED || backend->server()->rlag <= max_rlag;
|
auto rlag = backend->server()->rlag;
|
||||||
|
return max_rlag == SERVER::RLAG_UNDEFINED || (rlag != SERVER::RLAG_UNDEFINED && rlag <= max_rlag);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user