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

"reorganize partition" ignores "data directory"

    XMLWordPrintable

    Details

      Description

      HI. I try to move (rotate) old partiotions to another local directory (another hard drive). Unfortunately, "data directory" is ignored by "alter table...reorganize partition" statement without any error/warning. For example:

      1. "create table" with "data directory" is OK

      MariaDB [(none)]> select @@version;
      +-----------------+
      | @@version       |
      +-----------------+
      | 10.2.11-MariaDB |
      +-----------------+
      1 row in set (0.00 sec)
      MariaDB [(none)]> use test
      Database changed
      MariaDB [test]> CREATE TABLE `part_test` (
          ->   `id` int(10) unsigned NOT NULL,
          ->   PRIMARY KEY (`id`)
          -> ) ENGINE=InnoDB
          -> PARTITION BY RANGE (`id`)
          -> (
          -> PARTITION p1 VALUES LESS THAN (100),
          -> PARTITION p2 VALUES LESS THAN (200) DATA DIRECTORY = '/var/lib/mysql_parition_moving/'
          -> ); 
      Query OK, 0 rows affected (0.12 sec)
      MariaDB [test]> show create table part_test \G
      *************************** 1. row ***************************
             Table: part_test
      Create Table: CREATE TABLE `part_test` (
        `id` int(10) unsigned NOT NULL,
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8
       PARTITION BY RANGE (`id`)
      (PARTITION `p1` VALUES LESS THAN (100) ENGINE = InnoDB,
       PARTITION `p2` VALUES LESS THAN (200) DATA DIRECTORY = '/var/lib/mysql_parition_moving' ENGINE = InnoDB)
      1 row in set (0.00 sec)
      

      "p2" parition file is in the right directory:

      [snen]# ls -lh /var/lib/mysql_parition_moving/test/
      total 96K
      -rw-rw----. 1 mysql mysql 96K дек 11 15:29 part_test#P#p2.ibd
      

      2. try to move "p1" to "p2" directory also

      MariaDB [test]> alter table part_test REORGANIZE PARTITION p1 into (PARTITION p1  VALUES LESS THAN(100)  DATA DIRECTORY '/var/lib/mysql_parition_moving/');
      Query OK, 0 rows affected (0.31 sec)
      Records: 0  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> show create table part_test \G
      *************************** 1. row ***************************
             Table: part_test
      Create Table: CREATE TABLE `part_test` (
        `id` int(10) unsigned NOT NULL,
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8
       PARTITION BY RANGE (`id`)
      (PARTITION `p1` VALUES LESS THAN (100) ENGINE = InnoDB,
       PARTITION `p2` VALUES LESS THAN (200) DATA DIRECTORY = '/var/lib/mysql_parition_moving' ENGINE = InnoDB)
      1 row in set (0.00 sec)
      

      "p1" parition file is NOT in the right directory:

      [snen]# ls -lh /var/lib/mysql_parition_moving/test/
      total 96K
      -rw-rw----. 1 mysql mysql 96K дек 11 15:29 part_test#P#p2.ibd
      

      PS
      10.1.26-MariaDB has the same behavior
      mysql 5.7.20 works fine (p1 moved)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              snen Dmitry Savolainen
              Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated: