-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
monthly_active_users table gets a ton of locks #4318
Comments
Previously there were limited locks on the table, and they were introduced in fixing #3854 |
@turt2live if you're feeling adventurous, could you try #4306 and see if that reduces the locking? It makes upserts atomic on Pg9.5+. |
#4306 does indeed appear to fix the issue, and theoretically would also allow for |
Turns out I was wrong about #4306 working. #4306 adds the native upsert on Out of fear of breaking the rest of synapse, I just modified the MAU stuff to use Additionally, my postgres is still angry for some dumb reason:
It appears as though dropping the index and recreating it fixes it (I haven't seen it in the ~10 minutes synapse has been running), although it is questionable how there got to be such a broken index in the first place. |
and yet another update:
|
I'm a bit confused about what introduced this change. @turt2live says
but the fix to #3854 (#3961) landed in 0.33.6, so unless you've just upgraded from something earlier than that (?), it doesn't really explain why it suddenly started now. |
I was upgrading from 0.34-rc2 to develop. I think what happened was a large queue of events got drained as soon as the server came back alive. Combined with the startup routines of synapse for mau, it deadlocked. |
Okay so sounds like the strategy to fix this is to wait for #4306 to land then either modify just |
@neilisfragile do you mean #4306 ? |
Yes I do, updated, thanks. |
Ok so this isn't anything specific to 0.34? |
on retrospect, probably not. It was just a convenient time for it to all fall apart. I haven't tested or reproduced the issue on earlier versions, however. I also haven't been able to replicate the exact conditions since upgrading. |
I am going to close this in favour of the root cause of locks in this area, #4015 . |
~1100 records not shown
This is with:
The text was updated successfully, but these errors were encountered: