Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-5046

TokuDB doesn't throw an error when creating partitioned table with data/index directory specified

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: On Hold
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 5.6.41-84.1, 8.0.12-2rc1, 5.7.23-24
    • Fix Version/s: None
    • Component/s: TokuDB
    • Labels:
      None

      Description

      InnoDB supports data directory option, but not index directory when using partitioned tables. RocksDB and TokuDB don't seem to support any of those, but RocksDB throws an error while TokuDB happily ignores it.

      Here's how it looks:
      8.0.12

      8.0.12>create table t1 (a int) engine=innodb partition by key (a) (partition p0, partition p1 DATA DIRECTORY '/tmp/8.0/part-data-innodb');
      Query OK, 0 rows affected (0.14 sec)
      
      8.0.12>create table t1 (a int) engine=tokudb partition by key (a) (partition p0, partition p1 DATA DIRECTORY '/tmp/8.0/part-data-tokudb');
      ERROR 1050 (42S01): Table 't1' already exists
      8.0.12>create table t2 (a int) engine=tokudb partition by key (a) (partition p0, partition p1 DATA DIRECTORY '/tmp/8.0/part-data-tokudb');
      Query OK, 0 rows affected (0.19 sec)
      
      8.0.12>create table t3 (a int) engine=rocksdb partition by key (a) (partition p0, partition p1 DATA DIRECTORY '/tmp/8.0/part-data-rocksdb');
      ERROR 1296 (HY000): Got error 207 'Specifying DATA DIRECTORY for an individual table is not supported.' from ROCKSDB
      
      8.0.12>create table t4 (a int) engine=tokudb partition by key (a) (partition p0, partition p1 INDEX DIRECTORY '/tmp/8.0/part-data-tokudb');
      Query OK, 0 rows affected (0.17 sec)
      
      8.0.12>create table t3 (a int) engine=rocksdb partition by key (a) (partition p0, partition p1 INDEX DIRECTORY '/tmp/8.0/part-data-rocksdb');
      ERROR 1296 (HY000): Got error 208 'Specifying INDEX DIRECTORY for an individual table is not supported.' from ROCKSDB
      
      8.0.12>create table t6 (a int) engine=tokudb partition by key (a) (partition p0, partition p1 INDEX DIRECTORY '/tmp/8.0/part-data-tokudb');
      Query OK, 0 rows affected (0.22 sec)
      
      8.0.12>create table t7 (a int) engine=innodb partition by key (a) (partition p0, partition p1 INDEX DIRECTORY '/tmp/8.0/part-data-innodb');
      ERROR 1031 (HY000): Table storage engine for 't7' doesn't have this option
      

      5.7.23:

      5.7.23>create table t1 (a int) engine=innodb partition by key (a) (partition p0, partition p1 DATA DIRECTORY '/tmp/5.7/part-data-innodb');
      Query OK, 0 rows affected (0.12 sec)
      
      5.7.23>create table t2 (a int) engine=tokudb partition by key (a) (partition p0, partition p1 DATA DIRECTORY '/tmp/5.7/part-data-tokudb');
      Query OK, 0 rows affected, 1 warning (0.21 sec)
      
      5.7.23>create table t3 (a int) engine=rocksdb partition by key (a) (partition p0, partition p1 DATA DIRECTORY '/tmp/5.7/part-data-rocksdb');
      ERROR 1296 (HY000): Got error 204 'Specifying DATA DIRECTORY for an individual table is not supported.' from ROCKSDB
      
      5.7.23>create table t5 (a int) engine=tokudb partition by key (a) (partition p0, partition p1 INDEX DIRECTORY '/tmp/5.7/part-data-tokudb');
      Query OK, 0 rows affected, 1 warning (0.20 sec)
      
      5.7.23>create table t3 (a int) engine=rocksdb partition by key (a) (partition p0, partition p1 INDEX DIRECTORY '/tmp/5.7/part-data-rocksdb');
      ERROR 1296 (HY000): Got error 205 'Specifying INDEX DIRECTORY for an individual table is not supported.' from ROCKSDB
      

      5.6.24:

      5.6.41>create table t1 (a int) engine=innodb partition by key (a) (partition p0, partition p1 DATA DIRECTORY '/tmp/5.6/part-data-innodb');
      Query OK, 0 rows affected (0.12 sec)
      
      5.6.41>create table t2 (a int) engine=tokudb partition by key (a) (partition p0, partition p1 DATA DIRECTORY '/tmp/5.6/part-data-tokudb');
      Query OK, 0 rows affected (0.17 sec)
      
      5.6.41>create table t4 (a int) engine=tokudb partition by key (a) (partition p0, partition p1 INDEX DIRECTORY '/tmp/5.6/part-data-tokudb');
      Query OK, 0 rows affected (0.16 sec)
      

      You can see that only InnoDB placed p1 into specified location:

       plavi@bender  /tmp/5.6  ls -1
      part-data-innodb
       plavi@bender  /tmp/5.6  cd ../5.7
       plavi@bender  /tmp/5.7  ls -1
      part-data-innodb
       plavi@bender  /tmp/5.7  cd ../8.0
       plavi@bender  /tmp/8.0  ls -1
      part-data-innodb
       plavi@bender  /tmp/8.0  ls
      part-data-innodb
       plavi@bender  /tmp/8.0  cd part-data-innodb
       plavi@bender  /tmp/8.0/part-data-innodb  ls
      test
       plavi@bender  /tmp/8.0/part-data-innodb  cd test
       plavi@bender  /tmp/8.0/part-data-innodb/test  ls
      t1#P#p1.ibd
      

      TokuDB placed both partitions in the datadir:

       plavi@bender  ~/lab/mysql/bin/Percona-Server-8.0.12-1-Linux.x86_64-c0d95f-opt/data/test  ls -1
      t1#P#p0.ibd
      t2_484.sdi
      t2_P_p0_main_273b_2_1d.tokudb
      t2_P_p0_status_273b_1_1d.tokudb
      t2_P_p1_main_273c_2_1d.tokudb
      t2_P_p1_status_273c_1_1d.tokudb
      t4_486.sdi
      t4_P_p0_main_2741_2_1d.tokudb
      t4_P_p0_status_2741_1_1d.tokudb
      t4_P_p1_main_2742_2_1d.tokudb
      t4_P_p1_status_2742_1_1d.tokudb
      t6_488.sdi
      t6_P_p0_main_2748_2_1d.tokudb
      t6_P_p0_status_2748_1_1d.tokudb
      t6_P_p1_main_2749_2_1d.tokudb
      t6_P_p1_status_2749_1_1d.tokudb
      

      Those options seem often used with partitioning so I think it would be best to throw an error here for TokuDB as well.

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              tomislav.plavcic@percona.com Tomislav Plavcic
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 30 minutes
                  30m