[CONJ-704] Control using reader node when using Aurora cluster endpoint Created: 2019-05-20 Updated: 2023-12-15 Resolved: 2023-12-15 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | aurora |
| Affects Version/s: | 2.3.0 |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Minor |
| Reporter: | Minwook | Assignee: | Diego Dupin |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Environment: |
DBCP : Hikari |
||
| Description |
|
Hello, Team We're using Mariadb connector/J to connect our Aurora database with cluster endpoint. 1) Is this designed behavior that sometime select query is distributed to reader node when using cluster endpoint with MariaDB connector/J? 2) If yes, what is the exact condition when select query is distributed to reader node? Something like under high load on master? 3) If yes, is it possible to disable this behavior? |
| Comments |
| Comment by Diego Dupin [ 2019-06-03 ] | |||||
|
Using 'aurora' keyword in connection string does exactly that, and this is the expected result.
ORM like hibernate for example will set connection.setReadOnly automatically. If needing to use only and always the master connection, then changing the connection string (removing "aurora" keyword) will be more appropriate, because then this is "standard" connection (aurora configuration will have 2 underlying socket connection to permit distribution to writer/reader) | |||||
| Comment by Minwook [ 2019-06-03 ] | |||||
|
Thanks for your kind comment. When we test connection string with 'aurora' keyword, sometimes select query is executed on slave even we didn't set setReadonly to True. (During load test, Initially all queries are executed on Master only but select query distributed to slave when load increased.) So current design is using slave when only setReadOnly to True and no other scenarios, right? | |||||
| Comment by Diego Dupin [ 2019-06-03 ] | |||||
|
>So current design is using slave when only setReadOnly to True and no other scenarios, right? There are 3 cases to have a query running on the slave :
So for 'client' query, it's only by using setReadonly(true). | |||||
| Comment by Minwook [ 2019-06-19 ] | |||||
|
@Diego Dupin Thanks for your kind explanation about current design. To identify this issue, could you please guide us which log should be gathered or any points to check? | |||||
| Comment by Diego Dupin [ 2023-12-15 ] | |||||
|
Closing, since 4 years without feedback and no reproduction |