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

Deadlock when attempting to update field with same value

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 5.5.35-galera, 5.5.36-galera
    • 5.5.38-galera
    • None
    • Main system:
      - CentOS 6.3 x64
      - MariaDB-Galera-server-5.5.36-1.el6.x86_64
      - galera-25.3.2-1.rhel6.x86_64

      Tested with multiple systems and versions (see description for details).

    Description

      We have a Galera cluster containing two MariaDB servers with multi-master replication.

      When I try to update a field inside a table using the value the field already has (e. g. update value "test" with "test") I get the following error, no matter if integer, boolean or string.

      ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction

      Below you can find the steps how to reproduce this. I also tried that on a MariaDB server without Galera and there it was executed without any errors:

      Query OK, 0 rows affected (0.01 sec)
      Rows matched: 1 Changed: 0 Warnings: 0

      I've already posted this inside the Galera bug list and received the following answer:

      Can't be reproduced with the reference Codership binaries. This must be a MariaDB-specific bug and should be filed with them.

      Used systems:

      • CentOS 6.3 x64
        • MariaDB-Galera-server-5.5.35-1.el6.x86_64
        • galera-25.3.2-1.rhel6.x86_64
      • CentOS 6.3 x64
        • MariaDB-Galera-server-5.5.36-1.el6.x86_64
        • galera-25.3.2-1.rhel6.x86_64
      • CentOS 6.5 x64
        • MariaDB-server-5.5.36-1.el6.x86_64
        • no Galera packages installed (the case where no error occurred)

      Edit: This bug seems to be already fixed in MariaDB version 10.

      Successfully tested with:
      - CentOS 6.3 x64
      - MariaDB-Galera-server-10.0.7-1.x86_64
      - galera-25.3.2-1.rhel6.x86_64

      How to reproduce:

      CREATE DATABASE mytest;
      USE mytest;
      CREATE TABLE mytable (
          id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
          myint INT DEFAULT 0,
          mybool BOOL DEFAULT 0,
          mystr VARCHAR(100) DEFAULT ""
      );
      INSERT INTO `mytest`.`mytable` (`myint`, `mystr`) VALUES ('0', 'test');
      UPDATE mytable SET myint = 0 WHERE id = 1;
      UPDATE mytable SET mybool = 0 WHERE id = 1;
      UPDATE mytable SET mystr = "test" WHERE id = 1;

      Attachments

        Activity

          People

            nirbhay_c Nirbhay Choubey (Inactive)
            lgsit Ralf Kilian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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