From 555b1b9f15a32ad55a750d856070a5702077b56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Tue, 24 Jan 2017 09:27:15 +0200 Subject: [PATCH] Make rocksdb dynamic plugin --- storage/rocksdb/CMakeLists.txt | 2 +- .../mysql-test/rocksdb/include/have_rocksdb.inc | 10 ++++++++++ .../mysql-test/rocksdb}/include/have_rocksdb.opt | 0 .../rocksdb/include/have_rocksdb_default.inc | 10 ++++++++++ .../rocksdb/include/have_rocksdb_replication.inc | 6 ------ storage/rocksdb/mysql-test/rocksdb/my.cnf | 5 ++--- storage/rocksdb/mysql-test/rocksdb/suite.opt | 2 +- 7 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb.inc rename {mysql-test => storage/rocksdb/mysql-test/rocksdb}/include/have_rocksdb.opt (100%) create mode 100644 storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb_default.inc rename mysql-test/include/have_rocksdb.inc => storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb_replication.inc (74%) diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt index cd73fbdb811..e6948c60a51 100644 --- a/storage/rocksdb/CMakeLists.txt +++ b/storage/rocksdb/CMakeLists.txt @@ -113,7 +113,7 @@ ENDIF() SET(rocksdb_static_libs ROCKSDB_AUX_LIB ${rocksdb_static_libs} ${ZLIB_LIBRARY} "-lrt") -MYSQL_ADD_PLUGIN(rocksdb_se ${ROCKSDB_SOURCES} STORAGE_ENGINE DEFAULT STATIC_ONLY +MYSQL_ADD_PLUGIN(rocksdb_se ${ROCKSDB_SOURCES} STORAGE_ENGINE DEFAULT MODULE_ONLY LINK_LIBRARIES ${rocksdb_static_libs} ) diff --git a/storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb.inc b/storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb.inc new file mode 100644 index 00000000000..1f762d38c64 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb.inc @@ -0,0 +1,10 @@ +if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'rocksdb' AND support IN ('YES', 'DEFAULT', 'ENABLED')`) +{ + --skip Test requires engine RocksDB. +} + +--disable_query_log +# Table statistics can vary depending on when the memtables are flushed, so +# flush them at the beginning of the test to ensure the test runs consistently. +set global rocksdb_force_flush_memtable_now = true; +--enable_query_log diff --git a/mysql-test/include/have_rocksdb.opt b/storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb.opt similarity index 100% rename from mysql-test/include/have_rocksdb.opt rename to storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb.opt diff --git a/storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb_default.inc b/storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb_default.inc new file mode 100644 index 00000000000..2c50afd5014 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb_default.inc @@ -0,0 +1,10 @@ +if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'rocksdb'` AND support in ('DEFAULT')`) +{ + --skip Test requires engine RocksDB as default. +} + +--disable_query_log +# Table statistics can vary depending on when the memtables are flushed, so +# flush them at the beginning of the test to ensure the test runs consistently. +set global rocksdb_force_flush_memtable_now = true; +--enable_query_log diff --git a/mysql-test/include/have_rocksdb.inc b/storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb_replication.inc similarity index 74% rename from mysql-test/include/have_rocksdb.inc rename to storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb_replication.inc index c76d851e339..92261211bf5 100644 --- a/mysql-test/include/have_rocksdb.inc +++ b/storage/rocksdb/mysql-test/rocksdb/include/have_rocksdb_replication.inc @@ -1,8 +1,3 @@ -if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'rocksdb' AND support IN ('DEFAULT')`) -{ - --skip Test requires default engine RocksDB -} - # MARIAROCKS_NOT_YET: replication doesn't work yet: #if (`select count(*) = 0 from information_schema.tables where engine='rocksdb' and table_name='slave_gtid_info'`) #{ @@ -14,4 +9,3 @@ if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'rocksdb # flush them at the beginning of the test to ensure the test runs consistently. set global rocksdb_force_flush_memtable_now = true; --enable_query_log - diff --git a/storage/rocksdb/mysql-test/rocksdb/my.cnf b/storage/rocksdb/mysql-test/rocksdb/my.cnf index d5f501e15ad..5f85ab8b54d 100644 --- a/storage/rocksdb/mysql-test/rocksdb/my.cnf +++ b/storage/rocksdb/mysql-test/rocksdb/my.cnf @@ -1,12 +1,11 @@ !include include/default_my.cnf [server] -rocksdb skip-innodb default-storage-engine=rocksdb sql-mode=NO_ENGINE_SUBSTITUTION explicit-defaults-for-timestamp=1 -rocksdb_lock_wait_timeout=1 -rocksdb_strict_collation_check=0 +#rocksdb_lock_wait_timeout=1 +#rocksdb_strict_collation_check=0 diff --git a/storage/rocksdb/mysql-test/rocksdb/suite.opt b/storage/rocksdb/mysql-test/rocksdb/suite.opt index 8907deed6d8..0d92a9bb29d 100644 --- a/storage/rocksdb/mysql-test/rocksdb/suite.opt +++ b/storage/rocksdb/mysql-test/rocksdb/suite.opt @@ -1,2 +1,2 @@ ---ignore-db-dirs=.rocksdb +--ignore-db-dirs=.rocksdb --plugin-load=ha_rocksdb_se