Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.4.3
-
None
-
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.