[MXS-1245] Support statement pipelining Created: 2017-04-24  Updated: 2020-12-18  Resolved: 2020-12-18

Status: Closed
Project: MariaDB MaxScale
Component/s: readwritesplit
Affects Version/s: 2.2.0
Fix Version/s: 6.0.0

Type: New Feature Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: Performance

Issue Links:
Issue split
split to MXS-3344 Support statement pipelining of reads... Closed
Relates
relates to MXS-1203 Batch inserts through Maxscale with ... Closed
Sprint: MXS-SPRINT-121

 Description   

MXS-1203 fixed the batched statement execution bug. The fix does not allow parallel execution of the batched statements which removes all of the benefits of batched statement execution.

A more correct implementation of this would record the order of the executed statements and return the responses in the correct order.



 Comments   
Comment by markus makela [ 2020-12-07 ]

Fixing this for single-target queries is relatively straightforward to fix. When a query would be routed to the target that we previously routed to, we can proceed with the routing even if we haven't received the result. The only real problem here can be the failure to write the query while ongoing queries are in progress. The simplest solution in this case is to close the session which would prevent any out-of-order errors from being created.

For multi-target queries this is a more complex issue. Simple session variable assignments can be executed even if a previous statement is in progress as this is only appended to the session command queue of each backend and then executed. The problem here is the tracking of which session commands have been replied to.

For direct execution of prepared statements, the problem is harder: MaxScale needs to be able to translate the external PS ID generated by Maxscale to an internal value which maps to different PS ID values for each backend connection. The mapping is unique to each connection and can change for each connection depending on when the connection is created and whether reconnections take place. This means that direct execution of prepared statements might make the prepared statement code much more complex.

Implementing the code required to handle single-target pipelining of queries would be the first milestone for this. The universal pipelining of queries would be the second one as pipelining of multi-target queries brings much more limited benefits than the pipelining of single-target queries (batch execution of statements).

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