Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-16335

Include deadlock detail information in SHOW WARNINGS after deadlock detection error

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Right now deadlock information is only available globally for the most recent deadlock in SHOW ENGINE INNODB STATUS, so a client can never be sure that the information in there is indeed for the deadlock that happened in this connection, or whether it has already been overwritten by another deadlock incident in another session.

      The information returned by SHOW WARNINGS does not include any detail information yet:

      > update t1 set x=42 where id=1;
      ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction
      MariaDB (10.3.5-MariaDB) [test]
       
      > show warnings;
      +-------+------+--------------------------------------------------------------------+
      | Level | Code | Message                                                            |
      +-------+------+--------------------------------------------------------------------+
      | Error | 1213 | Deadlock found when trying to get lock; try restarting transaction |
      | Error | 1213 | Deadlock found when trying to get lock; try restarting transaction |
      +-------+------+--------------------------------------------------------------------+
      

      Alternative: have a SHOW ENGINE INNODB STATUS command that shows details on the most recent deadlock on a per-session basis instead of having it global only

      (there's innodb_print_all_deadlocks=1 which at least makes sure that information for every deadlock is logged in the error log, but this is not easily accessible to clients)

      Attachments

        Activity

          People

            Unassigned Unassigned
            hholzgra Hartmut Holzgraefe
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.