Handle batched reads from cloned sessions

Readwritesplit should route all queries from cloned sessions to the
master. This allows batch statements to be safely routed.

Native readwritesplit sessions only support batched writes as batched
reads aren't very common. Once readwritesplit supports batched reads, the
special handling for cloned DCBs can be removed.
This commit is contained in:
Markus Mäkelä
2016-12-15 11:05:36 +02:00
parent 4d431b787a
commit 11d1875399

View File

@ -696,6 +696,13 @@ route_target_t get_route_target(ROUTER_CLIENT_SES *rses,
{
target = TARGET_MASTER;
}
/**
* A cloned session, route everything to the master
*/
else if (DCB_IS_CLONE(rses->client_dcb))
{
target = TARGET_MASTER;
}
/**
* These queries are not affected by hints
*/