[MXS-3315] Add prepared statement support to causal_reads Created: 2020-12-02  Updated: 2021-05-10  Resolved: 2021-05-10

Status: Closed
Project: MariaDB MaxScale
Component/s: readwritesplit
Affects Version/s: None
Fix Version/s: N/A

Type: New Feature Priority: Major
Reporter: markus makela Assignee: Todd Stoffel (Inactive)
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MXS-3499 Add prepared statement support to cau... Closed
Relates
relates to MXS-3314 Lack of prepared statement support fo... Closed

 Description   

The current causal_reads mechanism relies on the SQL in question being modifiable. As this is not possible for COM_STMT_EXECUTE queries, a different synchronization mechanism must be created for causal_reads=local and causal_reads=global.

One option is to route a normal COM_QUERY packet with the MASTER_GTID_WAIT to the server and then sending the COM_STMT_EXECUTE without waiting for the response. The result of the MASTER_GTID_WAIT would be ignored and the query would never be retried if the MASTER_GTID_WAIT failed. This mode would have a "best-effort" guarantee of the causality of the reads.

Another option is to just wait for the COM_QUERY to finish before sending the COM_STMT_EXECUTE to the server. This would still improve read scaling but it would roughly double the latency for each query.

The third option is to use the BEGIN NOT ATOMIC syntax combined with immediate execution of prepared statements. This retains the same limitations and benefits that the COM_QUERY ONE does with the exception of causing an extra prepare-execute-close cycle to occur in the server.



 Comments   
Comment by markus makela [ 2021-05-10 ]

I'll close this as a duplicate of MXS-3499 even though it is newer than this one. There's more watchers on that issue.

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