maxscale 6 schemarouter about start transaction

We used maxscale for two mysql cluster backend, database( a , b ) are each on different database node(can readwrite). During the test, we manually start the transaction, but this operation to start the transaction can only be routed to the master node。 I am purpose is to hope that maxscale can enable routing to different back-end database nodes for transactions of different nodes.

please give me some help.

Answer Answered by Markus Mäkelä in this comment.

The problem with START TRANSACTION is that the schemarouter cannot know which node to start the transaction on. You could use SET autocommit=0 which is routed to all nodes in the cluster as it modifies the session state. This should allow you to start a transaction without knowing which node it will end up on. You can commit the transaction by enabling autocommi with SET autocommit=1 which should also be routed to all nodes.


Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.