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()
|
||||
{
|
||||
if (!rses_closed)
|
||||
{
|
||||
rses_closed = true;
|
||||
close_all_connections(backends);
|
||||
|
||||
if (MXS_LOG_PRIORITY_IS_ENABLED(LOG_INFO) &&
|
||||
@ -652,19 +649,12 @@ void RWSplitSession::close()
|
||||
|
||||
MXS_INFO("Executed session commands:\n%s", sescmdstr.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int32_t RWSplitSession::routeQuery(GWBUF* querybuf)
|
||||
{
|
||||
int rval = 0;
|
||||
|
||||
if (rses_closed)
|
||||
{
|
||||
closed_session_reply(querybuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (query_queue == NULL &&
|
||||
(expected_responses == 0 ||
|
||||
mxs_mysql_get_command(querybuf) == MXS_COM_STMT_FETCH ||
|
||||
@ -699,7 +689,6 @@ int32_t RWSplitSession::routeQuery(GWBUF* querybuf)
|
||||
rval = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (querybuf != NULL)
|
||||
{
|
||||
@ -913,7 +902,6 @@ void RWSplitSession::correct_packet_sequence(GWBUF *buffer)
|
||||
void RWSplitSession::clientReply(GWBUF *writebuf, DCB *backend_dcb)
|
||||
{
|
||||
DCB *client_dcb = backend_dcb->session->client_dcb;
|
||||
ss_dassert(!rses_closed);
|
||||
|
||||
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);
|
||||
CHK_DCB(problem_dcb);
|
||||
|
||||
if (rses_closed)
|
||||
{
|
||||
*succp = false;
|
||||
return;
|
||||
}
|
||||
|
||||
MXS_SESSION *session = problem_dcb->session;
|
||||
ss_dassert(session);
|
||||
|
||||
|
@ -22,8 +22,6 @@ RWSplitSession::RWSplitSession(RWSplit* instance, MXS_SESSION* session,
|
||||
const SRWBackendList& backends,
|
||||
const SRWBackend& master):
|
||||
mxs::RouterSession(session),
|
||||
rses_chk_top(CHK_NUM_ROUTER_SES),
|
||||
rses_closed(false),
|
||||
backends(backends),
|
||||
current_master(master),
|
||||
large_query(false),
|
||||
@ -41,8 +39,7 @@ RWSplitSession::RWSplitSession(RWSplit* instance, MXS_SESSION* session,
|
||||
recv_sescmd(0),
|
||||
gtid_pos(""),
|
||||
wait_gtid_state(EXPECTING_NOTHING),
|
||||
next_seq(0),
|
||||
rses_chk_tail(CHK_NUM_ROUTER_SES)
|
||||
next_seq(0)
|
||||
{
|
||||
if (rses_config.rw_max_slave_conn_percent)
|
||||
{
|
||||
|
@ -94,8 +94,6 @@ public:
|
||||
bool* pSuccess);
|
||||
|
||||
// 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::SRWBackend current_master; /**< Current master server */
|
||||
mxs::SRWBackend target_node; /**< The currently locked target node */
|
||||
@ -123,7 +121,6 @@ public:
|
||||
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 */
|
||||
uint32_t next_seq; /**< Next packet'ssequence number */
|
||||
skygw_chk_t rses_chk_tail;
|
||||
|
||||
private:
|
||||
RWSplitSession(RWSplit* instance, MXS_SESSION* session,
|
||||
|
Reference in New Issue
Block a user