Add server state helper functions

Added helper functions that check various server states. This makes the
readwritesplit code easier to read as the function names convey the
intention better than the macro invokations.
This commit is contained in:
Markus Mäkelä
2017-06-19 13:30:53 +03:00
parent 37b6cf250d
commit d7543988ee
4 changed files with 49 additions and 14 deletions

View File

@ -354,8 +354,8 @@ static bool reroute_stored_statement(ROUTER_CLIENT_SES *rses, const SRWBackend&
SRWBackend& backend = *it;
if (backend->in_use() && backend != old &&
!SERVER_IS_MASTER(backend->server()) &&
SERVER_IS_SLAVE(backend->server()))
!backend->is_master() &&
backend->is_slave())
{
/** Found a valid candidate; a non-master slave that's in use */
if (backend->write(stored))