From d57de28199616a2ac75dda8816ecf0b5eee89d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 21 Dec 2021 12:39:59 +0200 Subject: [PATCH] Fix schemarouter query queue If the schemarouter service used a filter, any queued queries would end up being routed twice for them as well. This would break any filters that would expect a result for each query and it could also cause a hang if the filter did not forward it up to the router. The correct thing to do is to call the routeQuery method of the router directly. --- .../routing/schemarouter/schemaroutersession.cc | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/server/modules/routing/schemarouter/schemaroutersession.cc b/server/modules/routing/schemarouter/schemaroutersession.cc index 705255e86..d522abe1c 100644 --- a/server/modules/routing/schemarouter/schemaroutersession.cc +++ b/server/modules/routing/schemarouter/schemaroutersession.cc @@ -1077,15 +1077,8 @@ void SchemaRouterSession::route_queued_query() GWBUF* tmp = m_queue.front().release(); m_queue.pop_front(); -#ifdef SS_DEBUG - char* querystr = modutil_get_SQL(tmp); - MXS_DEBUG("Sending queued buffer for session %p: %s", - m_client->session, - querystr); - MXS_FREE(querystr); -#endif - - poll_add_epollin_event_to_dcb(m_client, tmp); + MXS_INFO("Routing queued query: %s", mxs::extract_sql(tmp).c_str()); + session_delay_routing(m_pSession, router_as_downstream(m_pSession), tmp, 0); } /**