MXS-1625 Fix rebase breakage
This commit is contained in:
@ -305,88 +305,6 @@ RWSplitSession* RWSplit::newSession(MXS_SESSION *session)
|
||||
return rses;
|
||||
}
|
||||
|
||||
<<<<<<< 563fa2c840c70eaf98fc61289ab28db3aaf49932
|
||||
=======
|
||||
/**
|
||||
* @brief Close a router session
|
||||
*
|
||||
* Close a session with the router, this is the mechanism by which a router
|
||||
* may perform cleanup. The instance of the router that relates to
|
||||
* the relevant service is passed, along with the router session that is to
|
||||
* be closed. The freeSession will be called once the session has been closed.
|
||||
*
|
||||
* @param instance The router instance data
|
||||
* @param session The router session being closed
|
||||
*/
|
||||
void RWSplitSession::close()
|
||||
{
|
||||
close_all_connections(backends);
|
||||
|
||||
if (MXS_LOG_PRIORITY_IS_ENABLED(LOG_INFO) &&
|
||||
sescmd_list.size())
|
||||
{
|
||||
std::string sescmdstr;
|
||||
|
||||
for (mxs::SessionCommandList::iterator it = sescmd_list.begin();
|
||||
it != sescmd_list.end(); it++)
|
||||
{
|
||||
mxs::SSessionCommand& scmd = *it;
|
||||
sescmdstr += scmd->to_string();
|
||||
sescmdstr += "\n";
|
||||
}
|
||||
|
||||
MXS_INFO("Executed session commands:\n%s", sescmdstr.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
int32_t RWSplitSession::routeQuery(GWBUF* querybuf)
|
||||
{
|
||||
int rval = 0;
|
||||
|
||||
if (query_queue == NULL &&
|
||||
(expected_responses == 0 ||
|
||||
mxs_mysql_get_command(querybuf) == MXS_COM_STMT_FETCH ||
|
||||
m_qc.load_data_state() == QueryClassifier::LOAD_DATA_ACTIVE ||
|
||||
m_qc.large_query()))
|
||||
{
|
||||
/** Gather the information required to make routing decisions */
|
||||
RouteInfo info(this, querybuf);
|
||||
|
||||
/** No active or pending queries */
|
||||
if (route_single_stmt(querybuf, info))
|
||||
{
|
||||
rval = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/**
|
||||
* We are already processing a request from the client. Store the
|
||||
* new query and wait for the previous one to complete.
|
||||
*/
|
||||
ss_dassert(expected_responses || query_queue);
|
||||
MXS_INFO("Storing query (len: %d cmd: %0x), expecting %d replies to current command",
|
||||
gwbuf_length(querybuf), GWBUF_DATA(querybuf)[4], expected_responses);
|
||||
query_queue = gwbuf_append(query_queue, querybuf);
|
||||
querybuf = NULL;
|
||||
rval = 1;
|
||||
ss_dassert(expected_responses > 0);
|
||||
|
||||
if (expected_responses == 0 && !route_stored_query())
|
||||
{
|
||||
rval = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (querybuf != NULL)
|
||||
{
|
||||
gwbuf_free(querybuf);
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
>>>>>>> MXS-1625 Move load data state to QueryClassifier
|
||||
void RWSplit::diagnostics(DCB *dcb)
|
||||
{
|
||||
RWSplit *router = this;
|
||||
|
@ -530,7 +530,7 @@ handle_multi_temp_and_load(RWSplitSession *rses, GWBUF *querybuf,
|
||||
if (queryop == QUERY_OP_LOAD)
|
||||
{
|
||||
rses->qc().set_load_data_state(QueryClassifier::LOAD_DATA_START);
|
||||
rses->rses_load_data_sent = 0;
|
||||
rses->m_load_data_sent = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ void RWSplitSession::replace_master(SRWBackend& target)
|
||||
|
||||
// As the master has changed, we can reset the temporary table information
|
||||
m_qc.set_have_tmp_tables(false);
|
||||
temp_tables.clear();
|
||||
m_temp_tables.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -117,8 +117,8 @@ int32_t RWSplitSession::routeQuery(GWBUF* querybuf)
|
||||
if (m_query_queue == NULL &&
|
||||
(m_expected_responses == 0 ||
|
||||
mxs_mysql_get_command(querybuf) == MXS_COM_STMT_FETCH ||
|
||||
m_load_data_state == LOAD_DATA_ACTIVE ||
|
||||
m_large_query))
|
||||
m_qc.load_data_state() == QueryClassifier::LOAD_DATA_ACTIVE ||
|
||||
m_qc.large_query()))
|
||||
{
|
||||
/** Gather the information required to make routing decisions */
|
||||
RouteInfo info(this, querybuf);
|
||||
|
@ -174,11 +174,7 @@ private:
|
||||
*/
|
||||
inline bool locked_to_master() const
|
||||
{
|
||||
<<<<<<< bc22790e1bde96fc6a16b8c719805b9d3dd193b5
|
||||
return m_large_query || (m_current_master && m_target_node == m_current_master);
|
||||
=======
|
||||
return m_qc.large_query() || (current_master && target_node == current_master);
|
||||
>>>>>>> MXS-1625 large_query flag moved from RWS session to query classifier
|
||||
return m_qc.large_query() || (m_current_master && m_target_node == m_current_master);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user