MXS-1503: Remove redundant code
Moved session command execution into the Backend class itself as the session commands are defined as a related part of it. This allows all connections to execute session commands if some are available. Removed explicit SERVER_REF usage in the readwritesplit connection creation code and replaced it with SRWBackend. This allows the removal of the get_root_master_backend function which duplicated the functionality in get_root_master.
This commit is contained in:
@ -441,8 +441,7 @@ static bool handle_error_new_connection(RWSplit *inst,
|
||||
}
|
||||
else
|
||||
{
|
||||
succp = select_connect_backend_servers(myrses->rses_nbackends, max_nslaves,
|
||||
ses, inst->config(), myrses->backends,
|
||||
succp = select_connect_backend_servers(inst, ses, myrses->backends,
|
||||
myrses->current_master, &myrses->sescmd_list,
|
||||
&myrses->expected_responses,
|
||||
connection_type::SLAVE);
|
||||
@ -770,8 +769,7 @@ RWSplitSession* RWSplitSession::create(RWSplit* router, MXS_SESSION* session)
|
||||
|
||||
SRWBackend master;
|
||||
|
||||
if (select_connect_backend_servers(router->service()->n_dbref, router->max_slave_count(),
|
||||
session, router->config(), backends, master,
|
||||
if (select_connect_backend_servers(router, session, backends, master,
|
||||
NULL, NULL, connection_type::ALL))
|
||||
{
|
||||
if ((rses = new RWSplitSession(router, session, backends, master)))
|
||||
|
||||
Reference in New Issue
Block a user