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

10.11.8 cluster becomes inconsistent when using composite primary key and partitioning

Details

    Description

      In a 10.11.8 Galera cluster (Galera 26.4.18), the following causes the cluster to become inconsistent and a node kicked out:

      CREATE TABLE `t1` (
        `id` int(10) unsigned NOT NULL,
        `other_id` int(10) unsigned NOT NULL,
        PRIMARY KEY (`id`,`other_id`)
      ) ENGINE=InnoDB
       PARTITION BY LIST (`id` MOD 2)
      (PARTITION `p0` VALUES IN (0) ENGINE = InnoDB,
       PARTITION `p1` VALUES IN (1) ENGINE = InnoDB);
       
      INSERT INTO t1 VALUES (1, 0);
       
      CREATE TABLE t2 LIKE t1;
       
      START TRANSACTION;
       
      INSERT INTO t2(SELECT * FROM t1 WHERE id = 1);
      DELETE FROM t1 WHERE id = 1;
       
      SELECT SLEEP(1);
       
      COMMIT;
      

      The partitioning can be based on either id or other_id, it doesn't seem to matter. It also shouldn't matter what particular values are used in the INSERT.

      Without the SLEEP call, the other node hangs forever executing the commit. When I discovered this problem in the real world, the symptom was the inconsistency and not the hang, so I've put the SLEEP in the example. Of course either failure is really bad.

      This problem does not occur on 10.11.7 (Galera 26.4.16).

      Attachments

        Issue Links

          Activity

            DrJaymz James Cross added a comment -

            "bug is present if you use INSERT INTO ... SELECT ... for partitioned tables." means to me that bug not present if database doesn't have partitioned tables. Therefore I have ONLY downgraded clusters having partitioned tables. I downgraded because I do not expect a fix immediately.

            DrJaymz James Cross added a comment - "bug is present if you use INSERT INTO ... SELECT ... for partitioned tables." means to me that bug not present if database doesn't have partitioned tables. Therefore I have ONLY downgraded clusters having partitioned tables. I downgraded because I do not expect a fix immediately.
            janlindstrom Jan Lindström added a comment - https://github.com/MariaDB/server/pull/3319
            sysprg Julius Goryavsky added a comment - The fix has been merged with the head revision: https://github.com/MariaDB/server/commit/0172887980cd6297cbda1dda79ecbde0568c4664 +post-fix change: https://github.com/MariaDB/server/commit/0d85c905c44f9d88e4a17f56594cc389d777abaf

            I've modified the MariaDB-provided 10.11.8 Debian sources to include the fix, and it seems to work perfectly. Thanks very much, Jan and Julius.

            James, you probably want to close out MDEV-34267.

            xan@biblionix.com Xan Charbonnet added a comment - I've modified the MariaDB-provided 10.11.8 Debian sources to include the fix, and it seems to work perfectly. Thanks very much, Jan and Julius. James, you probably want to close out MDEV-34267 .
            DrJaymz James Cross added a comment -

            I don't have a close option.

            DrJaymz James Cross added a comment - I don't have a close option.

            People

              sysprg Julius Goryavsky
              xan@biblionix.com Xan Charbonnet
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.