[MXS-3895] Route Select / Read only to Slave node when using readwritesplit Created: 2021-11-25 Updated: 2022-01-04 Resolved: 2022-01-04 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | readwritesplit |
| Affects Version/s: | 2.5.15 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Han-Nung Hsu | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 1 |
| Labels: | Maxscale, configuration, readwritesplit | ||
| Environment: |
CentOS 7.9.2009 |
||
| Attachments: |
|
| Description |
|
Hi all, How to route read query only to node slave when I using readwritesplit routing? This is my maxscale configuration:
|
| Comments |
| Comment by markus makela [ 2021-11-25 ] |
|
Whether reads are routed to the slave node depends on whether the read is done inside of a transaction or not. If it is done outside of a transaction with autocommit enabled, it can be routed to a slave server. If the read is done inside a read-only transaction (i.e. START TRANSACTION READ ONLY) then it also can be routed to a slave server. All reads done inside read-write transactions must be routed to the master server to retain the guarantee that all the statement in the transaction use the same transaction snapshot. |
| Comment by markus makela [ 2021-12-08 ] |
|
I'd recommend adding log_info=true under the [maxscale] section to enable the verbose log level. This should show you why reads are routed to the current master server. |
| Comment by markus makela [ 2022-01-04 ] |
|
Not enough information to deduce whether this happens due to an open transaction or whether this is an actual bug. HansHsu please update the issue with steps to reproduce so that we can verify whether this is a bug or not. |