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

Add failover handling #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nanoflite
Copy link

On AWS RDS with a failover setup, no connection gets made to the new writer after a failover happens. This PR fixes that and handles failover gracefully. In a test I conducted, after a failover, it took only 8 seconds to recover.

@jeremydaly
Copy link
Owner

HI @nanoflite!

Thanks for this. Couple of quick questions. How is the ER_OPTION_PREVENTS_STATEMENT error tied to AWS RDS failover exactly, as it seems to be a generic error? Also, would there be any harm in just including a retry on this error anyway? That is, do we even need a flag for "handleFailover"?

I want to try and keep this library non-AWS specific, so if there is a way to make it more generic, that'd be preferred.

Thanks,
Jeremy

@nanoflite
Copy link
Author

nanoflite commented Nov 27, 2020 via email

@jeremydaly
Copy link
Owner

Thanks, @nanoflite. I'll look this over and get it merged in.

@janpio
Copy link
Contributor

janpio commented Apr 4, 2021

Fundamentally ER_OPTION_PREVENTS_STATEMENT seems to also be able to be caused by other situations, not just a failover situation. Is this correct @nanoflite? If so, it might be a bit far reaching to use it as a signal for a failover.

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

Successfully merging this pull request may close these issues.

3 participants