MXS-1777: Initial version of routing based on query response time.

The main piece of code, slave selection (backend_cmp_response_time), uses the available
method of pair-wise comparison of slaves. This will be changed to selection using all
available slaves, along with removal of hard coded values.
This commit is contained in:
Niclas Antti
2018-07-27 13:07:18 +03:00
parent 1e6509423a
commit 6351ab9c73
10 changed files with 250 additions and 10 deletions

View File

@ -294,11 +294,15 @@ bool RWSplitSession::route_single_stmt(GWBUF *querybuf)
{
succp = true;
if (m_config.retry_failed_reads &&
(command == MXS_COM_QUERY || command == MXS_COM_STMT_EXECUTE))
bool is_sql = command == MXS_COM_QUERY || command == MXS_COM_STMT_EXECUTE;
if (is_sql)
{
// Only commands that can contain an SQL statement should be stored
store_stmt = true;
target->response_stat().query_started();
if (m_config.retry_failed_reads)
{
store_stmt = true;
}
}
}
}