MXS-1804: Allow large session commands
Session commands that span multiple packets are now allowed and will work. However, if one is executed the session command history is disabled as no interface for appending to session commands exists. The backend protocol modules now also correctly track the current command. This was a pre-requisite for large session commands as they needed to be gathered into a single buffer and to do this the current command had to be accurate. Updated tests to expect success instead of failure for large prepared statements.
This commit is contained in:
@ -83,6 +83,7 @@ bool RWSplitSession::handle_target_is_all(route_target_t route_target, GWBUF *qu
|
||||
int packet_type, uint32_t qtype)
|
||||
{
|
||||
bool result = false;
|
||||
bool is_large = is_large_query(querybuf);
|
||||
|
||||
if (TARGET_IS_MASTER(route_target) || TARGET_IS_SLAVE(route_target))
|
||||
{
|
||||
@ -111,13 +112,23 @@ bool RWSplitSession::handle_target_is_all(route_target_t route_target, GWBUF *qu
|
||||
MXS_FREE(query_str);
|
||||
MXS_FREE(qtype_str);
|
||||
}
|
||||
else if (m_qc.large_query())
|
||||
{
|
||||
// TODO: Append to the already stored session command instead of disabling history
|
||||
MXS_INFO("Large session write, have to disable session command history");
|
||||
m_config.disable_sescmd_history = true;
|
||||
|
||||
continue_large_session_write(querybuf, qtype);
|
||||
result = true;
|
||||
}
|
||||
else if (route_session_write(gwbuf_clone(querybuf), packet_type, qtype))
|
||||
{
|
||||
|
||||
result = true;
|
||||
atomic_add_uint64(&m_router->stats().n_all, 1);
|
||||
}
|
||||
|
||||
m_qc.set_large_query(is_large);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user