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

[11.X] Postgres Aurora failover - DetectsLostConnections #53404

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

vifer
Copy link
Contributor

@vifer vifer commented Nov 4, 2024

We recently experienced a Postgres Aurora failover on production and noticed that our queue workers didn't restart. We are using read and write endpoints for the database connection in database.php and when Aurora fails over, the writer connection becomes a reader, but Laravel is trying to perform writes on it.

The exception message we are getting:

  • SQLSTATE[25006]: Read only sql transaction: 7

By adding this exception to the list lost connection in DetectsLostConnections.php, Laravel should reconnect to the right connection.

@taylorotwell taylorotwell merged commit 662989f into laravel:11.x Nov 5, 2024
33 checks passed
@vifer vifer deleted the feature/read-only-mode branch November 5, 2024 08:01
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.

2 participants