Remove unnecessary SConfig from readwritesplit

The configuration doesn't need to be contained in shared pointer as each
session holds its own version of it. This removes most of the overhead in
configuration reloading. The only thing that's left is any overhead added
by the use of thread-local storage.
This commit is contained in:
Markus Mäkelä
2018-08-01 10:25:15 +03:00
parent 403b9e09f5
commit c01840ffb3
7 changed files with 116 additions and 117 deletions

View File

@ -301,16 +301,16 @@ bool RWSplit::select_connect_backend_servers(MXS_SESSION *session,
connection_type type)
{
SRWBackend master = get_root_master(backends);
SConfig cnf(config());
Config cnf(config());
if (!master && cnf->master_failure_mode == RW_FAIL_INSTANTLY)
if (!master && cnf.master_failure_mode == RW_FAIL_INSTANTLY)
{
MXS_ERROR("Couldn't find suitable Master from %lu candidates.", backends.size());
return false;
}
/** Check slave selection criteria and set compare function */
select_criteria_t select_criteria = cnf->slave_selection_criteria;
select_criteria_t select_criteria = cnf.slave_selection_criteria;
auto cmpfun = criteria_cmpfun[select_criteria];
ss_dassert(cmpfun);