1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Awaiting Feedback [1.4] Server error every time I rebuild usergroup promotions

Discussion in 'Resolved Bug Reports' started by Stuart Wright, Oct 26, 2014.

  1. Stuart Wright

    Stuart Wright Well-Known Member

    I have 3 usergroup promotions:
    1. From member 1 to member 2 requires membership of usergroup member 1, posted at least 1 message, registered for at least 1 day, has at least 3 positive ratings and has an avatar (this last one just added)
    2. From member 2 to member 3 requires membership of usergroup member 2 and 75 trophy points
    3. From Member 3 to Member 4 requires membership of usergroup member 3 and 150 trophy points
    each one adds the secondary usergroup which contains expanded privileges.
    When I rebuild User Group Promotions, I always get this error after a while:
    Hitting refresh seems to instantly complete the rebuild.
     
  2. Jim Boy

    Jim Boy Well-Known Member

    It instantly completes?

    AFAIK the execution of the user group promotion rebuild places a deferred task in the deferred table (xf_deffered), as the page refreshes, all it's doing is reading the deferred table and putting some output on display. As deferred runs, the script would remove the item from xf_deferred, execute whatever chunk is set, insert a new entry into the deferred table and then when the page refereshes that deferred task is run. If it instantly 'completes', it probably didn't complete at all - it's just that no new deferred task was made as the process borked part-way through.

    The error itself is a deadlock error, couldn't really say what's caused it with the in for provided. It could be a clash with another deferred task, such as the standard usergroup promotion cron job, or it could be a clash with a user record somewhere.
     
  3. Stuart Wright

    Stuart Wright Well-Known Member

    Probably a clash with a cron job, then, because it did complete when I ran it late last night, which would indicate that it's dependent on what else might be going on.
    It goes through the whole user table, right? Except for banned users, probably. So it has a lot to do and plenty of time for a cron job to run simultaneously.
     
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

  5. Mike

    Mike XenForo Developer Staff Member

    Please trigger this error and run this query and attach the output here or send it to me:

    SHOW ENGINE INNODB STATUS;
     
  6. HWS

    HWS Well-Known Member

    AlexT likes this.
  7. Mike

    Mike XenForo Developer Staff Member

    There's a good explanation of how Galera works here: http://www.percona.com/blog/2012/08...-multi-node-writing-and-unexpected-deadlocks/

    This seems very relevant here or with the other xf_deferred deadlocks. Those deadlocks are almost always MailQueue related, so it's very possible that this has failed because the transaction was a bit delayed, whereas standard InnoDB would have waited to get the lock (leading to no issue).
     
    HWS and AlexT like this.
  8. Stuart Wright

    Stuart Wright Well-Known Member

    I can't trigger it to order, but here is the latest example from just 7 minutes ago. (I don't have any particular reason to think this is related to user promotions. It's just they aren't working as expected):
     
  9. Stuart Wright

    Stuart Wright Well-Known Member

    Here is the INNODB status as requested
     
  10. Stuart Wright

    Stuart Wright Well-Known Member

    ...and the second bit because it's more than 10,000 characters...
     
  11. Stuart Wright

    Stuart Wright Well-Known Member

    ...and the third bit...
     
  12. Stuart Wright

    Stuart Wright Well-Known Member

    Going to disable XenPushover to see if the deadlocks go away.
     
  13. Stuart Wright

    Stuart Wright Well-Known Member

    @Mike and @Chris D I think the Pushover addon is the cause of the more frequent deadlock errors. While I've had 22 server errors since this time yesterday, none of them were deadlocks.
     
  14. Mike

    Mike XenForo Developer Staff Member

    I'm not positive it's directly related. It'd just be creating more contention. The Galera/cluster comment may be the most relevant though (as it's creating deadlocks that don't actually exist and unfortunately are basically unavoidable in a system like the deferred jobs).
     
    HWS likes this.

Share This Page