MXS-1506: Remove redundant variables
Keeping track of the closed state of the session inside the router session itself is not needed as the MaxScale core should already do that. The skygw_chk_t variables are rather meaningless and are obsoleted by Valgrind/ASAN.
This commit is contained in:
@ -632,9 +632,6 @@ RWSplitSession* RWSplit::newSession(MXS_SESSION *session)
|
|||||||
*/
|
*/
|
||||||
void RWSplitSession::close()
|
void RWSplitSession::close()
|
||||||
{
|
{
|
||||||
if (!rses_closed)
|
|
||||||
{
|
|
||||||
rses_closed = true;
|
|
||||||
close_all_connections(backends);
|
close_all_connections(backends);
|
||||||
|
|
||||||
if (MXS_LOG_PRIORITY_IS_ENABLED(LOG_INFO) &&
|
if (MXS_LOG_PRIORITY_IS_ENABLED(LOG_INFO) &&
|
||||||
@ -653,18 +650,11 @@ void RWSplitSession::close()
|
|||||||
MXS_INFO("Executed session commands:\n%s", sescmdstr.c_str());
|
MXS_INFO("Executed session commands:\n%s", sescmdstr.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int32_t RWSplitSession::routeQuery(GWBUF* querybuf)
|
int32_t RWSplitSession::routeQuery(GWBUF* querybuf)
|
||||||
{
|
{
|
||||||
int rval = 0;
|
int rval = 0;
|
||||||
|
|
||||||
if (rses_closed)
|
|
||||||
{
|
|
||||||
closed_session_reply(querybuf);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (query_queue == NULL &&
|
if (query_queue == NULL &&
|
||||||
(expected_responses == 0 ||
|
(expected_responses == 0 ||
|
||||||
mxs_mysql_get_command(querybuf) == MXS_COM_STMT_FETCH ||
|
mxs_mysql_get_command(querybuf) == MXS_COM_STMT_FETCH ||
|
||||||
@ -699,7 +689,6 @@ int32_t RWSplitSession::routeQuery(GWBUF* querybuf)
|
|||||||
rval = 0;
|
rval = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (querybuf != NULL)
|
if (querybuf != NULL)
|
||||||
{
|
{
|
||||||
@ -913,7 +902,6 @@ void RWSplitSession::correct_packet_sequence(GWBUF *buffer)
|
|||||||
void RWSplitSession::clientReply(GWBUF *writebuf, DCB *backend_dcb)
|
void RWSplitSession::clientReply(GWBUF *writebuf, DCB *backend_dcb)
|
||||||
{
|
{
|
||||||
DCB *client_dcb = backend_dcb->session->client_dcb;
|
DCB *client_dcb = backend_dcb->session->client_dcb;
|
||||||
ss_dassert(!rses_closed);
|
|
||||||
|
|
||||||
SRWBackend& backend = get_backend_from_dcb(backend_dcb);
|
SRWBackend& backend = get_backend_from_dcb(backend_dcb);
|
||||||
|
|
||||||
@ -1026,13 +1014,6 @@ void RWSplitSession::handleError(GWBUF *errmsgbuf, DCB *problem_dcb,
|
|||||||
{
|
{
|
||||||
ss_dassert(problem_dcb->dcb_role == DCB_ROLE_BACKEND_HANDLER);
|
ss_dassert(problem_dcb->dcb_role == DCB_ROLE_BACKEND_HANDLER);
|
||||||
CHK_DCB(problem_dcb);
|
CHK_DCB(problem_dcb);
|
||||||
|
|
||||||
if (rses_closed)
|
|
||||||
{
|
|
||||||
*succp = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
MXS_SESSION *session = problem_dcb->session;
|
MXS_SESSION *session = problem_dcb->session;
|
||||||
ss_dassert(session);
|
ss_dassert(session);
|
||||||
|
|
||||||
|
|||||||
@ -22,8 +22,6 @@ RWSplitSession::RWSplitSession(RWSplit* instance, MXS_SESSION* session,
|
|||||||
const SRWBackendList& backends,
|
const SRWBackendList& backends,
|
||||||
const SRWBackend& master):
|
const SRWBackend& master):
|
||||||
mxs::RouterSession(session),
|
mxs::RouterSession(session),
|
||||||
rses_chk_top(CHK_NUM_ROUTER_SES),
|
|
||||||
rses_closed(false),
|
|
||||||
backends(backends),
|
backends(backends),
|
||||||
current_master(master),
|
current_master(master),
|
||||||
large_query(false),
|
large_query(false),
|
||||||
@ -41,8 +39,7 @@ RWSplitSession::RWSplitSession(RWSplit* instance, MXS_SESSION* session,
|
|||||||
recv_sescmd(0),
|
recv_sescmd(0),
|
||||||
gtid_pos(""),
|
gtid_pos(""),
|
||||||
wait_gtid_state(EXPECTING_NOTHING),
|
wait_gtid_state(EXPECTING_NOTHING),
|
||||||
next_seq(0),
|
next_seq(0)
|
||||||
rses_chk_tail(CHK_NUM_ROUTER_SES)
|
|
||||||
{
|
{
|
||||||
if (rses_config.rw_max_slave_conn_percent)
|
if (rses_config.rw_max_slave_conn_percent)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -94,8 +94,6 @@ public:
|
|||||||
bool* pSuccess);
|
bool* pSuccess);
|
||||||
|
|
||||||
// TODO: Make member variables private
|
// TODO: Make member variables private
|
||||||
skygw_chk_t rses_chk_top;
|
|
||||||
bool rses_closed; /**< true when closeSession is called */
|
|
||||||
mxs::SRWBackendList backends; /**< List of backend servers */
|
mxs::SRWBackendList backends; /**< List of backend servers */
|
||||||
mxs::SRWBackend current_master; /**< Current master server */
|
mxs::SRWBackend current_master; /**< Current master server */
|
||||||
mxs::SRWBackend target_node; /**< The currently locked target node */
|
mxs::SRWBackend target_node; /**< The currently locked target node */
|
||||||
@ -123,7 +121,6 @@ public:
|
|||||||
std::string gtid_pos; /**< Gtid position for causal read */
|
std::string gtid_pos; /**< Gtid position for causal read */
|
||||||
wait_gtid_state_t wait_gtid_state; /**< Determine boundray of wait gtid result and client query result */
|
wait_gtid_state_t wait_gtid_state; /**< Determine boundray of wait gtid result and client query result */
|
||||||
uint32_t next_seq; /**< Next packet'ssequence number */
|
uint32_t next_seq; /**< Next packet'ssequence number */
|
||||||
skygw_chk_t rses_chk_tail;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RWSplitSession(RWSplit* instance, MXS_SESSION* session,
|
RWSplitSession(RWSplit* instance, MXS_SESSION* session,
|
||||||
|
|||||||
Reference in New Issue
Block a user