-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PS-3889: Native Partitioning for TokuDB and RocksDB for 5.7
TokuDB and MyRocks native partitioning is implemented as a copy of partition storage engine in 5.7 with corresponding changes. The base class - Partition_base does the most of the work. The general differences from ha_partition class are the following: 1) all code which works with .par files was removed; 2) the code to read partition information from .frm files was added; 3) the responsibility for creating new handlers for separate partitions is moved to Partition_base class descendants; 4) the initialization sequence for native and non-native partitioning handlers is different, that is why create() and open() functions are changed 5) delete and rename table functions are changed both for Partition_base and it's descendants(ha_tokupart and ha_rockspart) because it's necessary to determine if the table is partitioned before calling the corresponding functionality. The changes in the server code are the following: 1) remove .frm file after a table has been removed to let handler the ability to read partition info from .frm file during "delete table" execution; 2) remove "static" keyword from some functions signature to use them outside of their module. Two new system variables were added: tokudb_enable_native_patition - enable native partitioning for TokuDB, read-only, default value is 'off', rocksdb_enable_native_patition - enable native partitioning for RocksDB, read-only, default value is 'off'. The ability to have custom result directory for the certain options combination was added to MTR. To use it just add option "mtr-result-dir" in the certain options group in 'combinations' file. The ability to add only the certain list of tests for the certain option combination is added to MTR. For this purpose the new "mtr-tests-list" option is introduced. This option contains comma-separated list of tests in the current suite, which will be executed for the current options combination. If the option is missed then all tests from the suite will be executed for the combination. As an example of the new options see changed and newly created "combination" files of this commit. The above features are used to test TokuDB and RocksDB native and non-native partitioning, that is why the corresponding test suites have two directories for result files for one directory of tests.
- Loading branch information
1 parent
753801b
commit e6ab001
Showing
148 changed files
with
414,039 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
--replace_regex /[a-z0-9]+_[a-z0-9]+_[a-z0-9]+(_[BP]_[a-z0-9]+){0,1}\./id./ /sqlx_[a-z0-9]+_[a-z0-9]+_/sqlx_nnnn_nnnn_/ /sqlx-[a-z0-9]+_[a-z0-9]+/sqlx-nnnn_nnnn/ /#p#/#P#/ /#sp#/#SP#/ /#tmp#/#TMP#/ $ADDITIONAL_REGEX | ||
--replace_regex /_[a-z0-9]+_[a-z0-9]+_[a-z0-9]+(_[BP]_[a-z0-9]+){0,1}\.tokudb/_id.tokudb/ /sqlx_[a-z0-9]+_[a-z0-9]+_/sqlx_nnnn_nnnn_/ /sqlx-[a-z0-9]+_[a-z0-9]+/sqlx-nnnn_nnnn/ /#p#/#P#/ /#sp#/#SP#/ /#tmp#/#TMP#/ /_([0-9]+)\.sdi/_id.sdi/ $ADDITIONAL_REGEX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
27 changes: 27 additions & 0 deletions
27
mysql-test/suite/parts/inc/disable_native_partitioning.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--let $MYSQLD_DATADIR=`select @@datadir` | ||
|
||
--let $restart_parameters = "restart: --loose-$disable_native_partition_opt=0" | ||
--source include/restart_mysqld.inc | ||
|
||
eval CREATE TABLE t1 (a INT UNSIGNED NOT NULL, PRIMARY KEY(a)) ENGINE = $engine | ||
PARTITION BY RANGE (a) ( | ||
PARTITION p0 VALUES LESS THAN (100), | ||
PARTITION p1 VALUES LESS THAN (200) | ||
); | ||
|
||
--list_files $MYSQLD_DATADIR/test *.par | ||
|
||
DROP TABLE t1; | ||
|
||
--let $restart_parameters = "restart: " | ||
--source include/restart_mysqld.inc | ||
|
||
eval CREATE TABLE t1 (a INT UNSIGNED NOT NULL, PRIMARY KEY(a)) ENGINE = $engine | ||
PARTITION BY RANGE (a) ( | ||
PARTITION p0 VALUES LESS THAN (100), | ||
PARTITION p1 VALUES LESS THAN (200) | ||
); | ||
|
||
--list_files $MYSQLD_DATADIR/test *.par | ||
|
||
DROP TABLE t1; |
28 changes: 28 additions & 0 deletions
28
mysql-test/suite/parts/inc/update_parts_from_prev_ver_suppressions.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--disable_query_log | ||
call mtr.add_suppression("Resizing redo log from"); | ||
call mtr.add_suppression("Upgrading redo log"); | ||
call mtr.add_suppression("Starting to delete and rewrite log files"); | ||
call mtr.add_suppression("New log files created"); | ||
call mtr.add_suppression("You need to use --log-bin to make --binlog-format work"); | ||
call mtr.add_suppression("Creating routine without parsing routine body"); | ||
call mtr.add_suppression("Storage engine '.*' does not support system tables. \\[mysql.*\\]"); | ||
call mtr.add_suppression("Table 'mysql.component' doesn't exist"); | ||
call mtr.add_suppression("is expected to be transactional"); | ||
call mtr.add_suppression("table is missing or has an incorrect definition"); | ||
call mtr.add_suppression("ACL DDLs will not work unless mysql_upgrade is executed"); | ||
call mtr.add_suppression(".* Native table .* has the wrong structure"); | ||
call mtr.add_suppression("Column count of mysql.* is wrong"); | ||
call mtr.add_suppression(".*Missing system table mysql.global_grants.*"); | ||
call mtr.add_suppression("ACL table mysql.[a-z_]* missing. Some operations may fail."); | ||
call mtr.add_suppression("Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened"); | ||
call mtr.add_suppression("Error in checking mysql.slave_master_info repository info type of TABLE"); | ||
call mtr.add_suppression("Error creating master info: Error checking repositories."); | ||
call mtr.add_suppression("Slave: Failed to initialize the master info structure for channel"); | ||
call mtr.add_suppression("Failed to create or recover replication info repositories."); | ||
# 5.6 suppresions | ||
call mtr.add_suppression("Column count of performance_schema.* is wrong"); | ||
call mtr.add_suppression(".* has no `.*` column at position *"); | ||
call mtr.add_suppression("Failed to open optimizer cost constant tables"); | ||
call mtr.add_suppression(".* table is not ready to be used. Table '.*' cannot be opened."); | ||
call mtr.add_suppression("InnoDB: Cannot open '.*' for reading: No such file or directory"); | ||
--enable_query_log |
39 changes: 39 additions & 0 deletions
39
mysql-test/suite/parts/inc/upgrade_parts_from_prev_ver_alter.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--echo ######### | ||
--echo # Test for "ALTER TABLE ... UPGRADE PARTITIONING" | ||
--echo ### | ||
|
||
--echo # Unzip the zip file. | ||
--file_exists $DATA_ARCH_PATH | ||
--exec unzip -qo $DATA_ARCH_PATH -d $MYSQL_TMP_DIR | ||
|
||
--echo # Create a bootstrap file in temp location | ||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR | ||
--exec echo $MYSQL_TMP_DIR/bootstrap.log | ||
|
||
--let $restart_parameters = "restart: --loose-skip-log-bin --skip-log-slave-updates --datadir=$MYSQLD_DATADIR1 $ADDITIONAL_OPTS" | ||
--let $restart_hide_args = 1 | ||
--source include/start_mysqld.inc | ||
|
||
--echo # Check test table before upgrade | ||
SHOW CREATE TABLE test.t1; | ||
SELECT * FROM test.t1 ORDER BY a; | ||
--source include/table_files_replace_pattern.inc | ||
--list_files $MYSQLD_DATADIR1/test/ | ||
|
||
--echo # Upgrade | ||
ALTER TABLE test.t1 UPGRADE PARTITIONING; | ||
|
||
--echo # Check test table after upgrade | ||
SHOW CREATE TABLE test.t1; | ||
SELECT * FROM test.t1 ORDER BY a; | ||
--source include/table_files_replace_pattern.inc | ||
--list_files $MYSQLD_DATADIR1/test/ | ||
|
||
--echo # Stop the server | ||
--source include/shutdown_mysqld.inc | ||
|
||
--let $restart_parameters = | ||
--let $restart_hide_args = | ||
|
||
--echo # Remove data directory | ||
--exec rm -rf $MYSQLD_DATADIR1 |
32 changes: 32 additions & 0 deletions
32
mysql-test/suite/parts/inc/upgrade_parts_from_prev_ver_mysql_upgrade.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--echo ######### | ||
--echo # Test for upgrade partitioning with mysql_upgrade | ||
--echo ### | ||
|
||
--echo # Unzip the zip file. | ||
--file_exists $DATA_ARCH_PATH | ||
--exec unzip -qo $DATA_ARCH_PATH -d $MYSQL_TMP_DIR | ||
|
||
--let $restart_parameters = "restart: --loose-skip-log-bin --skip-log-slave-updates --datadir=$MYSQLD_DATADIR1 $ADDITIONAL_OPTS" | ||
--let $restart_hide_args = 1 | ||
--source include/start_mysqld.inc | ||
|
||
--echo # Execute mysql_upgrade | ||
--source include/mysql_upgrade_preparation.inc | ||
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 | ||
--source include/mysql_upgrade_cleanup.inc | ||
|
||
--echo # Check test table after upgrade | ||
SHOW CREATE TABLE test.t1; | ||
SELECT * FROM test.t1 ORDER BY a; | ||
--source include/table_files_replace_pattern.inc | ||
--list_files $MYSQLD_DATADIR1/test/ | ||
|
||
--echo # Stop the server | ||
--source include/shutdown_mysqld.inc | ||
|
||
--let $restart_parameters = | ||
--let $restart_hide_args = | ||
|
||
--echo # Remove copied files | ||
--remove_file $DATA_ARCH_PATH | ||
--exec rm -rf $MYSQLD_DATADIR1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.