[MXS-766] R/W Router sends DEALLOCATE PREPARE to ALL instead of MASTER Created: 2016-06-14  Updated: 2016-06-14  Resolved: 2016-06-14

Status: Closed
Project: MariaDB MaxScale
Component/s: readwritesplit
Affects Version/s: 1.4.3
Fix Version/s: 2.0.0

Type: Bug Priority: Major
Reporter: Christopher Tarquini Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: None
Environment:

Any/All



 Description   

MaxScale sends DEALLOCATE PREPARE statements to all slaves instead of just the master. Since the PREPARE statement queries are only sent to the master, the DEALLOCATE PREPARE fails on the slaves causing the slave connections to be closed due to being inconsistent with the master.

This seems to be due to DEALLOCATE PREPARE being treated as QUERY_SESSION_WRITE with no special handling to ensure it's routed to the same server (master) that PREPARE statement was sent to.

Steps to reproduce (with R/W splitting enabled):
PREPARE stmt1 FROM 'SELECT 1'; – routed to master only
DEALLOCATE PREPARE stmt1; — sent to master and slave, causes error to be logged stating the slave session was closed due to be consistent

Example error log:
maxscale[24210]: (clientReply): Failed to execute session command in db001:3306. Error was: HY000 Unknown prepared statement handler (stmt1) given to DEALLOCATE PREPARE
maxscale[24210]: (sescmd_cursor_process_replies): Slave server 'db1': response differs from master's response. Closing connection due to inconsistent session state.



 Comments   
Comment by Johan Wikman [ 2016-06-14 ]

Now classified as QUERY_TYPE_WRITE so that it will be sent to master.

Generated at Thu Feb 08 04:01:46 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.