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

Synapse gets stuck after seeing psycopg2.errors.ReadOnlySqlTransaction: cannot execute nextval() in a read-only transaction #16490

Open
matrixbot opened this issue Dec 21, 2023 · 0 comments

Comments

@matrixbot
Copy link
Collaborator

matrixbot commented Dec 21, 2023

This issue has been migrated from #16490.


https://github.com/matrix-org/synapse/blob/166ffc0f23419bc99d9597fe95deaae3bbee7caf/synapse/rest/health.py#L29-L31

Hi :)

It seems like the health endpoint is a little too simple. For example, I am getting with patroni (pg cluster) sometimes synapse in a state where it gets stuck in a read-only transaction state psycopg2.errors.ReadOnlySqlTransaction: cannot execute nextval() in a read-only transaction. Synapse never recovers until a restart from this, even when the database is already healthy for hours again. Meanwhile, however, my Kubernetes which could have easily restarted synapse by now thinks the server is healthy while all api endpoints fail.

Would it be possible to include fatal errors from the database in the evaluation of the health endpoint? Or are there other suggestions on how to solve this for someone hosting a synapse server?

@matrixbot matrixbot changed the title Dummy issue Synapse gets stuck after seeing psycopg2.errors.ReadOnlySqlTransaction: cannot execute nextval() in a read-only transaction Dec 22, 2023
@matrixbot matrixbot reopened this Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant