MXS-1901: Route related PS commands to same server
All COM_STMT_SEND_LONG_DATA commands and the COM_STMT_EXECUTE that follows it must be sent to the same server. This implicitly works for masters but with multiple slave servers the data could be sent to the wrong server. By using the code added for MXS-2521, this problem can now be easily solved by checking what the previous command was.
This commit is contained in:
parent
847d673f07
commit
be8f4fe055
@ -956,8 +956,15 @@ QueryClassifier::current_target_t QueryClassifier::handle_multi_temp_and_load(
|
||||
bool QueryClassifier::query_continues_ps(uint8_t cmd, uint32_t stmt_id, GWBUF* buffer)
|
||||
{
|
||||
bool rval = false;
|
||||
uint8_t prev_cmd = m_route_info.command();
|
||||
|
||||
if (cmd == COM_STMT_FETCH)
|
||||
if (prev_cmd == MXS_COM_STMT_SEND_LONG_DATA
|
||||
&& (cmd == MXS_COM_STMT_EXECUTE || cmd == MXS_COM_STMT_SEND_LONG_DATA))
|
||||
{
|
||||
// PS execution must be sent to the same server where the data was sent
|
||||
rval = true;
|
||||
}
|
||||
else if (cmd == COM_STMT_FETCH)
|
||||
{
|
||||
// COM_STMT_FETCH should always go to the same target as the COM_STMT_EXECUTE
|
||||
rval = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user