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:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user