-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
postgresql deadlock - INSERT INTO user_ips #14199
Comments
This is over a year old; please upgrade to the latest stable release and see if that resolves your issue.
This includes access tokens and user ids. I have redacted the access tokens from your logs, but you should assume these devices are compromised and log them out. If necessary The Admin API can be used to logout all devices of a particular user. |
Hello, It is not easy to upgrade Synapse version on production because we have a QA(Lifecycle) process. I will try to reproduce on my test environment with latest synapse version. By the way, could you answer for the questions above?
Thanks you. |
How are your workers configured? Have you configured Note that only one worker is supposed to be configured write to the client IP tables---presumably to avoid precisely this kind of deadlock. synapse/synapse/storage/databases/main/client_ips.py Lines 429 to 431 in e630722
Additionally:
Be advised: Synapse 1.35 has known security issues: see https://github.com/matrix-org/synapse/security/advisories.
Not that I can see.
I wouldn't advise this: the data stores are tightly coupled together and this is liable to cause breakages. |
True: this was done in #12251 (1.57). Odd then that you see this deadlock. I would sanity check that there aren't two workers which are both configured to be the master worker. |
Can you see where these requests come from by looking at Synapse logs? Look for the IP address and user agent, say in the 10 minutes prior to |
Hello, That is from postgresql logs. It does not related to synapse's security. Thanks you. |
Yes. I'm asking for Synapse logs corresponding to those postgres logs.
Postgres logs absolutely can be related to Synapse security if those logs contain secret values read by Synapse. As noted in my first response, the postgres logs you provided included Synapse access tokens which grant complete control over their users' accounts. I manually redacted those tokens. |
Hello, The transaction logger of the Synapse makes the logs. Logger
logs
Thanks you. |
as an implementation note: It could be worth ordering the upserted rows so that deadlocks are not possible. (I wondered if dropping down to READ COMMITTED isolation level might help but thinking about it I don't think it would.) |
You could comment out the queries in Whether this issue or not is still a problem would need someone to try and reproduce it on a modern version of Synapse. As DMRobertson says, v1.35 is not supported anymore and moreover has known security vulnerabilities. |
I am going to close this for now, if you have upgraded to a modern version of Synapse and still see this issue, feel free to come back and comment and I will re-open. |
Description
Dear Synapse,
Deadlock is happen so often in Posgresql because
synapse workers tries to update lots of client ips on background process.
Also, sometimes it takes over 5 secs to process insert user_ips.
Is there any way to turn off inserting client ips? or any configuration?
Can I block(comment out) some store such as
ClientIpBackgroundUpdateStore
?Is it independent from other synapse modules? So, it does not side-effect from that?
Thanks you.
Best Regards
Hyosung
Steps to reproduce
Reproducing
Reproducing is not easy. It is only shown on our synapse homeserver.
Synapse Deployment
Synapse Usage
Homeserver
another homeserver
Synapse Version
1.35.0
Installation Method
Docker (matrixdotorg/synapse)
Platform
Operating System
Relevant log output
Anything else that would be useful to know?
Posgresql Log
The text was updated successfully, but these errors were encountered: