← Back to team overview

mahara-contributors team mailing list archive

[Bug 1514608] Re: MySQL deadlock issues with simultaneous users

 

Great, pleased that was helpful.  The JMeter plan is fairly
unsophisticated, a better plan would parse the response and adjust
accordingly.  In the mean time your response code approach is a good
suggestion.

Out of interest, is it easier to trigger the deadlock problems if you
drop the transaction isolation level back down to REPEATABLE READ?

Deadlock info from "show engine innodb status" would be very helpful in
identifying the root cause of the deadlocks.  Even if the decision is to
go transaction-free for MySQL....it might be useful further down the
line.

When I looked at this before I don't think I quite appreciated how much
other stuff is happening between the db_begin() and db_commit().  So
moving file operations out of this would be good anyway.

>  Although it's strange to me, because I have not heard of any deadlock problems with Mahara in Postgres. 
> Instead, the site tends to just slow down under heavy usage. Although perhaps that's Postgres being 
> willing to wait longer for the deadlock to clear?

Maybe but PostgreSQL and MySQL have different strategies for dealing
with transactions and overlapping updates.  The other thing I've just
spotted is that slightly different SQL is being used on the two
platforms.  There are some 'FOR UPDATE' clauses which are only applied
in the case of PostgreSQL (in lib/dml.php) which might have some impact.
Will investigate...

And while I think of it, MySQL 5.7 has a number of changes that might be
important later.  See the details around "index lock contention" on
http://mysqlserverteam.com/whats-new-in-mysql-5-7-so-far/

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1514608

Title:
  MySQL deadlock issues with simultaneous users

Status in Mahara:
  In Progress

Bug description:
  The patch in Bug 1492919 resolved the deadlock issues for some users,
  but others are still reporting that they are getting deadlocks. This
  seems to be an issue unique to MySQL, and it can happen with as few as
  2 or 3 concurrent users.

  It has been reported across all stable versions. Strangely, it seems
  to be a relatively recent issue (i.e. we never heard this with Mahara
  1.8 or 1.7, etc), so this suggests it was triggered by something that
  changed fairly recently. One possible candidate is our switch to the
  mysqli driver (before that Mahara wasn't doing transactions at all, in
  mysql).

  See also:
  * https://mahara.org/interaction/forum/topic.php?id=7309
  * https://mahara.org/interaction/forum/topic.php?id=7432

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1514608/+subscriptions


References