[MXS-1397] ReadWriteSplit's master connection can time out if session only issues read-only queries Created: 2017-09-07 Updated: 2020-08-25 Resolved: 2017-09-08 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | readwritesplit |
| Affects Version/s: | 2.1.6 |
| Fix Version/s: | 2.2.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
When a ReadWriteSplit session executes a read-only query outside of a transaction, it will get routed to a slave. When this happens, MaxScale does not use the master connection at all. Therefore, if a session executes only read-only queries, then its master connection could be allowed to time out due to wait_timeout. This can easily be reproduced with the following:
Output:
If this problem is encounted in a Java application, then the error is a bit different. I've also attached a Java program that can be used to reproduce the issue. Output:
As a potential fix, maybe ReadWriteSplit should route a COM_PING to a session's master connection whenever a query is routed to a slave connection? |
| Comments |
| Comment by markus makela [ 2017-09-08 ] |
|
This is a duplicate of Your suggestion is exactly how we decided to solved the problem. We added a new feature which allows connections to be kept alive by routing a COM_PING to all connections that have been idle for too long. Since the implementation of the connection keepalive required changes to the MaxScale core, this will be added as a new feature in MaxScale 2.2.0. |