Merge commit '09cb4a885f88d30b5108d215dcdaa5163229a230' into develop

This commit is contained in:
Markus Mäkelä
2019-04-04 14:34:17 +03:00
92 changed files with 1560 additions and 1696 deletions

View File

@ -972,7 +972,7 @@ bool RWSplitSession::should_migrate_trx(RWBackend* target)
bool RWSplitSession::start_trx_migration(RWBackend* target, GWBUF* querybuf)
{
MXS_INFO("Starting transaction migration from '%s' to '%s'", m_current_master->name(), target->name());
MXS_INFO("Starting transaction migration to '%s'", target->name());
/**
* Stash the current query so that the transaction replay treats

View File

@ -126,12 +126,11 @@ int32_t RWSplitSession::routeQuery(GWBUF* querybuf)
{
MXS_INFO("New query received while transaction replay is active: %s",
mxs::extract_sql(querybuf).c_str());
mxb_assert(!m_interrupted_query.get());
m_interrupted_query.reset(querybuf);
m_query_queue.emplace_back(querybuf);
return 1;
}
if (can_route_queries())
if ((m_query_queue.empty() || GWBUF_IS_REPLAYED(querybuf)) && can_route_queries())
{
/** Gather the information required to make routing decisions */
if (!m_qc.large_query())
@ -432,6 +431,10 @@ void RWSplitSession::trx_replay_next_stmt()
MXS_INFO("Resuming execution: %s", mxs::extract_sql(m_interrupted_query.get()).c_str());
retry_query(m_interrupted_query.release(), 0);
}
else if (!m_query_queue.empty())
{
route_stored_query();
}
}
else
{

View File

@ -270,10 +270,9 @@ private:
inline bool can_route_queries() const
{
return m_query_queue.empty()
&& (m_expected_responses == 0
|| m_qc.load_data_state() == mxs::QueryClassifier::LOAD_DATA_ACTIVE
|| m_qc.large_query());
return m_expected_responses == 0
|| m_qc.load_data_state() == mxs::QueryClassifier::LOAD_DATA_ACTIVE
|| m_qc.large_query();
}
inline mxs::QueryClassifier::current_target_t get_current_target() const