0

We have hit deadlocks in 10.1.25-MariaDB-1~trusty. Looks like it has something to do with select for update queries. But the deadlock increases when number of tps increases. Is there any alternative to fix this from DB end or from application end to change the logic?

1
  • 1
    Knowing what the SELECT FOR UPDATE queries, their table, indexes and query plan (EXPLAIN) and SHOW ENGINE INNODB STATUS could help. Fixing the indexes could make the queries faster, but this will only make the deadlock occurrence less likely. There's a possibility that excessive rows where locked here.
    – danblack
    Commented Sep 2, 2018 at 22:22

1 Answer 1

1

A deadlock is effectively two concurrency transactions updating the same data. This need to be handled at application level because there's no obvious solution that always works without accounting for the business case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.