Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be more verbose about connecting to the read-only endpoint of an aurora RDS instance. #456

Closed
ls-pieter-vanisacker opened this issue Sep 15, 2023 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@ls-pieter-vanisacker
Copy link

Describe the issue

The doc states that connecting to a RO endpoint can result in connections being created to the RW instance in failover situations.

Initial connection: any Aurora Replica
Failover behavior: prioritize connecting to any active Aurora Replica but might connect to the primary DB instance if it provides a faster connection

Can you elaborate a bit more on what the logic is? What defines a faster connection?

We're currently using this driver and see an occasional connection of our connection pool going to the RW instance although we're using the RO endpoint.
And since our RW instance is heavily loaded some of the queries just time out.

I've been trying to replicate this in an isolated test but haven't been able to do so yet.

Links

https://github.com/awslabs/aws-mysql-jdbc#connection-url-descriptions

@crystall-bitquill
Copy link
Contributor

Hi @ls-pieter-vanisacker, thank you for reaching out.

In the event of a failover, the driver will attempt to connect to other instances in the cluster by iterating through the instances 2 at a time and attempting connections. If one connection succeeds first, the driver will return that connection and stop the other attempt. This instance may be a writer connection. This is what we meant by "a faster connection".

You can set the the enableFailoverStrictReader parameter to true to prevent connecting to the writer instance during reader failover. Thanks again for raising this, we are adding the missing documentation in PR #457.

@ls-pieter-vanisacker
Copy link
Author

Perfect, thanks for the quick feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants