XF 2.3 Galera cluster xf_user deadlock on post alerts deletion

shockblazy

New member
We've been stress testing a new xenforo installation on a galera cluster (preparing for a forum migration) and we've encountered a deadlock error, which we can't figure out:

1723211949704.webp


We already tried different galera settings for the nodes, none of the variables helps this issue (some other deadlocks that we had were fixed tho, this is the only one that we can't)

I would guess that commenting out the alerts deletion on post deletion would probably fix it, but has someone managed to fix this without altering the code?

Note: the cluster has 1 write node, all others are load balanced read nodes.

Cheers.
 
Stock Xenforo is quite bad at maintaining a consistent locking order for alerts & user updates, there are still some outstanding bug reports around this (ref #1 #2, #3 ).

Try my Alerts Improvements add-on, it actually rewrites a lot of the core Alert expiring/handling code to explicitly avoid deadlocks and too-large transaction sets for alerts for a galera cluster.


This add-on is used heavily on https://forums.spacebattles.com/ and handles 500k-600k alerts per day
 
Last edited:
Speaking of alerts foot-guns with galera and a high enough alert generation rate; the stock 32bit unsigned int autoincrement id isn't enough.

Alert Improvements add-on (should) support 64bit xf_user_alert.alert_id with it's feature but 3rd party code which binds to alert_id will probably break.

A 64bit xf_user_alert.alert_id is very nearly required on spacebattles:
SQL:
MariaDB [sbforums]>select round(100*max(alert_id)/pow(2,32),0) as "%" from xf_user_alert;
+------+
| %    |
+------+
|   74 |
+------+
 
Last edited:
Stock Xenforo is quite bad at maintaining a consistent locking order for alerts & user updates, there are still some outstanding bug reports around this (ref #1 #2, #3 ).

Try my Alerts Improvements add-on, it actually rewrites a lot of the core Alert expiring/handling code to explicitly avoid deadlocks and too-large transaction sets for alerts for a galera cluster.


This add-on is used heavily on https://forums.spacebattles.com/ and handles 500k-600k alerts per day
Will try it out!

Speaking of alerts foot-guns with galera and a high enough alert generation rate; the stock 32bit unsigned int autoincrement id isn't enough.

Alert Improvements add-on (should) support 64bit xf_user_alert.alert_id with it's feature but 3rd party code which binds to alert_id will probably break.

A 64bit xf_user_alert.alert_id is very nearly required on spacebattles:
SQL:
MariaDB [sbforums]>select round(100*max(alert_id)/pow(2,32),0) as "%" from xf_user_alert;
+------+
| %    |
+------+
|   74 |
+------+
Yes, we actually noticed this too (also applies to some other very active tables as well) and pushed a patch for it.

I'll update the thread, if we fix the alerts issue.
 
Back
Top Bottom