Fix query queuing on session command execution

If session command execution during server reconnection caused a query to
be queued, the query would be put on the tail end of the queue. This would
cause queries to be reordered if the queue wasn't empty. The correct thing
to do would be to put the next pending query back at the front of the
queue.
This commit is contained in:
Markus Mäkelä
2019-08-06 11:17:15 +03:00
parent bb6f9213d4
commit 8bc4e42f2d

View File

@ -336,7 +336,7 @@ bool RWSplitSession::route_single_stmt(GWBUF* querybuf)
else if (target->has_session_commands()) else if (target->has_session_commands())
{ {
// We need to wait until the session commands are executed // We need to wait until the session commands are executed
m_query_queue.emplace_back(gwbuf_clone(querybuf)); m_query_queue.emplace_front(gwbuf_clone(querybuf));
MXS_INFO("Queuing query until '%s' completes session command", target->name()); MXS_INFO("Queuing query until '%s' completes session command", target->name());
} }
else else