[MXS-2750] COM_STMT_EXECUTE in transaction get unexpected result Created: 2019-10-31  Updated: 2021-05-24  Resolved: 2020-02-05

Status: Closed
Project: MariaDB MaxScale
Component/s: readwritesplit
Affects Version/s: 2.2.21, 2.3.13
Fix Version/s: 2.5.0

Type: Bug Priority: Major
Reporter: huangyouqian Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MXS-2521 COM_STMT_EXECUTE maybe return empty r... Closed
Relates
relates to MXS-3565 COM_STMT_EXECUTE target selection is ... Closed
Sprint: MXS-SPRINT-99

 Description   

We fix MX-2521 by routing the execute stmts which n_params > 0 and no metadata to previous node, but it not works with transaction,
For example:

prepare;
execute; // to ro1 with metadata
execute; // to ro1 with without metadata
begin;
execute; //  to master without metadata;
commit;

Suggestion:
1. Record metadata in first execution;
2. Add metadata to the following execution ( maybe every backend just add once)



 Comments   
Comment by Petros Moisiadis [ 2019-12-09 ]

Dec 9 13:34:22 maxscale-host maxscale[4206]: (1076606) [readwritesplit] Unexpected internal state: received response 0x00 from server 'galera-node-3' when no response was expected. Command: 0x03 Query: <not available>
Dec 9 13:34:22 maxscale-host maxscale[4206]: (1076653) [readwritesplit] Unexpected internal state: received response 0x00 from server 'galera-node-1' when no response was expected. Command: 0x03 Query: <not available>

Since we know that the clients in our setup are using prepared statements, could the above errors be related with the issue described in this ticket?

Comment by markus makela [ 2020-01-20 ]

Ernest0x I think it's unlikely that this bug would result in such an error. It's more likely that your problem is caused by MXS-2822.

Comment by markus makela [ 2020-02-03 ]

The metadata is now recorded every time the client sends it (this way updates to the metadata are stored properly). If a COM_STMT_EXECUTE is sent by the client without the metadata and the metadata has not been sent to the target server, it is added into the payload.

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