Fix handling of multi-packet queries in readwritesplit

If a prepared statement sends large amounts of data, the target server
where the data is sent will be tracked. The tracked target was not reset
after a multi-packet query was completed and the target itself was used to
check whether the session was processing a multi-packet query.

Changed the check to use the boolean variable instead of the target and
added a reset of the tracked target after a multi-packet query was
completed.
This commit is contained in:
Markus Mäkelä
2017-09-21 20:40:51 +03:00
parent 845b59ad48
commit fbc1a7d44b
4 changed files with 23 additions and 3 deletions

View File

@ -150,7 +150,11 @@ is_packet_a_query(int packet_type)
void
log_transaction_status(RWSplitSession *rses, GWBUF *querybuf, uint32_t qtype)
{
if (rses->load_data_state == LOAD_DATA_INACTIVE)
if (rses->large_query)
{
MXS_INFO("> Processing large request with more than 2^24 bytes of data");
}
else if (rses->load_data_state == LOAD_DATA_INACTIVE)
{
uint8_t *packet = GWBUF_DATA(querybuf);
unsigned char command = packet[4];