mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Revert "MDEV-30610 Update RocksDB to v8.1.1"
Not ready yet, it fails its own test suite
This reverts commit 485c9b1fb3
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -243,12 +243,8 @@ storage/rocksdb/ldb
|
|||||||
storage/rocksdb/myrocks_hotbackup
|
storage/rocksdb/myrocks_hotbackup
|
||||||
storage/rocksdb/mysql_ldb
|
storage/rocksdb/mysql_ldb
|
||||||
storage/rocksdb/mysql_ldb.1
|
storage/rocksdb/mysql_ldb.1
|
||||||
storage/rocksdb/mariadb-ldb
|
|
||||||
storage/rocksdb/rdb_source_revision.h
|
storage/rocksdb/rdb_source_revision.h
|
||||||
storage/rocksdb/sst_dump
|
storage/rocksdb/sst_dump
|
||||||
storage/rocksdb/mysql_sst_dump
|
|
||||||
storage/rocksdb/mysql_sst_dump.1
|
|
||||||
storage/rocksdb/mariadb-sst-dump
|
|
||||||
strings/conf_to_src
|
strings/conf_to_src
|
||||||
support-files/MySQL-shared-compat.spec
|
support-files/MySQL-shared-compat.spec
|
||||||
support-files/binary-configure
|
support-files/binary-configure
|
||||||
@@ -622,6 +618,7 @@ scripts/mariadb-secure-installation
|
|||||||
scripts/mariadb-setpermission
|
scripts/mariadb-setpermission
|
||||||
sql/mariadbd
|
sql/mariadbd
|
||||||
sql/mariadb-tzinfo-to-sql
|
sql/mariadb-tzinfo-to-sql
|
||||||
|
storage/rocksdb/mariadb-ldb
|
||||||
strings/ctype-uca1400data.h
|
strings/ctype-uca1400data.h
|
||||||
strings/uca-dump
|
strings/uca-dump
|
||||||
tests/mariadb-client-test
|
tests/mariadb-client-test
|
||||||
|
@@ -33,7 +33,6 @@ REGISTER_SYMLINK("mariadb-secure-installation" "mysql_secure_installation")
|
|||||||
REGISTER_SYMLINK("mariadb-setpermission" "mysql_setpermission")
|
REGISTER_SYMLINK("mariadb-setpermission" "mysql_setpermission")
|
||||||
REGISTER_SYMLINK("mariadb-show" "mysqlshow")
|
REGISTER_SYMLINK("mariadb-show" "mysqlshow")
|
||||||
REGISTER_SYMLINK("mariadb-slap" "mysqlslap")
|
REGISTER_SYMLINK("mariadb-slap" "mysqlslap")
|
||||||
REGISTER_SYMLINK("mariadb-sst-dump" "mysql_sst_dump")
|
|
||||||
REGISTER_SYMLINK("mariadb-test" "mysqltest")
|
REGISTER_SYMLINK("mariadb-test" "mysqltest")
|
||||||
REGISTER_SYMLINK("mariadb-test-embedded" "mysqltest_embedded")
|
REGISTER_SYMLINK("mariadb-test-embedded" "mysqltest_embedded")
|
||||||
REGISTER_SYMLINK("mariadb-tzinfo-to-sql" "mysql_tzinfo_to_sql")
|
REGISTER_SYMLINK("mariadb-tzinfo-to-sql" "mysql_tzinfo_to_sql")
|
||||||
|
4
debian/autobake-deb.sh
vendored
4
debian/autobake-deb.sh
vendored
@@ -29,6 +29,10 @@ remove_rocksdb_tools()
|
|||||||
{
|
{
|
||||||
sed '/rocksdb-tools/d' -i debian/control
|
sed '/rocksdb-tools/d' -i debian/control
|
||||||
sed '/sst_dump/d' -i debian/not-installed
|
sed '/sst_dump/d' -i debian/not-installed
|
||||||
|
if ! grep -q sst_dump debian/mariadb-plugin-rocksdb.install
|
||||||
|
then
|
||||||
|
echo "usr/bin/sst_dump" >> debian/mariadb-plugin-rocksdb.install
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
add_lsb_base_depends()
|
add_lsb_base_depends()
|
||||||
|
4
debian/mariadb-plugin-rocksdb.install
vendored
4
debian/mariadb-plugin-rocksdb.install
vendored
@@ -1,12 +1,8 @@
|
|||||||
etc/mysql/mariadb.conf.d/rocksdb.cnf
|
etc/mysql/mariadb.conf.d/rocksdb.cnf
|
||||||
usr/bin/mariadb-ldb
|
usr/bin/mariadb-ldb
|
||||||
usr/bin/mariadb-sst-dump
|
|
||||||
usr/bin/myrocks_hotbackup
|
usr/bin/myrocks_hotbackup
|
||||||
usr/bin/mysql_ldb
|
usr/bin/mysql_ldb
|
||||||
usr/bin/mysql_sst_dump
|
|
||||||
usr/lib/mysql/plugin/ha_rocksdb.so
|
usr/lib/mysql/plugin/ha_rocksdb.so
|
||||||
usr/share/man/man1/mariadb-ldb.1
|
usr/share/man/man1/mariadb-ldb.1
|
||||||
usr/share/man/man1/mariadb-sst-dump.1
|
|
||||||
usr/share/man/man1/myrocks_hotbackup.1
|
usr/share/man/man1/myrocks_hotbackup.1
|
||||||
usr/share/man/man1/mysql_ldb.1
|
usr/share/man/man1/mysql_ldb.1
|
||||||
usr/share/man/man1/mysql_sst_dump.1
|
|
||||||
|
@@ -1504,33 +1504,6 @@
|
|||||||
fun:_ZN7myrocksL27rdb_init_rocksdb_db_optionsEv
|
fun:_ZN7myrocksL27rdb_init_rocksdb_db_optionsEv
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
Still reachable for once-per-process initializations
|
|
||||||
Memcheck:Leak
|
|
||||||
match-leak-kinds: reachable
|
|
||||||
...
|
|
||||||
fun:_ZN10my_rocksdb24CacheEntryStatsCollectorINS_13InternalStats19CacheEntryRoleStatsEE9GetSharedEPNS_5CacheEPNS_11SystemClockEPSt10shared_ptrIS3_E
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Still reachable for once-per-process initializations
|
|
||||||
Memcheck:Leak
|
|
||||||
match-leak-kinds: reachable
|
|
||||||
...
|
|
||||||
fun:_ZN10my_rocksdb12_GLOBAL__N_18Registry8RegisterEPFvRKNS_5SliceEPvENS_14CacheEntryRoleE
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Still reachable for once-per-process initializations
|
|
||||||
Memcheck:Leak
|
|
||||||
match-leak-kinds: reachable
|
|
||||||
...
|
|
||||||
fun:_ZN10my_rocksdb12_GLOBAL__N_111GetRegistryEv
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Still reachable for thread local storage initialization (SetHandle)
|
Still reachable for thread local storage initialization (SetHandle)
|
||||||
Memcheck:Leak
|
Memcheck:Leak
|
||||||
|
@@ -8596,7 +8596,7 @@ void Field_blob::store_length(uchar *i_ptr, uint i_packlength, uint32 i_number)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32 Field_blob::get_length(const uchar *pos, uint packlength_arg)
|
uint32 Field_blob::get_length(const uchar *pos, uint packlength_arg) const
|
||||||
{
|
{
|
||||||
return (uint32)read_lowendian(pos, packlength_arg);
|
return (uint32)read_lowendian(pos, packlength_arg);
|
||||||
}
|
}
|
||||||
|
@@ -4549,7 +4549,7 @@ public:
|
|||||||
}
|
}
|
||||||
inline uint32 get_length(my_ptrdiff_t row_offset= 0) const
|
inline uint32 get_length(my_ptrdiff_t row_offset= 0) const
|
||||||
{ return get_length(ptr+row_offset, this->packlength); }
|
{ return get_length(ptr+row_offset, this->packlength); }
|
||||||
static uint32 get_length(const uchar *ptr, uint packlength);
|
uint32 get_length(const uchar *ptr, uint packlength) const;
|
||||||
uint32 get_length(const uchar *ptr_arg) const
|
uint32 get_length(const uchar *ptr_arg) const
|
||||||
{ return get_length(ptr_arg, this->packlength); }
|
{ return get_length(ptr_arg, this->packlength); }
|
||||||
inline uchar *get_ptr() const { return get_ptr(ptr); }
|
inline uchar *get_ptr() const { return get_ptr(ptr); }
|
||||||
|
@@ -11648,10 +11648,10 @@ ER_RDB_TTL_UNSUPPORTED
|
|||||||
sw "Uauniaji wa TTL umezimwa kwa sasa wakati jedwali lina PK iliyofichwa."
|
sw "Uauniaji wa TTL umezimwa kwa sasa wakati jedwali lina PK iliyofichwa."
|
||||||
|
|
||||||
ER_RDB_TTL_COL_FORMAT
|
ER_RDB_TTL_COL_FORMAT
|
||||||
chi "Myrocks中的TTL列(%s)必须是一个无符号的非空64位整数或非空时间戳,存在于表内,并具有伴随的TTL持续时间。"
|
chi "Myrocks中的TTL列(%s)必须是一个无符号的非空64位整数,存在于表内,并具有伴随的TTL持续时间。"
|
||||||
eng "TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer or non-null timestamp, exist inside the table, and have an accompanying ttl duration."
|
eng "TTL column (%s) in MyRocks must be an unsigned non-null 64-bit integer, exist inside the table, and have an accompanying ttl duration."
|
||||||
spa "La columna TTL (%s) en MyRocks debe de ser un entero sin signo no-null de 64-bit o una marca de tiempo no-null, debe de existir dentro de la tabla y debe de tener una duración ttl acompañante."
|
spa "La columna TTL (%s) en MyRocks debe de ser un entero sin signo no-null de 64-bit, debe de existir dentro de la tabla y debe de tener una duración ttl acompañante."
|
||||||
sw "Safu wima ya TTL (%s) katika MyRocks lazima iwe nambari kamili ya biti 64 ambayo haijatiwa saini au muhuri wa muda usio batili, iwe ndani ya jedwali, na iwe na muda wa ttl unaoandamana."
|
sw "Safu wima ya TTL (%s) katika MyRocks lazima iwe nambari kamili ya biti 64 ambayo haijatiwa saini, iwe ndani ya jedwali, na iwe na muda wa ttl unaoandamana."
|
||||||
|
|
||||||
ER_PER_INDEX_CF_DEPRECATED
|
ER_PER_INDEX_CF_DEPRECATED
|
||||||
chi "已弃用每个索引列族选项"
|
chi "已弃用每个索引列族选项"
|
||||||
@@ -11670,7 +11670,6 @@ ER_SK_POPULATE_DURING_ALTER
|
|||||||
eng "MyRocks failed populating secondary key during alter."
|
eng "MyRocks failed populating secondary key during alter."
|
||||||
spa "MyRocks falló al poblar clave secundaria duante el 'alter'."
|
spa "MyRocks falló al poblar clave secundaria duante el 'alter'."
|
||||||
sw "MyRocks imeshindwa kujaza ufunguo wa sekondari wakati wa kubadilisha."
|
sw "MyRocks imeshindwa kujaza ufunguo wa sekondari wakati wa kubadilisha."
|
||||||
|
|
||||||
# MyRocks messages end
|
# MyRocks messages end
|
||||||
|
|
||||||
ER_SUM_FUNC_WITH_WINDOW_FUNC_AS_ARG
|
ER_SUM_FUNC_WITH_WINDOW_FUNC_AS_ARG
|
||||||
@@ -12271,9 +12270,3 @@ ER_JSON_INVALID_VALUE_FOR_KEYWORD
|
|||||||
ER_JSON_SCHEMA_KEYWORD_UNSUPPORTED
|
ER_JSON_SCHEMA_KEYWORD_UNSUPPORTED
|
||||||
eng "%s keyword is not supported"
|
eng "%s keyword is not supported"
|
||||||
sw "%s neno kuu halitumiki"
|
sw "%s neno kuu halitumiki"
|
||||||
ER_CF_DROPPED
|
|
||||||
chi "列族 ('%s') 正在被删除。"
|
|
||||||
eng "Column family ('%s') is being dropped."
|
|
||||||
ER_CANT_DROP_CF
|
|
||||||
chi "不能删除列族 ('%s'),因为它正在使用或不存在。"
|
|
||||||
eng "Cannot drop Column family ('%s') because it is in use or does not exist."
|
|
||||||
|
@@ -4,6 +4,8 @@ SET(CPACK_RPM_rocksdb-engine_PACKAGE_SUMMARY "RocksDB storage engine for MariaDB
|
|||||||
SET(CPACK_RPM_rocksdb-engine_PACKAGE_DESCRIPTION "The RocksDB storage engine is a high performance storage engine, aimed
|
SET(CPACK_RPM_rocksdb-engine_PACKAGE_DESCRIPTION "The RocksDB storage engine is a high performance storage engine, aimed
|
||||||
at maximising storage efficiency while maintaining InnoDB-like performance." PARENT_SCOPE)
|
at maximising storage efficiency while maintaining InnoDB-like performance." PARENT_SCOPE)
|
||||||
|
|
||||||
|
MY_CHECK_AND_SET_COMPILER_FLAG(-Wno-range-loop-construct)
|
||||||
|
|
||||||
MACRO(SKIP_ROCKSDB_PLUGIN msg)
|
MACRO(SKIP_ROCKSDB_PLUGIN msg)
|
||||||
MESSAGE_ONCE(SKIP_ROCKSDB_PLUGIN "Can't build rocksdb engine - ${msg}")
|
MESSAGE_ONCE(SKIP_ROCKSDB_PLUGIN "Can't build rocksdb engine - ${msg}")
|
||||||
ADD_FEATURE_INFO(ROCKSDB "OFF" "Storage Engine")
|
ADD_FEATURE_INFO(ROCKSDB "OFF" "Storage Engine")
|
||||||
@@ -56,29 +58,41 @@ IF(MSVC_ARM64)
|
|||||||
SKIP_ROCKSDB_PLUGIN("Windows ARM64 not supported")
|
SKIP_ROCKSDB_PLUGIN("Windows ARM64 not supported")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# This plugin needs recent C++ compilers (it is using C++17 features)
|
#
|
||||||
|
# Also, disable on ARM64 when not Linux
|
||||||
|
# Requires submodule update to v6.16.3
|
||||||
|
# containing commit https://github.com/facebook/rocksdb/commit/ee4bd4780b321ddb5f92a0f4eb956f2a2ebd60dc
|
||||||
|
#
|
||||||
|
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64|aarch64)" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
SKIP_ROCKSDB_PLUGIN("ARM64 disabled on all except Linux")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# This plugin needs recent C++ compilers (it is using C++11 features)
|
||||||
# Skip build for the old compilers
|
# Skip build for the old compilers
|
||||||
SET(CXX17_FLAGS)
|
SET(CXX11_FLAGS)
|
||||||
SET(OLD_COMPILER_MSG "requires c++17 -capable compiler (minimal supported versions are g++ 7, clang 5, VS2017)")
|
SET(OLD_COMPILER_MSG "requires c++11 -capable compiler (minimal supported versions are g++ 4.8, clang 3.3, VS2015)")
|
||||||
|
|
||||||
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
||||||
IF (GCC_VERSION VERSION_LESS 7)
|
IF (GCC_VERSION VERSION_LESS 4.8)
|
||||||
SKIP_ROCKSDB_PLUGIN("${OLD_COMPILER_MSG}")
|
SKIP_ROCKSDB_PLUGIN("${OLD_COMPILER_MSG}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SET(CXX17_FLAGS "-std=c++17")
|
SET(CXX11_FLAGS "-std=c++11")
|
||||||
|
IF (GCC_VERSION VERSION_LESS 5.0)
|
||||||
|
SET(CXX11_FLAGS "-std=c++11 -Wno-missing-field-initializers")
|
||||||
|
ENDIF()
|
||||||
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
IF ((CMAKE_CXX_COMPILER_VERSION AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5) OR
|
IF ((CMAKE_CXX_COMPILER_VERSION AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3) OR
|
||||||
(CLANG_VERSION_STRING AND CLANG_VERSION_STRING VERSION_LESS 5))
|
(CLANG_VERSION_STRING AND CLANG_VERSION_STRING VERSION_LESS 3.3))
|
||||||
SKIP_ROCKSDB_PLUGIN("${OLD_COMPILER_MSG}")
|
SKIP_ROCKSDB_PLUGIN("${OLD_COMPILER_MSG}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SET(CXX17_FLAGS "-std=c++17 -stdlib=libstdc++")
|
SET(CXX11_FLAGS "-std=c++11 -stdlib=libstdc++")
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
# clang-cl does not work yet
|
# clang-cl does not work yet
|
||||||
SKIP_ROCKSDB_PLUGIN("Clang-cl is not supported")
|
SKIP_ROCKSDB_PLUGIN("Clang-cl is not supported")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSEIF(MSVC)
|
ELSEIF(MSVC)
|
||||||
IF (MSVC_VERSION LESS 1914)
|
IF (MSVC_VERSION LESS 1900)
|
||||||
SKIP_ROCKSDB_PLUGIN("${OLD_COMPILER_MSG}")
|
SKIP_ROCKSDB_PLUGIN("${OLD_COMPILER_MSG}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -86,9 +100,9 @@ ELSE()
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(CMAKE_VERSION GREATER 3.0)
|
IF(CMAKE_VERSION GREATER 3.0)
|
||||||
SET(CMAKE_CXX_STANDARD 17)
|
SET(CMAKE_CXX_STANDARD 11)
|
||||||
ELSEIF(CXX17_FLAGS)
|
ELSEIF(CXX11_FLAGS)
|
||||||
ADD_DEFINITIONS(${CXX17_FLAGS})
|
ADD_DEFINITIONS(${CXX11_FLAGS})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(ROCKSDB_SE_SOURCES
|
SET(ROCKSDB_SE_SOURCES
|
||||||
@@ -121,6 +135,11 @@ SET(ROCKSDB_SE_SOURCES
|
|||||||
rdb_converter.h
|
rdb_converter.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# MariaDB: the following is added in build_rocksdb.cmake, when appropriate:
|
||||||
|
# This is a strong requirement coming from RocksDB. No conditional checks here.
|
||||||
|
#ADD_DEFINITIONS(-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX
|
||||||
|
#)
|
||||||
|
|
||||||
if (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC)
|
if (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC)
|
||||||
SET(ATOMIC_EXTRA_LIBS -latomic)
|
SET(ATOMIC_EXTRA_LIBS -latomic)
|
||||||
else()
|
else()
|
||||||
@@ -141,7 +160,7 @@ IF(NOT TARGET rocksdb)
|
|||||||
RETURN()
|
RETURN()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
INSTALL_MANPAGES(rocksdb-engine mariadb-ldb.1 mariadb-sst-dump.1 myrocks_hotbackup.1)
|
INSTALL_MANPAGES(rocksdb-engine mariadb-ldb.1 myrocks_hotbackup.1)
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
#if defined(_MSC_VER) && !defined(__thread)
|
#if defined(_MSC_VER) && !defined(__thread)
|
||||||
@@ -174,6 +193,7 @@ ADD_CONVENIENCE_LIBRARY(rocksdb_aux_lib
|
|||||||
rdb_perf_context.h
|
rdb_perf_context.h
|
||||||
rdb_buff.h
|
rdb_buff.h
|
||||||
rdb_mariadb_port.h
|
rdb_mariadb_port.h
|
||||||
|
nosql_access.cc nosql_access.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_DEPENDENCIES(rocksdb_aux_lib GenError)
|
ADD_DEPENDENCIES(rocksdb_aux_lib GenError)
|
||||||
@@ -184,8 +204,37 @@ if (UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
|||||||
TARGET_LINK_LIBRARIES(rocksdb_aux_lib -lrt)
|
TARGET_LINK_LIBRARIES(rocksdb_aux_lib -lrt)
|
||||||
endif()
|
endif()
|
||||||
TARGET_LINK_LIBRARIES(rocksdb_aux_lib ${ATOMIC_EXTRA_LIBS})
|
TARGET_LINK_LIBRARIES(rocksdb_aux_lib ${ATOMIC_EXTRA_LIBS})
|
||||||
|
|
||||||
|
# IF (WITH_JEMALLOC)
|
||||||
|
# FIND_LIBRARY(JEMALLOC_LIBRARY
|
||||||
|
# NAMES libjemalloc${PIC_EXT}.a jemalloc
|
||||||
|
# HINTS ${WITH_JEMALLOC}/lib)
|
||||||
|
# SET(rocksdb_static_libs ${rocksdb_static_libs}
|
||||||
|
# ${JEMALLOC_LIBRARY})
|
||||||
|
# ADD_DEFINITIONS(-DROCKSDB_JEMALLOC)
|
||||||
|
# ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
|
||||||
|
# ENDIF()
|
||||||
|
|
||||||
|
# MariaDB: Q: why does the upstream add libunwind for a particular
|
||||||
|
# storage engine?
|
||||||
|
#IF (WITH_UNWIND)
|
||||||
|
# FIND_LIBRARY(UNWIND_LIBRARY
|
||||||
|
# NAMES libunwind${PIC_EXT}.a unwind
|
||||||
|
# HINTS ${WITH_UNWIND}/lib)
|
||||||
|
# SET(rocksdb_static_libs ${rocksdb_static_libs}
|
||||||
|
# ${UNWIND_LIBRARY})
|
||||||
|
#ENDIF()
|
||||||
|
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(rocksdb rocksdb_aux_lib)
|
TARGET_LINK_LIBRARIES(rocksdb rocksdb_aux_lib)
|
||||||
|
|
||||||
|
CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU)
|
||||||
|
IF(HAVE_SCHED_GETCPU)
|
||||||
|
ADD_DEFINITIONS(-DHAVE_SCHED_GETCPU=1)
|
||||||
|
# MariaDB: don't do this:
|
||||||
|
# ADD_DEFINITIONS(-DZSTD_STATIC_LINKING_ONLY)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF (WITH_TBB)
|
IF (WITH_TBB)
|
||||||
FIND_LIBRARY(TBB_LIBRARY
|
FIND_LIBRARY(TBB_LIBRARY
|
||||||
NAMES libtbb${PIC_EXT}.a tbb
|
NAMES libtbb${PIC_EXT}.a tbb
|
||||||
@@ -195,6 +244,13 @@ IF (WITH_TBB)
|
|||||||
ADD_DEFINITIONS(-DTBB)
|
ADD_DEFINITIONS(-DTBB)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
#
|
||||||
|
# MariaDB: Dynamic plugin build is not suitable with unittest ATM
|
||||||
|
#
|
||||||
|
#IF(WITH_UNIT_TESTS AND WITH_EMBEDDED_SERVER)
|
||||||
|
# ADD_SUBDIRECTORY(unittest)
|
||||||
|
#ENDIF()
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
if (UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||||
SET(rocksdb_static_libs ${rocksdb_static_libs} "-lrt")
|
SET(rocksdb_static_libs ${rocksdb_static_libs} "-lrt")
|
||||||
endif()
|
endif()
|
||||||
@@ -206,8 +262,8 @@ ADD_LIBRARY(rocksdb_tools STATIC
|
|||||||
rocksdb/tools/sst_dump_tool.cc
|
rocksdb/tools/sst_dump_tool.cc
|
||||||
)
|
)
|
||||||
|
|
||||||
MYSQL_ADD_EXECUTABLE(mariadb-sst-dump tools/mysql_sst_dump.cc COMPONENT rocksdb-engine)
|
MYSQL_ADD_EXECUTABLE(sst_dump rocksdb/tools/sst_dump.cc COMPONENT rocksdb-engine)
|
||||||
TARGET_LINK_LIBRARIES(mariadb-sst-dump rocksdblib)
|
TARGET_LINK_LIBRARIES(sst_dump rocksdblib)
|
||||||
|
|
||||||
MYSQL_ADD_EXECUTABLE(mariadb-ldb tools/mysql_ldb.cc COMPONENT rocksdb-engine)
|
MYSQL_ADD_EXECUTABLE(mariadb-ldb tools/mysql_ldb.cc COMPONENT rocksdb-engine)
|
||||||
TARGET_LINK_LIBRARIES(mariadb-ldb rocksdb_tools rocksdb_aux_lib dbug)
|
TARGET_LINK_LIBRARIES(mariadb-ldb rocksdb_tools rocksdb_aux_lib dbug)
|
||||||
@@ -229,7 +285,7 @@ IF(MSVC)
|
|||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
SET_TARGET_PROPERTIES(rocksdb_tools mariadb-sst-dump mariadb-ldb PROPERTIES COMPILE_FLAGS "-Wno-error")
|
SET_TARGET_PROPERTIES(rocksdb_tools sst_dump mariadb-ldb PROPERTIES COMPILE_FLAGS "-Wno-error")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(GIT_EXECUTABLE AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/.git)
|
IF(GIT_EXECUTABLE AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/.git)
|
||||||
|
@@ -9,6 +9,7 @@ INCLUDE_DIRECTORIES(
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
${ROCKSDB_SOURCE_DIR}
|
${ROCKSDB_SOURCE_DIR}
|
||||||
${ROCKSDB_SOURCE_DIR}/include
|
${ROCKSDB_SOURCE_DIR}/include
|
||||||
|
${ROCKSDB_SOURCE_DIR}/third-party/gtest-1.7.0/fused-src
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${ROCKSDB_SOURCE_DIR}/cmake/modules/")
|
list(APPEND CMAKE_MODULE_PATH "${ROCKSDB_SOURCE_DIR}/cmake/modules/")
|
||||||
@@ -89,8 +90,6 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|||||||
add_definitions(-DOS_LINUX)
|
add_definitions(-DOS_LINUX)
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
||||||
add_definitions(-DOS_SOLARIS)
|
add_definitions(-DOS_SOLARIS)
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD")
|
|
||||||
add_definitions(-DOS_GNU_KFREEBSD)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||||
add_definitions(-DOS_FREEBSD)
|
add_definitions(-DOS_FREEBSD)
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
||||||
@@ -102,7 +101,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly")
|
|||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
|
||||||
add_definitions(-DOS_ANDROID)
|
add_definitions(-DOS_ANDROID)
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
add_definitions(-DWIN32 -DOS_WIN -D_MBCS -DWIN64 -DNOMINMAX)
|
add_definitions(-DOS_WIN)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
@@ -114,7 +113,7 @@ endif()
|
|||||||
|
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
# ppc64 or ppc64le or powerpc64 (BSD)
|
# ppc64 or ppc64le or powerpc64 (BSD)
|
||||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64|powerpc64")
|
||||||
CHECK_C_COMPILER_FLAG("-maltivec" HAS_ALTIVEC)
|
CHECK_C_COMPILER_FLAG("-maltivec" HAS_ALTIVEC)
|
||||||
if(HAS_ALTIVEC)
|
if(HAS_ALTIVEC)
|
||||||
message(STATUS " HAS_ALTIVEC yes")
|
message(STATUS " HAS_ALTIVEC yes")
|
||||||
@@ -128,7 +127,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
|
|||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=power8")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=power8")
|
||||||
endif()
|
endif()
|
||||||
ADD_DEFINITIONS(-DHAVE_POWER8 -DHAS_ALTIVEC)
|
ADD_DEFINITIONS(-DHAVE_POWER8 -DHAS_ALTIVEC)
|
||||||
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
|
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64|powerpc64")
|
||||||
|
|
||||||
option(WITH_FALLOCATE "build with fallocate" ON)
|
option(WITH_FALLOCATE "build with fallocate" ON)
|
||||||
|
|
||||||
@@ -147,35 +146,14 @@ int main() {
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
|
||||||
#include <pthread.h>
|
|
||||||
int main() {
|
|
||||||
(void) PTHREAD_MUTEX_ADAPTIVE_NP;
|
|
||||||
}
|
|
||||||
" HAVE_PTHREAD_MUTEX_ADAPTIVE_NP)
|
|
||||||
if(HAVE_PTHREAD_MUTEX_ADAPTIVE_NP)
|
|
||||||
add_definitions(-DROCKSDB_PTHREAD_ADAPTIVE_MUTEX)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
CHECK_SYMBOL_EXISTS(SYNC_FILE_RANGE_WRITE "fcntl.h" HAVE_SYNC_FILE_RANGE_WRITE)
|
|
||||||
if(HAVE_SYNC_FILE_RANGE_WRITE)
|
|
||||||
add_definitions(-DROCKSDB_RANGESYNC_PRESENT)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
CHECK_FUNCTION_EXISTS(malloc_usable_size HAVE_MALLOC_USABLE_SIZE)
|
CHECK_FUNCTION_EXISTS(malloc_usable_size HAVE_MALLOC_USABLE_SIZE)
|
||||||
if(HAVE_MALLOC_USABLE_SIZE)
|
if(HAVE_MALLOC_USABLE_SIZE)
|
||||||
add_definitions(-DROCKSDB_MALLOC_USABLE_SIZE)
|
add_definitions(-DROCKSDB_MALLOC_USABLE_SIZE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
CHECK_FUNCTION_EXISTS(getauxval HAVE_AUXV_GETAUXVAL)
|
include_directories(${ROCKSDB_SOURCE_DIR})
|
||||||
if(HAVE_AUXV_GETAUXVAL)
|
include_directories(${ROCKSDB_SOURCE_DIR}/include)
|
||||||
add_definitions(-DROCKSDB_AUXV_GETAUXVAL_PRESENT)
|
include_directories(SYSTEM ${ROCKSDB_SOURCE_DIR}/third-party/gtest-1.7.0/fused-src)
|
||||||
endif()
|
|
||||||
|
|
||||||
CHECK_FUNCTION_EXISTS(F_FULLFSYNC HAVE_FULLFSYNC)
|
|
||||||
if(HAVE_FULLFSYNC)
|
|
||||||
add_definitions(-DHAVE_FULLFSYNC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
@@ -184,9 +162,11 @@ else()
|
|||||||
set(SYSTEM_LIBS ${SYSTEM_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${CMAKE_DL_LIBS} ${ATOMIC_EXTRA_LIBS})
|
set(SYSTEM_LIBS ${SYSTEM_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${CMAKE_DL_LIBS} ${ATOMIC_EXTRA_LIBS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(ROCKSDB_LIBS rocksdblib)
|
set(ROCKSDB_LIBS rocksdblib})
|
||||||
set(LIBS ${ROCKSDB_LIBS} ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
|
set(LIBS ${ROCKSDB_LIBS} ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
|
||||||
|
|
||||||
|
#add_subdirectory(${ROCKSDB_SOURCE_DIR}/tools)
|
||||||
|
|
||||||
# Main library source code
|
# Main library source code
|
||||||
# Note : RocksDB has a lot of unittests. We should not include these files
|
# Note : RocksDB has a lot of unittests. We should not include these files
|
||||||
# in the build, because 1. they are not needed and 2. gtest causes warnings
|
# in the build, because 1. they are not needed and 2. gtest causes warnings
|
||||||
@@ -196,36 +176,14 @@ set(LIBS ${ROCKSDB_LIBS} ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
|
|||||||
# - *_test.cc
|
# - *_test.cc
|
||||||
# - *_bench.cc
|
# - *_bench.cc
|
||||||
set(ROCKSDB_SOURCES
|
set(ROCKSDB_SOURCES
|
||||||
cache/cache.cc
|
|
||||||
cache/cache_entry_roles.cc
|
|
||||||
cache/cache_key.cc
|
|
||||||
cache/cache_helpers.cc
|
|
||||||
cache/cache_reservation_manager.cc
|
|
||||||
cache/charged_cache.cc
|
|
||||||
cache/clock_cache.cc
|
cache/clock_cache.cc
|
||||||
cache/compressed_secondary_cache.cc
|
|
||||||
cache/lru_cache.cc
|
cache/lru_cache.cc
|
||||||
cache/secondary_cache.cc
|
|
||||||
cache/secondary_cache_adapter.cc
|
|
||||||
cache/sharded_cache.cc
|
cache/sharded_cache.cc
|
||||||
db/arena_wrapped_db_iter.cc
|
db/arena_wrapped_db_iter.cc
|
||||||
db/blob/blob_contents.cc
|
|
||||||
db/blob/blob_fetcher.cc
|
|
||||||
db/blob/blob_file_addition.cc
|
|
||||||
db/blob/blob_file_builder.cc
|
|
||||||
db/blob/blob_file_cache.cc
|
|
||||||
db/blob/blob_file_garbage.cc
|
|
||||||
db/blob/blob_file_meta.cc
|
|
||||||
db/blob/blob_file_reader.cc
|
|
||||||
db/blob/blob_garbage_meter.cc
|
|
||||||
db/blob/blob_log_format.cc
|
|
||||||
db/blob/blob_log_sequential_reader.cc
|
|
||||||
db/blob/blob_log_writer.cc
|
|
||||||
db/blob/blob_source.cc
|
|
||||||
db/blob/prefetch_buffer_collection.cc
|
|
||||||
db/builder.cc
|
db/builder.cc
|
||||||
db/c.cc
|
db/c.cc
|
||||||
db/column_family.cc
|
db/column_family.cc
|
||||||
|
db/compacted_db_impl.cc
|
||||||
db/compaction/compaction.cc
|
db/compaction/compaction.cc
|
||||||
db/compaction/compaction_iterator.cc
|
db/compaction/compaction_iterator.cc
|
||||||
db/compaction/compaction_picker.cc
|
db/compaction/compaction_picker.cc
|
||||||
@@ -233,14 +191,8 @@ set(ROCKSDB_SOURCES
|
|||||||
db/compaction/compaction_picker_fifo.cc
|
db/compaction/compaction_picker_fifo.cc
|
||||||
db/compaction/compaction_picker_level.cc
|
db/compaction/compaction_picker_level.cc
|
||||||
db/compaction/compaction_picker_universal.cc
|
db/compaction/compaction_picker_universal.cc
|
||||||
db/compaction/compaction_service_job.cc
|
|
||||||
db/compaction/compaction_state.cc
|
|
||||||
db/compaction/compaction_outputs.cc
|
|
||||||
db/compaction/sst_partitioner.cc
|
|
||||||
db/compaction/subcompaction_state.cc
|
|
||||||
db/convenience.cc
|
db/convenience.cc
|
||||||
db/db_filesnapshot.cc
|
db/db_filesnapshot.cc
|
||||||
db/db_impl/compacted_db_impl.cc
|
|
||||||
db/db_impl/db_impl.cc
|
db/db_impl/db_impl.cc
|
||||||
db/db_impl/db_impl_write.cc
|
db/db_impl/db_impl_write.cc
|
||||||
db/db_impl/db_impl_compaction_flush.cc
|
db/db_impl/db_impl_compaction_flush.cc
|
||||||
@@ -271,12 +223,9 @@ set(ROCKSDB_SOURCES
|
|||||||
db/memtable_list.cc
|
db/memtable_list.cc
|
||||||
db/merge_helper.cc
|
db/merge_helper.cc
|
||||||
db/merge_operator.cc
|
db/merge_operator.cc
|
||||||
db/output_validator.cc
|
|
||||||
db/periodic_task_scheduler.cc
|
|
||||||
db/range_del_aggregator.cc
|
db/range_del_aggregator.cc
|
||||||
db/range_tombstone_fragmenter.cc
|
db/range_tombstone_fragmenter.cc
|
||||||
db/repair.cc
|
db/repair.cc
|
||||||
db/seqno_to_time_mapping.cc
|
|
||||||
db/snapshot_impl.cc
|
db/snapshot_impl.cc
|
||||||
db/table_cache.cc
|
db/table_cache.cc
|
||||||
db/table_properties_collector.cc
|
db/table_properties_collector.cc
|
||||||
@@ -284,31 +233,22 @@ set(ROCKSDB_SOURCES
|
|||||||
db/trim_history_scheduler.cc
|
db/trim_history_scheduler.cc
|
||||||
db/version_builder.cc
|
db/version_builder.cc
|
||||||
db/version_edit.cc
|
db/version_edit.cc
|
||||||
db/version_edit_handler.cc
|
|
||||||
db/version_set.cc
|
db/version_set.cc
|
||||||
db/wal_edit.cc
|
|
||||||
db/wal_manager.cc
|
db/wal_manager.cc
|
||||||
db/wide/wide_column_serialization.cc
|
|
||||||
db/wide/wide_columns.cc
|
|
||||||
db/write_batch.cc
|
db/write_batch.cc
|
||||||
db/write_batch_base.cc
|
db/write_batch_base.cc
|
||||||
db/write_controller.cc
|
db/write_controller.cc
|
||||||
db/write_stall_stats.cc
|
|
||||||
db/write_thread.cc
|
db/write_thread.cc
|
||||||
env/composite_env.cc
|
|
||||||
env/env.cc
|
env/env.cc
|
||||||
env/env_chroot.cc
|
env/env_chroot.cc
|
||||||
env/env_encryption.cc
|
env/env_encryption.cc
|
||||||
|
env/env_hdfs.cc
|
||||||
env/file_system.cc
|
env/file_system.cc
|
||||||
env/file_system_tracer.cc
|
|
||||||
env/fs_remap.cc
|
|
||||||
env/mock_env.cc
|
env/mock_env.cc
|
||||||
env/unique_id_gen.cc
|
|
||||||
file/delete_scheduler.cc
|
file/delete_scheduler.cc
|
||||||
file/file_prefetch_buffer.cc
|
file/file_prefetch_buffer.cc
|
||||||
file/file_util.cc
|
file/file_util.cc
|
||||||
file/filename.cc
|
file/filename.cc
|
||||||
file/line_file_reader.cc
|
|
||||||
file/random_access_file_reader.cc
|
file/random_access_file_reader.cc
|
||||||
file/read_write_util.cc
|
file/read_write_util.cc
|
||||||
file/readahead_raf.cc
|
file/readahead_raf.cc
|
||||||
@@ -321,8 +261,6 @@ set(ROCKSDB_SOURCES
|
|||||||
memory/arena.cc
|
memory/arena.cc
|
||||||
memory/concurrent_arena.cc
|
memory/concurrent_arena.cc
|
||||||
memory/jemalloc_nodump_allocator.cc
|
memory/jemalloc_nodump_allocator.cc
|
||||||
memory/memkind_kmem_allocator.cc
|
|
||||||
memory/memory_allocator.cc
|
|
||||||
memtable/alloc_tracker.cc
|
memtable/alloc_tracker.cc
|
||||||
memtable/hash_linklist_rep.cc
|
memtable/hash_linklist_rep.cc
|
||||||
memtable/hash_skiplist_rep.cc
|
memtable/hash_skiplist_rep.cc
|
||||||
@@ -343,24 +281,19 @@ set(ROCKSDB_SOURCES
|
|||||||
monitoring/thread_status_util.cc
|
monitoring/thread_status_util.cc
|
||||||
monitoring/thread_status_util_debug.cc
|
monitoring/thread_status_util_debug.cc
|
||||||
options/cf_options.cc
|
options/cf_options.cc
|
||||||
options/configurable.cc
|
|
||||||
options/customizable.cc
|
|
||||||
options/db_options.cc
|
options/db_options.cc
|
||||||
options/options.cc
|
options/options.cc
|
||||||
options/options_helper.cc
|
options/options_helper.cc
|
||||||
options/options_parser.cc
|
options/options_parser.cc
|
||||||
port/mmap.cc
|
options/options_sanity_check.cc
|
||||||
port/stack_trace.cc
|
port/stack_trace.cc
|
||||||
table/adaptive/adaptive_table_factory.cc
|
table/adaptive/adaptive_table_factory.cc
|
||||||
table/block_based/binary_search_index_reader.cc
|
|
||||||
table/block_based/block.cc
|
table/block_based/block.cc
|
||||||
|
table/block_based/block_based_filter_block.cc
|
||||||
table/block_based/block_based_table_builder.cc
|
table/block_based/block_based_table_builder.cc
|
||||||
table/block_based/block_based_table_factory.cc
|
table/block_based/block_based_table_factory.cc
|
||||||
table/block_based/block_based_table_iterator.cc
|
|
||||||
table/block_based/block_based_table_reader.cc
|
table/block_based/block_based_table_reader.cc
|
||||||
table/block_based/block_builder.cc
|
table/block_based/block_builder.cc
|
||||||
table/block_based/block_cache.cc
|
|
||||||
table/block_based/block_prefetcher.cc
|
|
||||||
table/block_based/block_prefix_index.cc
|
table/block_based/block_prefix_index.cc
|
||||||
table/block_based/data_block_hash_index.cc
|
table/block_based/data_block_hash_index.cc
|
||||||
table/block_based/data_block_footer.cc
|
table/block_based/data_block_footer.cc
|
||||||
@@ -368,14 +301,9 @@ set(ROCKSDB_SOURCES
|
|||||||
table/block_based/filter_policy.cc
|
table/block_based/filter_policy.cc
|
||||||
table/block_based/flush_block_policy.cc
|
table/block_based/flush_block_policy.cc
|
||||||
table/block_based/full_filter_block.cc
|
table/block_based/full_filter_block.cc
|
||||||
table/block_based/hash_index_reader.cc
|
|
||||||
table/block_based/index_builder.cc
|
table/block_based/index_builder.cc
|
||||||
table/block_based/index_reader_common.cc
|
|
||||||
table/block_based/parsed_full_filter_block.cc
|
table/block_based/parsed_full_filter_block.cc
|
||||||
table/block_based/partitioned_filter_block.cc
|
table/block_based/partitioned_filter_block.cc
|
||||||
table/block_based/partitioned_index_iterator.cc
|
|
||||||
table/block_based/partitioned_index_reader.cc
|
|
||||||
table/block_based/reader_common.cc
|
|
||||||
table/block_based/uncompression_dict_reader.cc
|
table/block_based/uncompression_dict_reader.cc
|
||||||
table/block_fetcher.cc
|
table/block_fetcher.cc
|
||||||
table/cuckoo/cuckoo_table_builder.cc
|
table/cuckoo/cuckoo_table_builder.cc
|
||||||
@@ -385,7 +313,6 @@ set(ROCKSDB_SOURCES
|
|||||||
table/get_context.cc
|
table/get_context.cc
|
||||||
table/iterator.cc
|
table/iterator.cc
|
||||||
table/merging_iterator.cc
|
table/merging_iterator.cc
|
||||||
table/compaction_merging_iterator.cc
|
|
||||||
table/meta_blocks.cc
|
table/meta_blocks.cc
|
||||||
table/persistent_cache_helper.cc
|
table/persistent_cache_helper.cc
|
||||||
table/plain/plain_table_bloom.cc
|
table/plain/plain_table_bloom.cc
|
||||||
@@ -394,80 +321,57 @@ set(ROCKSDB_SOURCES
|
|||||||
table/plain/plain_table_index.cc
|
table/plain/plain_table_index.cc
|
||||||
table/plain/plain_table_key_coding.cc
|
table/plain/plain_table_key_coding.cc
|
||||||
table/plain/plain_table_reader.cc
|
table/plain/plain_table_reader.cc
|
||||||
table/sst_file_dumper.cc
|
|
||||||
table/sst_file_reader.cc
|
table/sst_file_reader.cc
|
||||||
table/sst_file_writer.cc
|
table/sst_file_writer.cc
|
||||||
table/table_factory.cc
|
|
||||||
table/table_properties.cc
|
table/table_properties.cc
|
||||||
table/two_level_iterator.cc
|
table/two_level_iterator.cc
|
||||||
table/unique_id.cc
|
|
||||||
test_util/sync_point.cc
|
test_util/sync_point.cc
|
||||||
test_util/sync_point_impl.cc
|
test_util/sync_point_impl.cc
|
||||||
test_util/testutil.cc
|
test_util/testutil.cc
|
||||||
test_util/transaction_test_util.cc
|
test_util/transaction_test_util.cc
|
||||||
tools/block_cache_analyzer/block_cache_trace_analyzer.cc
|
tools/block_cache_analyzer/block_cache_trace_analyzer.cc
|
||||||
tools/dump/db_dump_tool.cc
|
tools/dump/db_dump_tool.cc
|
||||||
tools/io_tracer_parser_tool.cc
|
|
||||||
tools/ldb_cmd.cc
|
tools/ldb_cmd.cc
|
||||||
tools/ldb_tool.cc
|
tools/ldb_tool.cc
|
||||||
tools/sst_dump_tool.cc
|
tools/sst_dump_tool.cc
|
||||||
tools/trace_analyzer_tool.cc
|
tools/trace_analyzer_tool.cc
|
||||||
trace_replay/block_cache_tracer.cc
|
|
||||||
trace_replay/io_tracer.cc
|
|
||||||
trace_replay/trace_record_handler.cc
|
|
||||||
trace_replay/trace_record_result.cc
|
|
||||||
trace_replay/trace_record.cc
|
|
||||||
trace_replay/trace_replay.cc
|
trace_replay/trace_replay.cc
|
||||||
util/async_file_reader.cc
|
trace_replay/block_cache_tracer.cc
|
||||||
util/cleanable.cc
|
|
||||||
util/coding.cc
|
util/coding.cc
|
||||||
util/compaction_job_stats_impl.cc
|
util/compaction_job_stats_impl.cc
|
||||||
util/comparator.cc
|
util/comparator.cc
|
||||||
util/compression.cc
|
|
||||||
util/compression_context_cache.cc
|
util/compression_context_cache.cc
|
||||||
util/concurrent_task_limiter_impl.cc
|
util/concurrent_task_limiter_impl.cc
|
||||||
util/crc32c.cc
|
util/crc32c.cc
|
||||||
util/data_structure.cc
|
|
||||||
util/dynamic_bloom.cc
|
util/dynamic_bloom.cc
|
||||||
util/hash.cc
|
util/hash.cc
|
||||||
util/murmurhash.cc
|
util/murmurhash.cc
|
||||||
util/random.cc
|
util/random.cc
|
||||||
util/rate_limiter.cc
|
util/rate_limiter.cc
|
||||||
util/ribbon_config.cc
|
|
||||||
util/slice.cc
|
util/slice.cc
|
||||||
util/file_checksum_helper.cc
|
util/file_checksum_helper.cc
|
||||||
util/status.cc
|
util/status.cc
|
||||||
util/stderr_logger.cc
|
|
||||||
util/string_util.cc
|
util/string_util.cc
|
||||||
util/thread_local.cc
|
util/thread_local.cc
|
||||||
util/threadpool_imp.cc
|
util/threadpool_imp.cc
|
||||||
util/xxhash.cc
|
util/xxhash.cc
|
||||||
utilities/agg_merge/agg_merge.cc
|
utilities/backupable/backupable_db.cc
|
||||||
utilities/backup/backup_engine.cc
|
|
||||||
utilities/blob_db/blob_compaction_filter.cc
|
utilities/blob_db/blob_compaction_filter.cc
|
||||||
utilities/blob_db/blob_db.cc
|
utilities/blob_db/blob_db.cc
|
||||||
utilities/blob_db/blob_db_impl.cc
|
utilities/blob_db/blob_db_impl.cc
|
||||||
utilities/blob_db/blob_db_impl_filesnapshot.cc
|
utilities/blob_db/blob_db_impl_filesnapshot.cc
|
||||||
utilities/blob_db/blob_dump_tool.cc
|
utilities/blob_db/blob_dump_tool.cc
|
||||||
utilities/blob_db/blob_file.cc
|
utilities/blob_db/blob_file.cc
|
||||||
utilities/cache_dump_load.cc
|
utilities/blob_db/blob_log_reader.cc
|
||||||
utilities/cache_dump_load_impl.cc
|
utilities/blob_db/blob_log_writer.cc
|
||||||
utilities/cassandra/cassandra_compaction_filter.cc
|
utilities/blob_db/blob_log_format.cc
|
||||||
utilities/cassandra/format.cc
|
|
||||||
utilities/cassandra/merge_operator.cc
|
|
||||||
utilities/checkpoint/checkpoint_impl.cc
|
utilities/checkpoint/checkpoint_impl.cc
|
||||||
utilities/compaction_filters.cc
|
|
||||||
utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc
|
utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc
|
||||||
utilities/counted_fs.cc
|
|
||||||
utilities/debug.cc
|
utilities/debug.cc
|
||||||
utilities/env_mirror.cc
|
utilities/env_mirror.cc
|
||||||
utilities/env_timed.cc
|
utilities/env_timed.cc
|
||||||
utilities/fault_injection_env.cc
|
|
||||||
utilities/fault_injection_fs.cc
|
|
||||||
utilities/fault_injection_secondary_cache.cc
|
|
||||||
utilities/leveldb_options/leveldb_options.cc
|
utilities/leveldb_options/leveldb_options.cc
|
||||||
utilities/memory/memory_util.cc
|
utilities/memory/memory_util.cc
|
||||||
utilities/merge_operators.cc
|
|
||||||
utilities/merge_operators/bytesxor.cc
|
utilities/merge_operators/bytesxor.cc
|
||||||
utilities/merge_operators/max.cc
|
utilities/merge_operators/max.cc
|
||||||
utilities/merge_operators/put.cc
|
utilities/merge_operators/put.cc
|
||||||
@@ -487,12 +391,6 @@ set(ROCKSDB_SOURCES
|
|||||||
utilities/simulator_cache/sim_cache.cc
|
utilities/simulator_cache/sim_cache.cc
|
||||||
utilities/table_properties_collectors/compact_on_deletion_collector.cc
|
utilities/table_properties_collectors/compact_on_deletion_collector.cc
|
||||||
utilities/trace/file_trace_reader_writer.cc
|
utilities/trace/file_trace_reader_writer.cc
|
||||||
utilities/trace/replayer_impl.cc
|
|
||||||
utilities/transactions/lock/lock_manager.cc
|
|
||||||
utilities/transactions/lock/point/point_lock_tracker.cc
|
|
||||||
utilities/transactions/lock/point/point_lock_manager.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/range_tree_lock_manager.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.cc
|
|
||||||
utilities/transactions/optimistic_transaction_db_impl.cc
|
utilities/transactions/optimistic_transaction_db_impl.cc
|
||||||
utilities/transactions/optimistic_transaction.cc
|
utilities/transactions/optimistic_transaction.cc
|
||||||
utilities/transactions/pessimistic_transaction.cc
|
utilities/transactions/pessimistic_transaction.cc
|
||||||
@@ -500,27 +398,15 @@ set(ROCKSDB_SOURCES
|
|||||||
utilities/transactions/snapshot_checker.cc
|
utilities/transactions/snapshot_checker.cc
|
||||||
utilities/transactions/transaction_base.cc
|
utilities/transactions/transaction_base.cc
|
||||||
utilities/transactions/transaction_db_mutex_impl.cc
|
utilities/transactions/transaction_db_mutex_impl.cc
|
||||||
|
utilities/transactions/transaction_lock_mgr.cc
|
||||||
utilities/transactions/transaction_util.cc
|
utilities/transactions/transaction_util.cc
|
||||||
utilities/transactions/write_prepared_txn.cc
|
utilities/transactions/write_prepared_txn.cc
|
||||||
utilities/transactions/write_prepared_txn_db.cc
|
utilities/transactions/write_prepared_txn_db.cc
|
||||||
utilities/transactions/write_unprepared_txn.cc
|
utilities/transactions/write_unprepared_txn.cc
|
||||||
utilities/transactions/write_unprepared_txn_db.cc
|
utilities/transactions/write_unprepared_txn_db.cc
|
||||||
utilities/ttl/db_ttl_impl.cc
|
utilities/ttl/db_ttl_impl.cc
|
||||||
utilities/wal_filter.cc
|
|
||||||
utilities/write_batch_with_index/write_batch_with_index.cc
|
utilities/write_batch_with_index/write_batch_with_index.cc
|
||||||
utilities/write_batch_with_index/write_batch_with_index_internal.cc
|
utilities/write_batch_with_index/write_batch_with_index_internal.cc
|
||||||
utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/lib/locktree/locktree.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/lib/locktree/manager.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/lib/locktree/treenode.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/lib/locktree/wfg.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/lib/standalone_port.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/lib/util/dbt.cc
|
|
||||||
utilities/transactions/lock/range/range_tree/lib/util/memarena.cc
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -540,14 +426,14 @@ else()
|
|||||||
env/io_posix.cc
|
env/io_posix.cc
|
||||||
env/fs_posix.cc)
|
env/fs_posix.cc)
|
||||||
# ppc64 or ppc64le
|
# ppc64 or ppc64le
|
||||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
|
||||||
enable_language(ASM)
|
enable_language(ASM)
|
||||||
list(APPEND ROCKSDB_SOURCES
|
list(APPEND ROCKSDB_SOURCES
|
||||||
util/crc32c_ppc.c
|
util/crc32c_ppc.c
|
||||||
util/crc32c_ppc_asm.S)
|
util/crc32c_ppc_asm.S)
|
||||||
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
|
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
|
||||||
# aarch
|
# aarch
|
||||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64|aarch64|AARCH64")
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64")
|
||||||
INCLUDE(CheckCXXCompilerFlag)
|
INCLUDE(CheckCXXCompilerFlag)
|
||||||
CHECK_CXX_COMPILER_FLAG("-march=armv8-a+crc+crypto" HAS_ARMV8_CRC)
|
CHECK_CXX_COMPILER_FLAG("-march=armv8-a+crc+crypto" HAS_ARMV8_CRC)
|
||||||
if(HAS_ARMV8_CRC)
|
if(HAS_ARMV8_CRC)
|
||||||
@@ -556,7 +442,7 @@ else()
|
|||||||
list(APPEND ROCKSDB_SOURCES
|
list(APPEND ROCKSDB_SOURCES
|
||||||
util/crc32c_arm64.cc)
|
util/crc32c_arm64.cc)
|
||||||
endif(HAS_ARMV8_CRC)
|
endif(HAS_ARMV8_CRC)
|
||||||
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64|aarch64|AARCH64")
|
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64")
|
||||||
endif()
|
endif()
|
||||||
SET(SOURCES)
|
SET(SOURCES)
|
||||||
FOREACH(s ${ROCKSDB_SOURCES})
|
FOREACH(s ${ROCKSDB_SOURCES})
|
||||||
@@ -573,7 +459,7 @@ if(MSVC)
|
|||||||
# Workaround Win8.1 SDK bug, that breaks /permissive-
|
# Workaround Win8.1 SDK bug, that breaks /permissive-
|
||||||
string(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
string(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_REQUIRED_FLAGS "-msse4.2 -mpclmul ${CXX17_FLAGS}")
|
set(CMAKE_REQUIRED_FLAGS "-msse4.2 -mpclmul ${CXX11_FLAGS}")
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -594,26 +480,16 @@ int main() {
|
|||||||
unset(CMAKE_REQUIRED_FLAGS)
|
unset(CMAKE_REQUIRED_FLAGS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(GIT_EXECUTABLE AND EXISTS "${ROCKSDB_SOURCE_DIR}/.git")
|
IF(CMAKE_VERSION VERSION_GREATER "2.8.10")
|
||||||
execute_process(WORKING_DIRECTORY "${ROCKSDB_SOURCE_DIR}" OUTPUT_VARIABLE GIT_SHA COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD )
|
STRING(TIMESTAMP GIT_DATE_TIME "%Y-%m-%d %H:%M:%S")
|
||||||
execute_process(WORKING_DIRECTORY "${ROCKSDB_SOURCE_DIR}" RESULT_VARIABLE GIT_MOD COMMAND "${GIT_EXECUTABLE}" diff-index HEAD --quiet)
|
ENDIF()
|
||||||
execute_process(WORKING_DIRECTORY "${ROCKSDB_SOURCE_DIR}" OUTPUT_VARIABLE GIT_DATE COMMAND "${GIT_EXECUTABLE}" log -1 --date=format:"%Y-%m-%d %T" --format="%ad")
|
|
||||||
execute_process(WORKING_DIRECTORY "${ROCKSDB_SOURCE_DIR}" OUTPUT_VARIABLE GIT_TAG RESULT_VARIABLE rv COMMAND "${GIT_EXECUTABLE}" symbolic-ref -q --short HEAD OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
if (rv AND NOT rv EQUAL 0)
|
|
||||||
execute_process(WORKING_DIRECTORY "${ROCKSDB_SOURCE_DIR}" OUTPUT_VARIABLE GIT_TAG COMMAND "${GIT_EXECUTABLE}" describe --tags --exact-match OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
set(GIT_SHA 0)
|
|
||||||
set(GIT_MOD 1)
|
|
||||||
endif()
|
|
||||||
string(REGEX REPLACE "[^0-9a-fA-F]+" "" GIT_SHA "${GIT_SHA}")
|
|
||||||
string(REGEX REPLACE "[^0-9: /-]+" "" GIT_DATE "${GIT_DATE}")
|
|
||||||
|
|
||||||
CONFIGURE_FILE(${ROCKSDB_SOURCE_DIR}/util/build_version.cc.in build_version.cc @ONLY)
|
CONFIGURE_FILE(${ROCKSDB_SOURCE_DIR}/util/build_version.cc.in build_version.cc @ONLY)
|
||||||
|
INCLUDE_DIRECTORIES(${ROCKSDB_SOURCE_DIR}/util)
|
||||||
list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/build_version.cc)
|
list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/build_version.cc)
|
||||||
|
|
||||||
ADD_CONVENIENCE_LIBRARY(rocksdblib ${SOURCES})
|
ADD_CONVENIENCE_LIBRARY(rocksdblib ${SOURCES})
|
||||||
target_link_libraries(rocksdblib ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
|
target_link_libraries(rocksdblib ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
|
||||||
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
set_target_properties(rocksdblib PROPERTIES COMPILE_FLAGS "-fPIC -fno-builtin-memcmp -Wno-error -Wno-missing-braces -Wno-strict-aliasing -Wno-invalid-offsetof")
|
set_target_properties(rocksdblib PROPERTIES COMPILE_FLAGS "-fPIC -fno-builtin-memcmp -Wno-error")
|
||||||
endif()
|
endif()
|
||||||
|
27
storage/rocksdb/get_rocksdb_files.sh
Executable file
27
storage/rocksdb/get_rocksdb_files.sh
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
MKFILE=`mktemp`
|
||||||
|
# create and run a simple makefile
|
||||||
|
# include rocksdb make file relative to the path of this script
|
||||||
|
echo "include ./storage/rocksdb/rocksdb/src.mk
|
||||||
|
all:
|
||||||
|
@echo \$(LIB_SOURCES)" > $MKFILE
|
||||||
|
for f in `make --makefile $MKFILE`
|
||||||
|
do
|
||||||
|
echo ./rocksdb/$f
|
||||||
|
done
|
||||||
|
rm $MKFILE
|
||||||
|
|
||||||
|
# create build_version.cc file. Only create one if it doesn't exists or if it is different
|
||||||
|
# this is so that we don't rebuild mysqld every time
|
||||||
|
bv=storage/rocksdb/rocksdb/util/build_version.cc
|
||||||
|
date=$(date +%F)
|
||||||
|
git_sha=$(pushd storage/rocksdb/rocksdb >/dev/null && git rev-parse HEAD 2>/dev/null && popd >/dev/null)
|
||||||
|
if [ ! -f $bv ] || [ -z $git_sha ] || [ ! `grep $git_sha $bv` ]
|
||||||
|
then
|
||||||
|
echo "#include \"build_version.h\"
|
||||||
|
const char* rocksdb_build_git_sha =
|
||||||
|
\"rocksdb_build_git_sha:$git_sha\";
|
||||||
|
const char* rocksdb_build_git_date =
|
||||||
|
\"rocksdb_build_git_date:$date\";
|
||||||
|
const char* rocksdb_build_compile_date = __DATE__;" > $bv
|
||||||
|
fi
|
File diff suppressed because it is too large
Load Diff
@@ -93,7 +93,6 @@ enum collations_used {
|
|||||||
|
|
||||||
#if 0 // MARIAROCKS_NOT_YET : read-free replication is not supported
|
#if 0 // MARIAROCKS_NOT_YET : read-free replication is not supported
|
||||||
extern char *rocksdb_read_free_rpl_tables;
|
extern char *rocksdb_read_free_rpl_tables;
|
||||||
extern ulong rocksdb_max_row_locks;
|
|
||||||
#if defined(HAVE_PSI_INTERFACE)
|
#if defined(HAVE_PSI_INTERFACE)
|
||||||
extern PSI_rwlock_key key_rwlock_read_free_rpl_tables;
|
extern PSI_rwlock_key key_rwlock_read_free_rpl_tables;
|
||||||
#endif
|
#endif
|
||||||
@@ -291,18 +290,12 @@ class ha_rocksdb : public my_core::handler {
|
|||||||
*/
|
*/
|
||||||
bool m_insert_with_update;
|
bool m_insert_with_update;
|
||||||
|
|
||||||
/*
|
/* TRUE if last time the insertion failed due to duplicated PK */
|
||||||
TRUE if last time the insertion failed due to duplicate key error.
|
bool m_dup_pk_found;
|
||||||
(m_dupp_errkey holds the key# that we've had error for)
|
|
||||||
*/
|
|
||||||
bool m_dup_key_found;
|
|
||||||
|
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
/*
|
/* Last retreived record for sanity checking */
|
||||||
Last retrieved record (for duplicate PK) or index tuple (for duplicate
|
String m_dup_pk_retrieved_record;
|
||||||
unique SK). Used for sanity checking.
|
|
||||||
*/
|
|
||||||
String m_dup_key_retrieved_record;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -354,10 +347,10 @@ class ha_rocksdb : public my_core::handler {
|
|||||||
MY_ATTRIBUTE((__nonnull__));
|
MY_ATTRIBUTE((__nonnull__));
|
||||||
void release_scan_iterator(void);
|
void release_scan_iterator(void);
|
||||||
|
|
||||||
rocksdb::Status get_for_update(Rdb_transaction *const tx,
|
rocksdb::Status get_for_update(
|
||||||
const Rdb_key_def &kd,
|
Rdb_transaction *const tx,
|
||||||
const rocksdb::Slice &key,
|
rocksdb::ColumnFamilyHandle *const column_family,
|
||||||
rocksdb::PinnableSlice *value) const;
|
const rocksdb::Slice &key, rocksdb::PinnableSlice *value) const;
|
||||||
|
|
||||||
int get_row_by_rowid(uchar *const buf, const char *const rowid,
|
int get_row_by_rowid(uchar *const buf, const char *const rowid,
|
||||||
const uint rowid_size, const bool skip_lookup = false,
|
const uint rowid_size, const bool skip_lookup = false,
|
||||||
@@ -399,6 +392,13 @@ class ha_rocksdb : public my_core::handler {
|
|||||||
|
|
||||||
void set_last_rowkey(const uchar *const old_data);
|
void set_last_rowkey(const uchar *const old_data);
|
||||||
|
|
||||||
|
/*
|
||||||
|
For the active index, indicates which columns must be covered for the
|
||||||
|
current lookup to be covered. If the bitmap field is null, that means this
|
||||||
|
index does not cover the current lookup for any record.
|
||||||
|
*/
|
||||||
|
MY_BITMAP m_lookup_bitmap = {nullptr, nullptr, 0, 0};
|
||||||
|
|
||||||
int alloc_key_buffers(const TABLE *const table_arg,
|
int alloc_key_buffers(const TABLE *const table_arg,
|
||||||
const Rdb_tbl_def *const tbl_def_arg,
|
const Rdb_tbl_def *const tbl_def_arg,
|
||||||
bool alloc_alter_buffers = false)
|
bool alloc_alter_buffers = false)
|
||||||
@@ -670,7 +670,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
private:
|
private:
|
||||||
struct key_def_cf_info {
|
struct key_def_cf_info {
|
||||||
std::shared_ptr<rocksdb::ColumnFamilyHandle> cf_handle;
|
rocksdb::ColumnFamilyHandle *cf_handle;
|
||||||
bool is_reverse_cf;
|
bool is_reverse_cf;
|
||||||
bool is_per_partition_cf;
|
bool is_per_partition_cf;
|
||||||
};
|
};
|
||||||
@@ -771,14 +771,14 @@ public:
|
|||||||
int get_pk_for_update(struct update_row_info *const row_info);
|
int get_pk_for_update(struct update_row_info *const row_info);
|
||||||
int check_and_lock_unique_pk(const uint key_id,
|
int check_and_lock_unique_pk(const uint key_id,
|
||||||
const struct update_row_info &row_info,
|
const struct update_row_info &row_info,
|
||||||
bool *const found, const bool skip_unique_check)
|
bool *const found)
|
||||||
MY_ATTRIBUTE((__warn_unused_result__));
|
MY_ATTRIBUTE((__warn_unused_result__));
|
||||||
int check_and_lock_sk(const uint key_id,
|
int check_and_lock_sk(const uint key_id,
|
||||||
const struct update_row_info &row_info,
|
const struct update_row_info &row_info,
|
||||||
bool *const found, const bool skip_unique_check)
|
bool *const found)
|
||||||
MY_ATTRIBUTE((__warn_unused_result__));
|
MY_ATTRIBUTE((__warn_unused_result__));
|
||||||
int check_uniqueness_and_lock(const struct update_row_info &row_info,
|
int check_uniqueness_and_lock(const struct update_row_info &row_info,
|
||||||
bool pk_changed, const bool skip_unique_check)
|
bool pk_changed)
|
||||||
MY_ATTRIBUTE((__warn_unused_result__));
|
MY_ATTRIBUTE((__warn_unused_result__));
|
||||||
bool over_bulk_load_threshold(int *err)
|
bool over_bulk_load_threshold(int *err)
|
||||||
MY_ATTRIBUTE((__warn_unused_result__));
|
MY_ATTRIBUTE((__warn_unused_result__));
|
||||||
@@ -923,8 +923,6 @@ public:
|
|||||||
MY_ATTRIBUTE((__warn_unused_result__));
|
MY_ATTRIBUTE((__warn_unused_result__));
|
||||||
int create_table(const std::string &table_name, const TABLE *table_arg,
|
int create_table(const std::string &table_name, const TABLE *table_arg,
|
||||||
ulonglong auto_increment_value);
|
ulonglong auto_increment_value);
|
||||||
int truncate_table(Rdb_tbl_def *tbl_def, TABLE *table_arg,
|
|
||||||
ulonglong auto_increment_value);
|
|
||||||
bool check_if_incompatible_data(HA_CREATE_INFO *const info,
|
bool check_if_incompatible_data(HA_CREATE_INFO *const info,
|
||||||
uint table_changes) override
|
uint table_changes) override
|
||||||
MY_ATTRIBUTE((__warn_unused_result__));
|
MY_ATTRIBUTE((__warn_unused_result__));
|
||||||
@@ -984,9 +982,6 @@ public:
|
|||||||
bool is_read_free_rpl_table() const;
|
bool is_read_free_rpl_table() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void build_decoder();
|
|
||||||
void check_build_decoder();
|
|
||||||
|
|
||||||
#ifdef MARIAROCKS_NOT_YET // MDEV-10976
|
#ifdef MARIAROCKS_NOT_YET // MDEV-10976
|
||||||
public:
|
public:
|
||||||
virtual void rpl_before_delete_rows() override;
|
virtual void rpl_before_delete_rows() override;
|
||||||
@@ -1002,9 +997,6 @@ public:
|
|||||||
bool m_in_rpl_update_rows;
|
bool m_in_rpl_update_rows;
|
||||||
|
|
||||||
bool m_force_skip_unique_check;
|
bool m_force_skip_unique_check;
|
||||||
|
|
||||||
/* Need to build decoder on next read operation */
|
|
||||||
bool m_need_build_decoder;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -46,9 +46,6 @@ void rdb_handle_io_error(const rocksdb::Status status,
|
|||||||
MY_ATTRIBUTE((noinline,noclone));
|
MY_ATTRIBUTE((noinline,noclone));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool rdb_is_tablename_normalized(const std::string &tablename)
|
|
||||||
MY_ATTRIBUTE((__warn_unused_result__));
|
|
||||||
|
|
||||||
int rdb_normalize_tablename(const std::string &tablename, std::string *str)
|
int rdb_normalize_tablename(const std::string &tablename, std::string *str)
|
||||||
MY_ATTRIBUTE((__nonnull__, __warn_unused_result__));
|
MY_ATTRIBUTE((__nonnull__, __warn_unused_result__));
|
||||||
|
|
||||||
@@ -57,11 +54,6 @@ int rdb_split_normalized_tablename(const std::string &fullname, std::string *db,
|
|||||||
std::string *partition = nullptr)
|
std::string *partition = nullptr)
|
||||||
MY_ATTRIBUTE((__warn_unused_result__));
|
MY_ATTRIBUTE((__warn_unused_result__));
|
||||||
|
|
||||||
void rdb_gen_normalized_tablename(const std::string *db,
|
|
||||||
const std::string *table,
|
|
||||||
const std::string *partition,
|
|
||||||
std::string *fullname);
|
|
||||||
|
|
||||||
std::vector<std::string> rdb_get_open_table_names(void);
|
std::vector<std::string> rdb_get_open_table_names(void);
|
||||||
|
|
||||||
class Rdb_perf_counters;
|
class Rdb_perf_counters;
|
||||||
@@ -74,8 +66,6 @@ void rdb_get_global_perf_counters(Rdb_perf_counters *counters)
|
|||||||
|
|
||||||
void rdb_queue_save_stats_request();
|
void rdb_queue_save_stats_request();
|
||||||
|
|
||||||
extern const std::string TRUNCATE_TABLE_PREFIX;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Access to singleton objects.
|
Access to singleton objects.
|
||||||
*/
|
*/
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
'\" t
|
'\" t
|
||||||
.\"
|
.\"
|
||||||
.TH "\FBMARIADB-LDB\FR" "1" "15 May 2023" "MariaDB 11.2" "MariaDB Database System"
|
.TH "\fBMARIADB-LDB\fR" "1" "15 May 2020" "MariaDB 10.11" "MariaDB Database System"
|
||||||
.\" -----------------------------------------------------------------
|
.\" -----------------------------------------------------------------
|
||||||
.\" * set default formatting
|
.\" * set default formatting
|
||||||
.\" -----------------------------------------------------------------
|
.\" -----------------------------------------------------------------
|
||||||
@@ -11,6 +11,6 @@
|
|||||||
.SH NAME
|
.SH NAME
|
||||||
mariadb-ldb \- RocksDB tool (mysql_ldb is now a symlink to mariadb-ldb)
|
mariadb-ldb \- RocksDB tool (mysql_ldb is now a symlink to mariadb-ldb)
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Use \fBmariadb-ldb \-\-help\fR for details on usage\.
|
Use \fBmysql_ldb \-\-help\fR for details on usage\.
|
||||||
.PP
|
.PP
|
||||||
For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
|
For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
|
||||||
|
@@ -1,16 +0,0 @@
|
|||||||
'\" t
|
|
||||||
.\"
|
|
||||||
.TH "\FBMARIADB-SST-DUMP\FR" "1" "15 May 2023" "MariaDB 11.2" "MariaDB Database System"
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" * set default formatting
|
|
||||||
.\" -----------------------------------------------------------------
|
|
||||||
.\" disable hyphenation
|
|
||||||
.nh
|
|
||||||
.\" disable justification (adjust text to left margin only)
|
|
||||||
.ad l
|
|
||||||
.SH NAME
|
|
||||||
mariadb-sst-dump \- RocksDB tool (mysql_sst_dump is now a symlink to mariadb-sst-dump)
|
|
||||||
.SH DESCRIPTION
|
|
||||||
Use \fBmariadb-sst-dump \-\-help\fR for details on usage\.
|
|
||||||
.PP
|
|
||||||
For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
|
|
@@ -3,7 +3,3 @@ loose-rocksdb_write_policy=write_committed
|
|||||||
|
|
||||||
[write_prepared]
|
[write_prepared]
|
||||||
loose-rocksdb_write_policy=write_prepared
|
loose-rocksdb_write_policy=write_prepared
|
||||||
|
|
||||||
[write_unprepared]
|
|
||||||
loose-rocksdb_write_policy=write_unprepared
|
|
||||||
loose-rocksdb_write_batch_flush_threshold=1
|
|
||||||
|
@@ -2,7 +2,7 @@ CREATE TABLE t0 (id1 VARCHAR(30), id2 INT, value INT, PRIMARY KEY (id1, id2)) EN
|
|||||||
select variable_value into @u from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_useful';
|
select variable_value into @u from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_useful';
|
||||||
SELECT COUNT(*) FROM t0 WHERE id1='X' AND id2>=1;
|
SELECT COUNT(*) FROM t0 WHERE id1='X' AND id2>=1;
|
||||||
COUNT(*)
|
COUNT(*)
|
||||||
100000
|
10000
|
||||||
select case when variable_value-@u = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_useful';
|
select case when variable_value-@u = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_useful';
|
||||||
case when variable_value-@u = 0 then 'true' else 'false' end
|
case when variable_value-@u = 0 then 'true' else 'false' end
|
||||||
true
|
true
|
||||||
@@ -11,14 +11,14 @@ CREATE TABLE t1 (id1 BIGINT, id2 INT, id3 BIGINT, value INT, PRIMARY KEY (id1, i
|
|||||||
select variable_value into @u from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_useful';
|
select variable_value into @u from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_useful';
|
||||||
SELECT COUNT(*) FROM t1 WHERE id1=1 AND id2=1 AND id3>=2;
|
SELECT COUNT(*) FROM t1 WHERE id1=1 AND id2=1 AND id3>=2;
|
||||||
COUNT(*)
|
COUNT(*)
|
||||||
99999
|
9999
|
||||||
select case when variable_value-@u = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_useful';
|
select case when variable_value-@u = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_useful';
|
||||||
case when variable_value-@u = 0 then 'true' else 'false' end
|
case when variable_value-@u = 0 then 'true' else 'false' end
|
||||||
true
|
true
|
||||||
select variable_value into @u from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_useful';
|
select variable_value into @u from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_useful';
|
||||||
SELECT COUNT(*) FROM t1 WHERE id1=1 AND id2>=1 AND id3>=2;
|
SELECT COUNT(*) FROM t1 WHERE id1=1 AND id2>=1 AND id3>=2;
|
||||||
COUNT(*)
|
COUNT(*)
|
||||||
99999
|
9999
|
||||||
select case when variable_value-@u = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_useful';
|
select case when variable_value-@u = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_useful';
|
||||||
case when variable_value-@u = 0 then 'true' else 'false' end
|
case when variable_value-@u = 0 then 'true' else 'false' end
|
||||||
true
|
true
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
--rocksdb_rate_limiter_bytes_per_sec=256k --rocksdb_default_cf_options=write_buffer_size=64k;target_file_size_base=64k;max_bytes_for_level_base=1m;compression_per_level=kNoCompression;max_compaction_bytes=256k
|
|
@@ -1,89 +0,0 @@
|
|||||||
CREATE FUNCTION is_compaction_stopped() RETURNS INT
|
|
||||||
BEGIN
|
|
||||||
SELECT variable_value INTO @cwb_1 FROM information_schema.global_status WHERE variable_name="rocksdb_compact_write_bytes";
|
|
||||||
SELECT SLEEP(3) INTO @a;
|
|
||||||
SELECT variable_value INTO @cwb_2 FROM information_schema.global_status WHERE variable_name="rocksdb_compact_write_bytes";
|
|
||||||
IF @cwb_2 > @cwb_1 THEN
|
|
||||||
RETURN 0;
|
|
||||||
END IF;
|
|
||||||
RETURN 1;
|
|
||||||
END//
|
|
||||||
DROP TABLE IF EXISTS t1;
|
|
||||||
create table t1 (id int auto_increment, value int, value2 varchar(500), primary key (id), index(value2) comment 'cf_i') engine=rocksdb;
|
|
||||||
SET SESSION rocksdb_bulk_load_allow_sk=1;
|
|
||||||
SET SESSION rocksdb_bulk_load=1;
|
|
||||||
LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
|
|
||||||
FIELDS TERMINATED BY ',' (id, value, value2);
|
|
||||||
SET SESSION rocksdb_bulk_load=0;
|
|
||||||
SET SESSION rocksdb_bulk_load_allow_sk=0;
|
|
||||||
connect con1,localhost,root,,;
|
|
||||||
connect con2,localhost,root,,;
|
|
||||||
#
|
|
||||||
# Cancelling MC, including pending MCs, by KILL statements
|
|
||||||
#
|
|
||||||
connection default;
|
|
||||||
SELECT variable_value into @executed_start FROM information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_cancelled";
|
|
||||||
connection con1;
|
|
||||||
SET GLOBAL rocksdb_compact_cf='default';
|
|
||||||
connection con2;
|
|
||||||
set session rocksdb_manual_compaction_threads=2;
|
|
||||||
SET GLOBAL rocksdb_compact_cf='cf_i';
|
|
||||||
connection default;
|
|
||||||
connection con1;
|
|
||||||
ERROR HY000: Internal error: Manual Compaction Failed. Reason: Cancelled by client.
|
|
||||||
connection con2;
|
|
||||||
ERROR HY000: Internal error: Manual Compaction Failed. Reason: Cancelled by client.
|
|
||||||
connection default;
|
|
||||||
SELECT variable_value into @executed_end FROM information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_cancelled";
|
|
||||||
SELECT @executed_end-@executed_start AS CANCELLED_MC;
|
|
||||||
CANCELLED_MC
|
|
||||||
2
|
|
||||||
#
|
|
||||||
# Cancelling MC by global opt
|
|
||||||
#
|
|
||||||
connection default;
|
|
||||||
SELECT variable_value into @executed_start FROM information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_cancelled";
|
|
||||||
connection con1;
|
|
||||||
set session rocksdb_manual_compaction_threads=2;
|
|
||||||
SET GLOBAL rocksdb_compact_cf='default';
|
|
||||||
connection default;
|
|
||||||
connection con2;
|
|
||||||
SET GLOBAL rocksdb_compact_cf='cf_i';
|
|
||||||
connection default;
|
|
||||||
set global rocksdb_cancel_manual_compactions=ON;
|
|
||||||
connection con1;
|
|
||||||
ERROR HY000: Internal error: Manual Compaction Failed. Reason: Cancelled by server.
|
|
||||||
connection con2;
|
|
||||||
ERROR HY000: Internal error: Manual Compaction Failed. Reason: Cancelled by server.
|
|
||||||
connection default;
|
|
||||||
SELECT variable_value into @executed_end FROM information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_cancelled";
|
|
||||||
SELECT @executed_end-@executed_start AS CANCELLED_MC;
|
|
||||||
CANCELLED_MC
|
|
||||||
2
|
|
||||||
#
|
|
||||||
# Cancelling OPTIMIZE TABLE by global opt
|
|
||||||
#
|
|
||||||
connection con1;
|
|
||||||
OPTIMIZE TABLE t1;
|
|
||||||
connection default;
|
|
||||||
SELECT variable_value into @current_cwb FROM information_schema.global_status WHERE variable_name="rocksdb_compact_write_bytes";
|
|
||||||
set global rocksdb_cancel_manual_compactions=ON;
|
|
||||||
connection con1;
|
|
||||||
Table Op Msg_type Msg_text
|
|
||||||
test.t1 optimize Error Got error 7 'Result incomplete: Manual compaction paused' from ROCKSDB
|
|
||||||
test.t1 optimize error Unknown - internal error 215 during operation
|
|
||||||
connection default;
|
|
||||||
select 'PRIMARY' as idx, COUNT(*) as cnt FROM t1 FORCE INDEX (PRIMARY)
|
|
||||||
UNION ALL SELECT 'value2' as idx, COUNT(*) as cnt FROM t1 FORCE INDEX (value2);
|
|
||||||
idx cnt
|
|
||||||
PRIMARY 500000
|
|
||||||
value2 500000
|
|
||||||
#
|
|
||||||
# Dropping Indexes complete even after cancelling MC
|
|
||||||
#
|
|
||||||
INSERT INTO t1 (id) VALUES (null);
|
|
||||||
set global rocksdb_force_flush_memtable_now=ON;
|
|
||||||
SELECT variable_value into @current_cwb FROM information_schema.global_status WHERE variable_name="rocksdb_compact_write_bytes";
|
|
||||||
DROP TABLE t1;
|
|
||||||
set global rocksdb_cancel_manual_compactions=ON;
|
|
||||||
DROP FUNCTION is_compaction_stopped;
|
|
@@ -1,19 +0,0 @@
|
|||||||
connect con1,localhost,root,,;
|
|
||||||
connect con2,localhost,root,,;
|
|
||||||
connection default;
|
|
||||||
set global rocksdb_debug_manual_compaction_delay=80;
|
|
||||||
connection con1;
|
|
||||||
SET GLOBAL rocksdb_compact_cf='default';
|
|
||||||
connection default;
|
|
||||||
connection con2;
|
|
||||||
set session rocksdb_manual_compaction_threads=2;
|
|
||||||
SET GLOBAL rocksdb_compact_cf='default';
|
|
||||||
connection default;
|
|
||||||
connection con2;
|
|
||||||
ERROR HY000: Internal error: Manual Compaction Failed. Reason: Cancelled by client.
|
|
||||||
connection con1;
|
|
||||||
ERROR HY000: Internal error: Manual Compaction Failed. Reason: Cancelled by client. (timeout)
|
|
||||||
connection default;
|
|
||||||
set global rocksdb_debug_manual_compaction_delay=0;
|
|
||||||
connection con1;
|
|
||||||
SET GLOBAL rocksdb_compact_cf='default';
|
|
@@ -1,6 +1,12 @@
|
|||||||
|
call mtr.add_suppression("Column family 'cf1' not found");
|
||||||
|
call mtr.add_suppression("Column family 'rev:cf2' not found");
|
||||||
DROP TABLE IF EXISTS t1;
|
DROP TABLE IF EXISTS t1;
|
||||||
call mtr.add_suppression("Column family 'cf1' not found");
|
call mtr.add_suppression("Column family 'cf1' not found");
|
||||||
call mtr.add_suppression("Column family 'rev:cf2' not found");
|
call mtr.add_suppression("Column family 'rev:cf2' not found");
|
||||||
|
set global rocksdb_compact_cf = 'cf1';
|
||||||
|
set global rocksdb_compact_cf = 'rev:cf2';
|
||||||
|
set global rocksdb_signal_drop_index_thread = 1;
|
||||||
|
# restart
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
a int not null,
|
a int not null,
|
||||||
b int not null,
|
b int not null,
|
||||||
@@ -9,10 +15,6 @@ primary key (a,b) comment 'cf1',
|
|||||||
key (b) comment 'rev:cf2'
|
key (b) comment 'rev:cf2'
|
||||||
) ENGINE=RocksDB;
|
) ENGINE=RocksDB;
|
||||||
DELETE FROM t1;
|
DELETE FROM t1;
|
||||||
set global rocksdb_compact_cf = 'cf1';
|
|
||||||
set global rocksdb_compact_cf = 'rev:cf2';
|
|
||||||
set global rocksdb_signal_drop_index_thread = 1;
|
|
||||||
# restart
|
|
||||||
select variable_value into @a from information_schema.global_status where variable_name='rocksdb_compact_read_bytes';
|
select variable_value into @a from information_schema.global_status where variable_name='rocksdb_compact_read_bytes';
|
||||||
drop table t1;
|
drop table t1;
|
||||||
select case when variable_value-@a < 500000 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_compact_read_bytes';
|
select case when variable_value-@a < 500000 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_compact_read_bytes';
|
||||||
|
@@ -11,7 +11,6 @@ ROCKSDB_DDL
|
|||||||
ROCKSDB_DEADLOCK
|
ROCKSDB_DEADLOCK
|
||||||
ROCKSDB_GLOBAL_INFO
|
ROCKSDB_GLOBAL_INFO
|
||||||
ROCKSDB_INDEX_FILE_MAP
|
ROCKSDB_INDEX_FILE_MAP
|
||||||
ROCKSDB_LIVE_FILES_METADATA
|
|
||||||
ROCKSDB_LOCKS
|
ROCKSDB_LOCKS
|
||||||
ROCKSDB_PERF_CONTEXT
|
ROCKSDB_PERF_CONTEXT
|
||||||
ROCKSDB_PERF_CONTEXT_GLOBAL
|
ROCKSDB_PERF_CONTEXT_GLOBAL
|
||||||
|
@@ -55,9 +55,6 @@ CF_FLAGS 4 cf_c [0]
|
|||||||
CF_FLAGS 5 rev:cf_d [1]
|
CF_FLAGS 5 rev:cf_d [1]
|
||||||
CREATE TABLE t3 (a INT, PRIMARY KEY (a)) ENGINE=ROCKSDB;
|
CREATE TABLE t3 (a INT, PRIMARY KEY (a)) ENGINE=ROCKSDB;
|
||||||
insert into t3 (a) values (1), (2), (3);
|
insert into t3 (a) values (1), (2), (3);
|
||||||
SELECT IF(count(*) > 0, "TRUE", "FALSE") as metadata_exist FROM INFORMATION_SCHEMA.ROCKSDB_LIVE_FILES_METADATA where CF_NAME = 'default';
|
|
||||||
metadata_exist
|
|
||||||
TRUE
|
|
||||||
SET @ORIG_ROCKSDB_PAUSE_BACKGROUND_WORK = @@GLOBAL.ROCKSDB_PAUSE_BACKGROUND_WORK;
|
SET @ORIG_ROCKSDB_PAUSE_BACKGROUND_WORK = @@GLOBAL.ROCKSDB_PAUSE_BACKGROUND_WORK;
|
||||||
SHOW GLOBAL VARIABLES LIKE 'ROCKSDB_PAUSE_BACKGROUND_WORK';
|
SHOW GLOBAL VARIABLES LIKE 'ROCKSDB_PAUSE_BACKGROUND_WORK';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
|
@@ -60,7 +60,7 @@ LIST OF SNAPSHOTS FOR EACH SESSION:
|
|||||||
---SNAPSHOT, ACTIVE NUM sec
|
---SNAPSHOT, ACTIVE NUM sec
|
||||||
MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION
|
MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS
|
SHOW ENGINE rocksdb TRANSACTION STATUS
|
||||||
lock count 4, write count 4
|
lock count 8, write count 4
|
||||||
insert count 2, update count 1, delete count 1
|
insert count 2, update count 1, delete count 1
|
||||||
----------LATEST DETECTED DEADLOCKS----------
|
----------LATEST DETECTED DEADLOCKS----------
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
@@ -98,7 +98,7 @@ LIST OF SNAPSHOTS FOR EACH SESSION:
|
|||||||
---SNAPSHOT, ACTIVE NUM sec
|
---SNAPSHOT, ACTIVE NUM sec
|
||||||
MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION
|
MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS
|
SHOW ENGINE rocksdb TRANSACTION STATUS
|
||||||
lock count 1, write count 1
|
lock count 2, write count 1
|
||||||
insert count 1, update count 0, delete count 0
|
insert count 1, update count 0, delete count 0
|
||||||
----------LATEST DETECTED DEADLOCKS----------
|
----------LATEST DETECTED DEADLOCKS----------
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
@@ -149,43 +149,7 @@ LIST OF SNAPSHOTS FOR EACH SESSION:
|
|||||||
---SNAPSHOT, ACTIVE NUM sec
|
---SNAPSHOT, ACTIVE NUM sec
|
||||||
MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION
|
MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS
|
SHOW ENGINE rocksdb TRANSACTION STATUS
|
||||||
lock count 5, write count 7
|
lock count 9, write count 7
|
||||||
insert count 2, update count 1, delete count 1
|
|
||||||
----------LATEST DETECTED DEADLOCKS----------
|
|
||||||
-----------------------------------------
|
|
||||||
END OF ROCKSDB TRANSACTION MONITOR OUTPUT
|
|
||||||
=========================================
|
|
||||||
|
|
||||||
ROLLBACK;
|
|
||||||
SET AUTOCOMMIT=1;
|
|
||||||
DROP TABLE t2;
|
|
||||||
DROP TABLE IF EXISTS t2;
|
|
||||||
CREATE TABLE t2 (
|
|
||||||
id1 INT,
|
|
||||||
id2 INT,
|
|
||||||
value INT,
|
|
||||||
PRIMARY KEY (id1),
|
|
||||||
UNIQUE KEY (id2)
|
|
||||||
) ENGINE=rocksdb;
|
|
||||||
SET AUTOCOMMIT=0;
|
|
||||||
START TRANSACTION;
|
|
||||||
INSERT INTO t2 VALUES(1,2,0),(10,20,30);
|
|
||||||
UPDATE t2 SET value=3 WHERE id2=2;
|
|
||||||
DELETE FROM t2 WHERE id1=10;
|
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS;
|
|
||||||
Type Name Status
|
|
||||||
rocksdb
|
|
||||||
============================================================
|
|
||||||
TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
|
|
||||||
============================================================
|
|
||||||
---------
|
|
||||||
SNAPSHOTS
|
|
||||||
---------
|
|
||||||
LIST OF SNAPSHOTS FOR EACH SESSION:
|
|
||||||
---SNAPSHOT, ACTIVE NUM sec
|
|
||||||
MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION
|
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS
|
|
||||||
lock count 4, write count 7
|
|
||||||
insert count 2, update count 1, delete count 1
|
insert count 2, update count 1, delete count 1
|
||||||
----------LATEST DETECTED DEADLOCKS----------
|
----------LATEST DETECTED DEADLOCKS----------
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
@@ -15,20 +15,3 @@ SELECT COUNT(*) FROM t1 FORCE INDEX(d);
|
|||||||
COUNT(*)
|
COUNT(*)
|
||||||
1
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE `t1` (
|
|
||||||
`a` bigint(20) NOT NULL,
|
|
||||||
`b` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
|
|
||||||
`u` timestamp NOT NULL,
|
|
||||||
`d` bigint(20) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`a`,`b`),
|
|
||||||
KEY `d` (`d`)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='ttl_duration=1000;ttl_col=u';
|
|
||||||
INSERT INTO t1 VALUES (100, 'aaabbb', NOW(), 200);
|
|
||||||
EXPLAIN SELECT COUNT(*) FROM t1;
|
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
|
||||||
1 SIMPLE t1 index NULL d 9 NULL # Using index
|
|
||||||
# segfault here without the fix
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
COUNT(*)
|
|
||||||
1
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
@@ -1,37 +0,0 @@
|
|||||||
CREATE PROCEDURE compact_start()
|
|
||||||
BEGIN
|
|
||||||
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_compact_write_bytes';
|
|
||||||
END//
|
|
||||||
CREATE PROCEDURE compact_end()
|
|
||||||
BEGIN
|
|
||||||
select case when variable_value-@c > 0 then 'true' else 'false' end as checked from information_schema.global_status where variable_name='rocksdb_compact_write_bytes';
|
|
||||||
END//
|
|
||||||
DROP TABLE IF EXISTS t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a int not null,
|
|
||||||
b int not null,
|
|
||||||
primary key (a,b),
|
|
||||||
key (b)
|
|
||||||
) ENGINE=RocksDB;
|
|
||||||
DELETE FROM t1;
|
|
||||||
set @@session.rocksdb_manual_compaction_bottommost_level='kSkip';
|
|
||||||
call compact_start();
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
call compact_end();
|
|
||||||
checked
|
|
||||||
true
|
|
||||||
set @@session.rocksdb_manual_compaction_bottommost_level='kSkip';
|
|
||||||
call compact_start();
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
call compact_end();
|
|
||||||
checked
|
|
||||||
false
|
|
||||||
set @@session.rocksdb_manual_compaction_bottommost_level='kForceOptimized';
|
|
||||||
call compact_start();
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
call compact_end();
|
|
||||||
checked
|
|
||||||
true
|
|
||||||
DROP PROCEDURE compact_start;
|
|
||||||
DROP PROCEDURE compact_end;
|
|
||||||
drop table t1;
|
|
@@ -23,7 +23,6 @@ Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
|||||||
Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
||||||
Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
||||||
Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
||||||
Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
|
||||||
SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ROCKSDB';
|
SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ROCKSDB';
|
||||||
ENGINE SUPPORT
|
ENGINE SUPPORT
|
||||||
ROCKSDB NO
|
ROCKSDB NO
|
||||||
|
@@ -83,7 +83,6 @@ ROCKSDB_INDEX_FILE_MAP Stable
|
|||||||
ROCKSDB_LOCKS Stable
|
ROCKSDB_LOCKS Stable
|
||||||
ROCKSDB_TRX Stable
|
ROCKSDB_TRX Stable
|
||||||
ROCKSDB_DEADLOCK Stable
|
ROCKSDB_DEADLOCK Stable
|
||||||
ROCKSDB_LIVE_FILES_METADATA Stable
|
|
||||||
#
|
#
|
||||||
# MDEV-12466 : Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || ...
|
# MDEV-12466 : Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || ...
|
||||||
#
|
#
|
||||||
|
@@ -1,112 +0,0 @@
|
|||||||
create table t1 (id1 bigint, id2 bigint, c1 bigint, c2 bigint, c3 bigint, c4 bigint, c5 bigint, c6 bigint, c7 bigint, primary key (id1, id2), index i(c1, c2));
|
|
||||||
begin;
|
|
||||||
select * from t1 where c3=1 for update;
|
|
||||||
id1 id2 c1 c2 c3 c4 c5 c6 c7
|
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS;
|
|
||||||
Type Name Status
|
|
||||||
rocksdb
|
|
||||||
============================================================
|
|
||||||
TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
|
|
||||||
============================================================
|
|
||||||
---------
|
|
||||||
SNAPSHOTS
|
|
||||||
---------
|
|
||||||
LIST OF SNAPSHOTS FOR EACH SESSION:
|
|
||||||
---SNAPSHOT, ACTIVE NUM sec
|
|
||||||
MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION
|
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS
|
|
||||||
lock count 0, write count 0
|
|
||||||
insert count 0, update count 0, delete count 0
|
|
||||||
----------LATEST DETECTED DEADLOCKS----------
|
|
||||||
-----------------------------------------
|
|
||||||
END OF ROCKSDB TRANSACTION MONITOR OUTPUT
|
|
||||||
=========================================
|
|
||||||
|
|
||||||
select * from t1 where c7 between 101 and 110 for update;
|
|
||||||
id1 id2 c1 c2 c3 c4 c5 c6 c7
|
|
||||||
101 0 101 0 0 0 0 0 101
|
|
||||||
102 0 102 0 0 0 0 0 102
|
|
||||||
103 0 103 0 0 0 0 0 103
|
|
||||||
104 0 104 0 0 0 0 0 104
|
|
||||||
105 0 105 0 0 0 0 0 105
|
|
||||||
106 0 106 0 0 0 0 0 106
|
|
||||||
107 0 107 0 0 0 0 0 107
|
|
||||||
108 0 108 0 0 0 0 0 108
|
|
||||||
109 0 109 0 0 0 0 0 109
|
|
||||||
110 0 110 0 0 0 0 0 110
|
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS;
|
|
||||||
Type Name Status
|
|
||||||
rocksdb
|
|
||||||
============================================================
|
|
||||||
TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
|
|
||||||
============================================================
|
|
||||||
---------
|
|
||||||
SNAPSHOTS
|
|
||||||
---------
|
|
||||||
LIST OF SNAPSHOTS FOR EACH SESSION:
|
|
||||||
---SNAPSHOT, ACTIVE NUM sec
|
|
||||||
MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION
|
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS
|
|
||||||
lock count 10, write count 0
|
|
||||||
insert count 0, update count 0, delete count 0
|
|
||||||
----------LATEST DETECTED DEADLOCKS----------
|
|
||||||
-----------------------------------------
|
|
||||||
END OF ROCKSDB TRANSACTION MONITOR OUTPUT
|
|
||||||
=========================================
|
|
||||||
|
|
||||||
rollback;
|
|
||||||
set session rocksdb_lock_scanned_rows=on;
|
|
||||||
begin;
|
|
||||||
select * from t1 where c3=1 for update;
|
|
||||||
id1 id2 c1 c2 c3 c4 c5 c6 c7
|
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS;
|
|
||||||
Type Name Status
|
|
||||||
rocksdb
|
|
||||||
============================================================
|
|
||||||
TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
|
|
||||||
============================================================
|
|
||||||
---------
|
|
||||||
SNAPSHOTS
|
|
||||||
---------
|
|
||||||
LIST OF SNAPSHOTS FOR EACH SESSION:
|
|
||||||
---SNAPSHOT, ACTIVE NUM sec
|
|
||||||
MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION
|
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS
|
|
||||||
lock count 1000, write count 0
|
|
||||||
insert count 0, update count 0, delete count 0
|
|
||||||
----------LATEST DETECTED DEADLOCKS----------
|
|
||||||
-----------------------------------------
|
|
||||||
END OF ROCKSDB TRANSACTION MONITOR OUTPUT
|
|
||||||
=========================================
|
|
||||||
|
|
||||||
rollback;
|
|
||||||
set session rocksdb_lock_scanned_rows=off;
|
|
||||||
SET @start_rocksdb_max_row_locks = @@global.rocksdb_max_row_locks;
|
|
||||||
set global rocksdb_max_row_locks = 20;
|
|
||||||
select * from t1 where c3=1 for update;
|
|
||||||
id1 id2 c1 c2 c3 c4 c5 c6 c7
|
|
||||||
select * from t1 where c7 between 101 and 110 for update;
|
|
||||||
id1 id2 c1 c2 c3 c4 c5 c6 c7
|
|
||||||
101 0 101 0 0 0 0 0 101
|
|
||||||
102 0 102 0 0 0 0 0 102
|
|
||||||
103 0 103 0 0 0 0 0 103
|
|
||||||
104 0 104 0 0 0 0 0 104
|
|
||||||
105 0 105 0 0 0 0 0 105
|
|
||||||
106 0 106 0 0 0 0 0 106
|
|
||||||
107 0 107 0 0 0 0 0 107
|
|
||||||
108 0 108 0 0 0 0 0 108
|
|
||||||
109 0 109 0 0 0 0 0 109
|
|
||||||
110 0 110 0 0 0 0 0 110
|
|
||||||
set global rocksdb_max_row_locks = 5;
|
|
||||||
select * from t1 where c3=1 for update;
|
|
||||||
id1 id2 c1 c2 c3 c4 c5 c6 c7
|
|
||||||
select * from t1 where c7 between 101 and 110 for update;
|
|
||||||
ERROR HY000: Got error 10 'Operation aborted: Failed to acquire lock due to rocksdb_max_row_locks limit' from ROCKSDB
|
|
||||||
set session rocksdb_lock_scanned_rows=on;
|
|
||||||
select * from t1 where c3=1 for update;
|
|
||||||
ERROR HY000: Got error 10 'Operation aborted: Failed to acquire lock due to rocksdb_max_row_locks limit' from ROCKSDB
|
|
||||||
select * from t1 where c7 between 101 and 110 for update;
|
|
||||||
ERROR HY000: Got error 10 'Operation aborted: Failed to acquire lock due to rocksdb_max_row_locks limit' from ROCKSDB
|
|
||||||
set session rocksdb_lock_scanned_rows=off;
|
|
||||||
set @@global.rocksdb_max_row_locks = @start_rocksdb_max_row_locks;
|
|
||||||
drop table t1;
|
|
@@ -161,6 +161,10 @@ BEGIN;
|
|||||||
INSERT INTO t2 VALUES (1), (2);
|
INSERT INTO t2 VALUES (1), (2);
|
||||||
INSERT INTO t2 VALUES (3), (4);
|
INSERT INTO t2 VALUES (3), (4);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
SELECT COUNT(*) from INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT
|
||||||
|
WHERE TABLE_NAME = 't2'
|
||||||
|
AND STAT_TYPE = 'IO_WRITE_NANOS'
|
||||||
|
AND VALUE > 0;
|
||||||
COUNT(*)
|
COUNT(*)
|
||||||
0
|
0
|
||||||
SELECT COUNT(*) from INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT_GLOBAL
|
SELECT COUNT(*) from INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT_GLOBAL
|
||||||
|
@@ -888,7 +888,6 @@ rocksdb_cache_dump ON
|
|||||||
rocksdb_cache_high_pri_pool_ratio 0.000000
|
rocksdb_cache_high_pri_pool_ratio 0.000000
|
||||||
rocksdb_cache_index_and_filter_blocks ON
|
rocksdb_cache_index_and_filter_blocks ON
|
||||||
rocksdb_cache_index_and_filter_with_high_priority ON
|
rocksdb_cache_index_and_filter_with_high_priority ON
|
||||||
rocksdb_cancel_manual_compactions OFF
|
|
||||||
rocksdb_checksums_pct 100
|
rocksdb_checksums_pct 100
|
||||||
rocksdb_collect_sst_properties ON
|
rocksdb_collect_sst_properties ON
|
||||||
rocksdb_commit_in_the_middle OFF
|
rocksdb_commit_in_the_middle OFF
|
||||||
@@ -919,9 +918,6 @@ rocksdb_delete_obsolete_files_period_micros 21600000000
|
|||||||
rocksdb_enable_2pc ON
|
rocksdb_enable_2pc ON
|
||||||
rocksdb_enable_bulk_load_api ON
|
rocksdb_enable_bulk_load_api ON
|
||||||
rocksdb_enable_insert_with_update_caching ON
|
rocksdb_enable_insert_with_update_caching ON
|
||||||
rocksdb_enable_iterate_bounds ON
|
|
||||||
rocksdb_enable_pipelined_write OFF
|
|
||||||
rocksdb_enable_remove_orphaned_dropped_cfs ON
|
|
||||||
rocksdb_enable_thread_tracking ON
|
rocksdb_enable_thread_tracking ON
|
||||||
rocksdb_enable_ttl ON
|
rocksdb_enable_ttl ON
|
||||||
rocksdb_enable_ttl_read_filtering ON
|
rocksdb_enable_ttl_read_filtering ON
|
||||||
@@ -949,14 +945,10 @@ rocksdb_lock_wait_timeout 1
|
|||||||
rocksdb_log_dir
|
rocksdb_log_dir
|
||||||
rocksdb_log_file_time_to_roll 0
|
rocksdb_log_file_time_to_roll 0
|
||||||
rocksdb_manifest_preallocation_size 4194304
|
rocksdb_manifest_preallocation_size 4194304
|
||||||
rocksdb_manual_compaction_bottommost_level kForceOptimized
|
|
||||||
rocksdb_manual_compaction_threads 0
|
rocksdb_manual_compaction_threads 0
|
||||||
rocksdb_manual_wal_flush ON
|
rocksdb_manual_wal_flush ON
|
||||||
rocksdb_master_skip_tx_api OFF
|
rocksdb_master_skip_tx_api OFF
|
||||||
rocksdb_max_background_compactions -1
|
|
||||||
rocksdb_max_background_flushes -1
|
|
||||||
rocksdb_max_background_jobs 2
|
rocksdb_max_background_jobs 2
|
||||||
rocksdb_max_bottom_pri_background_compactions 0
|
|
||||||
rocksdb_max_latest_deadlocks 5
|
rocksdb_max_latest_deadlocks 5
|
||||||
rocksdb_max_log_file_size 0
|
rocksdb_max_log_file_size 0
|
||||||
rocksdb_max_manifest_file_size 1073741824
|
rocksdb_max_manifest_file_size 1073741824
|
||||||
@@ -987,11 +979,10 @@ rocksdb_signal_drop_index_thread OFF
|
|||||||
rocksdb_sim_cache_size 0
|
rocksdb_sim_cache_size 0
|
||||||
rocksdb_skip_bloom_filter_on_read OFF
|
rocksdb_skip_bloom_filter_on_read OFF
|
||||||
rocksdb_skip_fill_cache OFF
|
rocksdb_skip_fill_cache OFF
|
||||||
rocksdb_skip_locks_if_skip_unique_check OFF
|
|
||||||
rocksdb_skip_unique_check_tables .*
|
rocksdb_skip_unique_check_tables .*
|
||||||
rocksdb_sst_mgr_rate_bytes_per_sec 0
|
rocksdb_sst_mgr_rate_bytes_per_sec 0
|
||||||
rocksdb_stats_dump_period_sec 600
|
rocksdb_stats_dump_period_sec 600
|
||||||
rocksdb_stats_level 1
|
rocksdb_stats_level 0
|
||||||
rocksdb_stats_recalc_rate 0
|
rocksdb_stats_recalc_rate 0
|
||||||
rocksdb_store_row_debug_checksums OFF
|
rocksdb_store_row_debug_checksums OFF
|
||||||
rocksdb_strict_collation_check OFF
|
rocksdb_strict_collation_check OFF
|
||||||
@@ -1000,7 +991,6 @@ rocksdb_table_cache_numshardbits 6
|
|||||||
rocksdb_table_stats_sampling_pct 10
|
rocksdb_table_stats_sampling_pct 10
|
||||||
rocksdb_tmpdir
|
rocksdb_tmpdir
|
||||||
rocksdb_trace_sst_api OFF
|
rocksdb_trace_sst_api OFF
|
||||||
rocksdb_track_and_verify_wals_in_manifest ON
|
|
||||||
rocksdb_two_write_queues ON
|
rocksdb_two_write_queues ON
|
||||||
rocksdb_unsafe_for_binlog OFF
|
rocksdb_unsafe_for_binlog OFF
|
||||||
rocksdb_update_cf_options
|
rocksdb_update_cf_options
|
||||||
@@ -1013,11 +1003,10 @@ rocksdb_validate_tables 1
|
|||||||
rocksdb_verify_row_debug_checksums OFF
|
rocksdb_verify_row_debug_checksums OFF
|
||||||
rocksdb_wal_bytes_per_sync 0
|
rocksdb_wal_bytes_per_sync 0
|
||||||
rocksdb_wal_dir
|
rocksdb_wal_dir
|
||||||
rocksdb_wal_recovery_mode 2
|
rocksdb_wal_recovery_mode 1
|
||||||
rocksdb_wal_size_limit_mb 0
|
rocksdb_wal_size_limit_mb 0
|
||||||
rocksdb_wal_ttl_seconds 0
|
rocksdb_wal_ttl_seconds 0
|
||||||
rocksdb_whole_key_filtering ON
|
rocksdb_whole_key_filtering ON
|
||||||
rocksdb_write_batch_flush_threshold 0
|
|
||||||
rocksdb_write_batch_max_bytes 0
|
rocksdb_write_batch_max_bytes 0
|
||||||
rocksdb_write_disable_wal OFF
|
rocksdb_write_disable_wal OFF
|
||||||
rocksdb_write_ignore_missing_column_families OFF
|
rocksdb_write_ignore_missing_column_families OFF
|
||||||
@@ -1376,10 +1365,9 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, a int) ENGINE=RocksDB;
|
|||||||
set @a=-1;
|
set @a=-1;
|
||||||
insert into t1 select (@a:=@a+1), 1234 from information_schema.session_variables limit 100;
|
insert into t1 select (@a:=@a+1), 1234 from information_schema.session_variables limit 100;
|
||||||
set @tmp1= @@rocksdb_max_row_locks;
|
set @tmp1= @@rocksdb_max_row_locks;
|
||||||
set GLOBAL rocksdb_max_row_locks= 20;
|
set rocksdb_max_row_locks= 20;
|
||||||
update t1 set a=a+10;
|
update t1 set a=a+10;
|
||||||
ERROR HY000: Got error 10 'Operation aborted: Failed to acquire lock due to rocksdb_max_row_locks limit' from ROCKSDB
|
ERROR HY000: Got error 10 'Operation aborted: Failed to acquire lock due to rocksdb_max_row_locks limit' from ROCKSDB
|
||||||
set @@global.rocksdb_max_row_locks = @tmp1;
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
#
|
#
|
||||||
# Test AUTO_INCREMENT behavior problem,
|
# Test AUTO_INCREMENT behavior problem,
|
||||||
@@ -1512,15 +1500,19 @@ Rocksdb_block_cache_data_bytes_insert #
|
|||||||
Rocksdb_block_cache_data_hit #
|
Rocksdb_block_cache_data_hit #
|
||||||
Rocksdb_block_cache_data_miss #
|
Rocksdb_block_cache_data_miss #
|
||||||
Rocksdb_block_cache_filter_add #
|
Rocksdb_block_cache_filter_add #
|
||||||
|
Rocksdb_block_cache_filter_bytes_evict #
|
||||||
Rocksdb_block_cache_filter_bytes_insert #
|
Rocksdb_block_cache_filter_bytes_insert #
|
||||||
Rocksdb_block_cache_filter_hit #
|
Rocksdb_block_cache_filter_hit #
|
||||||
Rocksdb_block_cache_filter_miss #
|
Rocksdb_block_cache_filter_miss #
|
||||||
Rocksdb_block_cache_hit #
|
Rocksdb_block_cache_hit #
|
||||||
Rocksdb_block_cache_index_add #
|
Rocksdb_block_cache_index_add #
|
||||||
|
Rocksdb_block_cache_index_bytes_evict #
|
||||||
Rocksdb_block_cache_index_bytes_insert #
|
Rocksdb_block_cache_index_bytes_insert #
|
||||||
Rocksdb_block_cache_index_hit #
|
Rocksdb_block_cache_index_hit #
|
||||||
Rocksdb_block_cache_index_miss #
|
Rocksdb_block_cache_index_miss #
|
||||||
Rocksdb_block_cache_miss #
|
Rocksdb_block_cache_miss #
|
||||||
|
Rocksdb_block_cachecompressed_hit #
|
||||||
|
Rocksdb_block_cachecompressed_miss #
|
||||||
Rocksdb_bloom_filter_full_positive #
|
Rocksdb_bloom_filter_full_positive #
|
||||||
Rocksdb_bloom_filter_full_true_positive #
|
Rocksdb_bloom_filter_full_true_positive #
|
||||||
Rocksdb_bloom_filter_prefix_checked #
|
Rocksdb_bloom_filter_prefix_checked #
|
||||||
@@ -1539,14 +1531,14 @@ Rocksdb_get_hit_l1 #
|
|||||||
Rocksdb_get_hit_l2_and_up #
|
Rocksdb_get_hit_l2_and_up #
|
||||||
Rocksdb_getupdatessince_calls #
|
Rocksdb_getupdatessince_calls #
|
||||||
Rocksdb_iter_bytes_read #
|
Rocksdb_iter_bytes_read #
|
||||||
Rocksdb_manual_compactions_cancelled #
|
|
||||||
Rocksdb_manual_compactions_pending #
|
|
||||||
Rocksdb_manual_compactions_processed #
|
Rocksdb_manual_compactions_processed #
|
||||||
Rocksdb_manual_compactions_running #
|
Rocksdb_manual_compactions_running #
|
||||||
Rocksdb_memtable_hit #
|
Rocksdb_memtable_hit #
|
||||||
Rocksdb_memtable_miss #
|
Rocksdb_memtable_miss #
|
||||||
|
Rocksdb_no_file_closes #
|
||||||
Rocksdb_no_file_errors #
|
Rocksdb_no_file_errors #
|
||||||
Rocksdb_no_file_opens #
|
Rocksdb_no_file_opens #
|
||||||
|
Rocksdb_num_iterators #
|
||||||
Rocksdb_number_block_not_compressed #
|
Rocksdb_number_block_not_compressed #
|
||||||
Rocksdb_number_db_next #
|
Rocksdb_number_db_next #
|
||||||
Rocksdb_number_db_next_found #
|
Rocksdb_number_db_next_found #
|
||||||
@@ -1554,6 +1546,7 @@ Rocksdb_number_db_prev #
|
|||||||
Rocksdb_number_db_prev_found #
|
Rocksdb_number_db_prev_found #
|
||||||
Rocksdb_number_db_seek #
|
Rocksdb_number_db_seek #
|
||||||
Rocksdb_number_db_seek_found #
|
Rocksdb_number_db_seek_found #
|
||||||
|
Rocksdb_number_deletes_filtered #
|
||||||
Rocksdb_number_keys_read #
|
Rocksdb_number_keys_read #
|
||||||
Rocksdb_number_keys_updated #
|
Rocksdb_number_keys_updated #
|
||||||
Rocksdb_number_keys_written #
|
Rocksdb_number_keys_written #
|
||||||
@@ -1589,6 +1582,7 @@ Rocksdb_wal_group_syncs #
|
|||||||
Rocksdb_wal_synced #
|
Rocksdb_wal_synced #
|
||||||
Rocksdb_write_other #
|
Rocksdb_write_other #
|
||||||
Rocksdb_write_self #
|
Rocksdb_write_self #
|
||||||
|
Rocksdb_write_timedout #
|
||||||
Rocksdb_write_wal #
|
Rocksdb_write_wal #
|
||||||
select VARIABLE_NAME from INFORMATION_SCHEMA.global_status where VARIABLE_NAME LIKE 'rocksdb%' and VARIABLE_NAME NOT LIKE '%num_get_for_update%';
|
select VARIABLE_NAME from INFORMATION_SCHEMA.global_status where VARIABLE_NAME LIKE 'rocksdb%' and VARIABLE_NAME NOT LIKE '%num_get_for_update%';
|
||||||
VARIABLE_NAME
|
VARIABLE_NAME
|
||||||
@@ -1617,15 +1611,19 @@ ROCKSDB_BLOCK_CACHE_DATA_BYTES_INSERT
|
|||||||
ROCKSDB_BLOCK_CACHE_DATA_HIT
|
ROCKSDB_BLOCK_CACHE_DATA_HIT
|
||||||
ROCKSDB_BLOCK_CACHE_DATA_MISS
|
ROCKSDB_BLOCK_CACHE_DATA_MISS
|
||||||
ROCKSDB_BLOCK_CACHE_FILTER_ADD
|
ROCKSDB_BLOCK_CACHE_FILTER_ADD
|
||||||
|
ROCKSDB_BLOCK_CACHE_FILTER_BYTES_EVICT
|
||||||
ROCKSDB_BLOCK_CACHE_FILTER_BYTES_INSERT
|
ROCKSDB_BLOCK_CACHE_FILTER_BYTES_INSERT
|
||||||
ROCKSDB_BLOCK_CACHE_FILTER_HIT
|
ROCKSDB_BLOCK_CACHE_FILTER_HIT
|
||||||
ROCKSDB_BLOCK_CACHE_FILTER_MISS
|
ROCKSDB_BLOCK_CACHE_FILTER_MISS
|
||||||
ROCKSDB_BLOCK_CACHE_HIT
|
ROCKSDB_BLOCK_CACHE_HIT
|
||||||
ROCKSDB_BLOCK_CACHE_INDEX_ADD
|
ROCKSDB_BLOCK_CACHE_INDEX_ADD
|
||||||
|
ROCKSDB_BLOCK_CACHE_INDEX_BYTES_EVICT
|
||||||
ROCKSDB_BLOCK_CACHE_INDEX_BYTES_INSERT
|
ROCKSDB_BLOCK_CACHE_INDEX_BYTES_INSERT
|
||||||
ROCKSDB_BLOCK_CACHE_INDEX_HIT
|
ROCKSDB_BLOCK_CACHE_INDEX_HIT
|
||||||
ROCKSDB_BLOCK_CACHE_INDEX_MISS
|
ROCKSDB_BLOCK_CACHE_INDEX_MISS
|
||||||
ROCKSDB_BLOCK_CACHE_MISS
|
ROCKSDB_BLOCK_CACHE_MISS
|
||||||
|
ROCKSDB_BLOCK_CACHECOMPRESSED_HIT
|
||||||
|
ROCKSDB_BLOCK_CACHECOMPRESSED_MISS
|
||||||
ROCKSDB_BLOOM_FILTER_FULL_POSITIVE
|
ROCKSDB_BLOOM_FILTER_FULL_POSITIVE
|
||||||
ROCKSDB_BLOOM_FILTER_FULL_TRUE_POSITIVE
|
ROCKSDB_BLOOM_FILTER_FULL_TRUE_POSITIVE
|
||||||
ROCKSDB_BLOOM_FILTER_PREFIX_CHECKED
|
ROCKSDB_BLOOM_FILTER_PREFIX_CHECKED
|
||||||
@@ -1644,14 +1642,14 @@ ROCKSDB_GET_HIT_L1
|
|||||||
ROCKSDB_GET_HIT_L2_AND_UP
|
ROCKSDB_GET_HIT_L2_AND_UP
|
||||||
ROCKSDB_GETUPDATESSINCE_CALLS
|
ROCKSDB_GETUPDATESSINCE_CALLS
|
||||||
ROCKSDB_ITER_BYTES_READ
|
ROCKSDB_ITER_BYTES_READ
|
||||||
ROCKSDB_MANUAL_COMPACTIONS_CANCELLED
|
|
||||||
ROCKSDB_MANUAL_COMPACTIONS_PENDING
|
|
||||||
ROCKSDB_MANUAL_COMPACTIONS_PROCESSED
|
ROCKSDB_MANUAL_COMPACTIONS_PROCESSED
|
||||||
ROCKSDB_MANUAL_COMPACTIONS_RUNNING
|
ROCKSDB_MANUAL_COMPACTIONS_RUNNING
|
||||||
ROCKSDB_MEMTABLE_HIT
|
ROCKSDB_MEMTABLE_HIT
|
||||||
ROCKSDB_MEMTABLE_MISS
|
ROCKSDB_MEMTABLE_MISS
|
||||||
|
ROCKSDB_NO_FILE_CLOSES
|
||||||
ROCKSDB_NO_FILE_ERRORS
|
ROCKSDB_NO_FILE_ERRORS
|
||||||
ROCKSDB_NO_FILE_OPENS
|
ROCKSDB_NO_FILE_OPENS
|
||||||
|
ROCKSDB_NUM_ITERATORS
|
||||||
ROCKSDB_NUMBER_BLOCK_NOT_COMPRESSED
|
ROCKSDB_NUMBER_BLOCK_NOT_COMPRESSED
|
||||||
ROCKSDB_NUMBER_DB_NEXT
|
ROCKSDB_NUMBER_DB_NEXT
|
||||||
ROCKSDB_NUMBER_DB_NEXT_FOUND
|
ROCKSDB_NUMBER_DB_NEXT_FOUND
|
||||||
@@ -1659,6 +1657,7 @@ ROCKSDB_NUMBER_DB_PREV
|
|||||||
ROCKSDB_NUMBER_DB_PREV_FOUND
|
ROCKSDB_NUMBER_DB_PREV_FOUND
|
||||||
ROCKSDB_NUMBER_DB_SEEK
|
ROCKSDB_NUMBER_DB_SEEK
|
||||||
ROCKSDB_NUMBER_DB_SEEK_FOUND
|
ROCKSDB_NUMBER_DB_SEEK_FOUND
|
||||||
|
ROCKSDB_NUMBER_DELETES_FILTERED
|
||||||
ROCKSDB_NUMBER_KEYS_READ
|
ROCKSDB_NUMBER_KEYS_READ
|
||||||
ROCKSDB_NUMBER_KEYS_UPDATED
|
ROCKSDB_NUMBER_KEYS_UPDATED
|
||||||
ROCKSDB_NUMBER_KEYS_WRITTEN
|
ROCKSDB_NUMBER_KEYS_WRITTEN
|
||||||
@@ -1694,6 +1693,7 @@ ROCKSDB_WAL_GROUP_SYNCS
|
|||||||
ROCKSDB_WAL_SYNCED
|
ROCKSDB_WAL_SYNCED
|
||||||
ROCKSDB_WRITE_OTHER
|
ROCKSDB_WRITE_OTHER
|
||||||
ROCKSDB_WRITE_SELF
|
ROCKSDB_WRITE_SELF
|
||||||
|
ROCKSDB_WRITE_TIMEDOUT
|
||||||
ROCKSDB_WRITE_WAL
|
ROCKSDB_WRITE_WAL
|
||||||
# RocksDB-SE's status variables are global internally
|
# RocksDB-SE's status variables are global internally
|
||||||
# but they are shown as both session and global, like InnoDB's status vars.
|
# but they are shown as both session and global, like InnoDB's status vars.
|
||||||
@@ -1724,15 +1724,19 @@ ROCKSDB_BLOCK_CACHE_DATA_BYTES_INSERT
|
|||||||
ROCKSDB_BLOCK_CACHE_DATA_HIT
|
ROCKSDB_BLOCK_CACHE_DATA_HIT
|
||||||
ROCKSDB_BLOCK_CACHE_DATA_MISS
|
ROCKSDB_BLOCK_CACHE_DATA_MISS
|
||||||
ROCKSDB_BLOCK_CACHE_FILTER_ADD
|
ROCKSDB_BLOCK_CACHE_FILTER_ADD
|
||||||
|
ROCKSDB_BLOCK_CACHE_FILTER_BYTES_EVICT
|
||||||
ROCKSDB_BLOCK_CACHE_FILTER_BYTES_INSERT
|
ROCKSDB_BLOCK_CACHE_FILTER_BYTES_INSERT
|
||||||
ROCKSDB_BLOCK_CACHE_FILTER_HIT
|
ROCKSDB_BLOCK_CACHE_FILTER_HIT
|
||||||
ROCKSDB_BLOCK_CACHE_FILTER_MISS
|
ROCKSDB_BLOCK_CACHE_FILTER_MISS
|
||||||
ROCKSDB_BLOCK_CACHE_HIT
|
ROCKSDB_BLOCK_CACHE_HIT
|
||||||
ROCKSDB_BLOCK_CACHE_INDEX_ADD
|
ROCKSDB_BLOCK_CACHE_INDEX_ADD
|
||||||
|
ROCKSDB_BLOCK_CACHE_INDEX_BYTES_EVICT
|
||||||
ROCKSDB_BLOCK_CACHE_INDEX_BYTES_INSERT
|
ROCKSDB_BLOCK_CACHE_INDEX_BYTES_INSERT
|
||||||
ROCKSDB_BLOCK_CACHE_INDEX_HIT
|
ROCKSDB_BLOCK_CACHE_INDEX_HIT
|
||||||
ROCKSDB_BLOCK_CACHE_INDEX_MISS
|
ROCKSDB_BLOCK_CACHE_INDEX_MISS
|
||||||
ROCKSDB_BLOCK_CACHE_MISS
|
ROCKSDB_BLOCK_CACHE_MISS
|
||||||
|
ROCKSDB_BLOCK_CACHECOMPRESSED_HIT
|
||||||
|
ROCKSDB_BLOCK_CACHECOMPRESSED_MISS
|
||||||
ROCKSDB_BLOOM_FILTER_FULL_POSITIVE
|
ROCKSDB_BLOOM_FILTER_FULL_POSITIVE
|
||||||
ROCKSDB_BLOOM_FILTER_FULL_TRUE_POSITIVE
|
ROCKSDB_BLOOM_FILTER_FULL_TRUE_POSITIVE
|
||||||
ROCKSDB_BLOOM_FILTER_PREFIX_CHECKED
|
ROCKSDB_BLOOM_FILTER_PREFIX_CHECKED
|
||||||
@@ -1751,14 +1755,14 @@ ROCKSDB_GET_HIT_L1
|
|||||||
ROCKSDB_GET_HIT_L2_AND_UP
|
ROCKSDB_GET_HIT_L2_AND_UP
|
||||||
ROCKSDB_GETUPDATESSINCE_CALLS
|
ROCKSDB_GETUPDATESSINCE_CALLS
|
||||||
ROCKSDB_ITER_BYTES_READ
|
ROCKSDB_ITER_BYTES_READ
|
||||||
ROCKSDB_MANUAL_COMPACTIONS_CANCELLED
|
|
||||||
ROCKSDB_MANUAL_COMPACTIONS_PENDING
|
|
||||||
ROCKSDB_MANUAL_COMPACTIONS_PROCESSED
|
ROCKSDB_MANUAL_COMPACTIONS_PROCESSED
|
||||||
ROCKSDB_MANUAL_COMPACTIONS_RUNNING
|
ROCKSDB_MANUAL_COMPACTIONS_RUNNING
|
||||||
ROCKSDB_MEMTABLE_HIT
|
ROCKSDB_MEMTABLE_HIT
|
||||||
ROCKSDB_MEMTABLE_MISS
|
ROCKSDB_MEMTABLE_MISS
|
||||||
|
ROCKSDB_NO_FILE_CLOSES
|
||||||
ROCKSDB_NO_FILE_ERRORS
|
ROCKSDB_NO_FILE_ERRORS
|
||||||
ROCKSDB_NO_FILE_OPENS
|
ROCKSDB_NO_FILE_OPENS
|
||||||
|
ROCKSDB_NUM_ITERATORS
|
||||||
ROCKSDB_NUMBER_BLOCK_NOT_COMPRESSED
|
ROCKSDB_NUMBER_BLOCK_NOT_COMPRESSED
|
||||||
ROCKSDB_NUMBER_DB_NEXT
|
ROCKSDB_NUMBER_DB_NEXT
|
||||||
ROCKSDB_NUMBER_DB_NEXT_FOUND
|
ROCKSDB_NUMBER_DB_NEXT_FOUND
|
||||||
@@ -1766,6 +1770,7 @@ ROCKSDB_NUMBER_DB_PREV
|
|||||||
ROCKSDB_NUMBER_DB_PREV_FOUND
|
ROCKSDB_NUMBER_DB_PREV_FOUND
|
||||||
ROCKSDB_NUMBER_DB_SEEK
|
ROCKSDB_NUMBER_DB_SEEK
|
||||||
ROCKSDB_NUMBER_DB_SEEK_FOUND
|
ROCKSDB_NUMBER_DB_SEEK_FOUND
|
||||||
|
ROCKSDB_NUMBER_DELETES_FILTERED
|
||||||
ROCKSDB_NUMBER_KEYS_READ
|
ROCKSDB_NUMBER_KEYS_READ
|
||||||
ROCKSDB_NUMBER_KEYS_UPDATED
|
ROCKSDB_NUMBER_KEYS_UPDATED
|
||||||
ROCKSDB_NUMBER_KEYS_WRITTEN
|
ROCKSDB_NUMBER_KEYS_WRITTEN
|
||||||
@@ -1801,6 +1806,7 @@ ROCKSDB_WAL_GROUP_SYNCS
|
|||||||
ROCKSDB_WAL_SYNCED
|
ROCKSDB_WAL_SYNCED
|
||||||
ROCKSDB_WRITE_OTHER
|
ROCKSDB_WRITE_OTHER
|
||||||
ROCKSDB_WRITE_SELF
|
ROCKSDB_WRITE_SELF
|
||||||
|
ROCKSDB_WRITE_TIMEDOUT
|
||||||
ROCKSDB_WRITE_WAL
|
ROCKSDB_WRITE_WAL
|
||||||
#
|
#
|
||||||
# Fix issue #9: HA_ERR_INTERNAL_ERROR when running linkbench
|
# Fix issue #9: HA_ERR_INTERNAL_ERROR when running linkbench
|
||||||
|
@@ -1,15 +0,0 @@
|
|||||||
1
|
|
||||||
DROP TABLE IF EXISTS t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a int not null,
|
|
||||||
b int not null,
|
|
||||||
primary key (a,b),
|
|
||||||
key (b)
|
|
||||||
) ENGINE=RocksDB;
|
|
||||||
DELETE FROM t1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
Bottom thread priority:
|
|
||||||
19
|
|
||||||
Bottom thread counts:
|
|
||||||
1
|
|
||||||
drop table t1;
|
|
@@ -1,16 +0,0 @@
|
|||||||
1
|
|
||||||
Bottom thread counts:
|
|
||||||
5
|
|
||||||
"Increasing bottom pri compaction threads online."
|
|
||||||
SET GLOBAL rocksdb_max_bottom_pri_background_compactions=10;
|
|
||||||
1
|
|
||||||
Bottom thread counts:
|
|
||||||
10
|
|
||||||
"Decreasing bottom pri compaction threads online."
|
|
||||||
SET GLOBAL rocksdb_max_bottom_pri_background_compactions=2;
|
|
||||||
1
|
|
||||||
Bottom thread counts:
|
|
||||||
2
|
|
||||||
SET GLOBAL rocksdb_max_bottom_pri_background_compactions=0;
|
|
||||||
ERROR HY000: Error when executing command SET: max_bottom_pri_background_compactions can't be changed to 0 online.
|
|
||||||
SET GLOBAL rocksdb_max_bottom_pri_background_compactions=5;
|
|
@@ -1,2 +1,2 @@
|
|||||||
Check for MANIFEST files
|
Check for MANIFEST files
|
||||||
MANIFEST-000005
|
MANIFEST-000006
|
||||||
|
@@ -55,6 +55,7 @@ select * from t;
|
|||||||
i
|
i
|
||||||
rollback;
|
rollback;
|
||||||
connection con2;
|
connection con2;
|
||||||
|
i
|
||||||
rollback;
|
rollback;
|
||||||
connection con1;
|
connection con1;
|
||||||
i
|
i
|
||||||
|
@@ -55,6 +55,7 @@ select * from t;
|
|||||||
i
|
i
|
||||||
rollback;
|
rollback;
|
||||||
connection con2;
|
connection con2;
|
||||||
|
i
|
||||||
rollback;
|
rollback;
|
||||||
connection con1;
|
connection con1;
|
||||||
i
|
i
|
||||||
|
@@ -1,114 +0,0 @@
|
|||||||
CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO valid_values VALUES('kSkip');
|
|
||||||
INSERT INTO valid_values VALUES('kIfHaveCompactionFilter');
|
|
||||||
INSERT INTO valid_values VALUES('kForce');
|
|
||||||
INSERT INTO valid_values VALUES('kForceOptimized');
|
|
||||||
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO invalid_values VALUES('\'aaa\'');
|
|
||||||
SET @start_global_value = @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
SELECT @start_global_value;
|
|
||||||
@start_global_value
|
|
||||||
kForceOptimized
|
|
||||||
SET @start_session_value = @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
SELECT @start_session_value;
|
|
||||||
@start_session_value
|
|
||||||
kForceOptimized
|
|
||||||
'# Setting to valid values in global scope#'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kSkip"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kSkip;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kSkip
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kIfHaveCompactionFilter"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kIfHaveCompactionFilter;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kIfHaveCompactionFilter
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kForce"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kForce;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForce
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kForceOptimized"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kForceOptimized;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
'# Setting to valid values in session scope#'
|
|
||||||
"Trying to set variable @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kSkip"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kSkip;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kSkip
|
|
||||||
"Setting the session scope variable back to default"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Trying to set variable @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kIfHaveCompactionFilter"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kIfHaveCompactionFilter;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kIfHaveCompactionFilter
|
|
||||||
"Setting the session scope variable back to default"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Trying to set variable @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kForce"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kForce;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForce
|
|
||||||
"Setting the session scope variable back to default"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Trying to set variable @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kForceOptimized"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kForceOptimized;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Setting the session scope variable back to default"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
'# Testing with invalid values in global scope #'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to 'aaa'"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = 'aaa';
|
|
||||||
Got one of the listed errors
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = @start_global_value;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = @start_session_value;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
DROP TABLE valid_values;
|
|
||||||
DROP TABLE invalid_values;
|
|
@@ -45,15 +45,6 @@ __system__ NUM_ENTRIES_ACTIVE_MEM_TABLE #
|
|||||||
__system__ NUM_ENTRIES_IMM_MEM_TABLES #
|
__system__ NUM_ENTRIES_IMM_MEM_TABLES #
|
||||||
__system__ NON_BLOCK_CACHE_SST_MEM_USAGE #
|
__system__ NON_BLOCK_CACHE_SST_MEM_USAGE #
|
||||||
__system__ NUM_LIVE_VERSIONS #
|
__system__ NUM_LIVE_VERSIONS #
|
||||||
__system__ NUM_IMMUTABLE_MEM_TABLE_FLUSHED #
|
|
||||||
__system__ NUM_RUNNING_FLUSHES #
|
|
||||||
__system__ NUM_RUNNING_COMPACTIONS #
|
|
||||||
__system__ SIZE_ALL_MEM_TABLES #
|
|
||||||
__system__ NUM_DELETES_ACTIVE_MEM_TABLE #
|
|
||||||
__system__ NUM_DELETES_IMM_MEM_TABLES #
|
|
||||||
__system__ ESTIMATE_NUM_KEYS #
|
|
||||||
__system__ ESTIMATE_LIVE_DATA_SIZE #
|
|
||||||
__system__ ESTIMATE_PENDING_COMPACTION_BYTES #
|
|
||||||
cf_t1 NUM_IMMUTABLE_MEM_TABLE #
|
cf_t1 NUM_IMMUTABLE_MEM_TABLE #
|
||||||
cf_t1 MEM_TABLE_FLUSH_PENDING #
|
cf_t1 MEM_TABLE_FLUSH_PENDING #
|
||||||
cf_t1 COMPACTION_PENDING #
|
cf_t1 COMPACTION_PENDING #
|
||||||
@@ -63,15 +54,6 @@ cf_t1 NUM_ENTRIES_ACTIVE_MEM_TABLE #
|
|||||||
cf_t1 NUM_ENTRIES_IMM_MEM_TABLES #
|
cf_t1 NUM_ENTRIES_IMM_MEM_TABLES #
|
||||||
cf_t1 NON_BLOCK_CACHE_SST_MEM_USAGE #
|
cf_t1 NON_BLOCK_CACHE_SST_MEM_USAGE #
|
||||||
cf_t1 NUM_LIVE_VERSIONS #
|
cf_t1 NUM_LIVE_VERSIONS #
|
||||||
cf_t1 NUM_IMMUTABLE_MEM_TABLE_FLUSHED #
|
|
||||||
cf_t1 NUM_RUNNING_FLUSHES #
|
|
||||||
cf_t1 NUM_RUNNING_COMPACTIONS #
|
|
||||||
cf_t1 SIZE_ALL_MEM_TABLES #
|
|
||||||
cf_t1 NUM_DELETES_ACTIVE_MEM_TABLE #
|
|
||||||
cf_t1 NUM_DELETES_IMM_MEM_TABLES #
|
|
||||||
cf_t1 ESTIMATE_NUM_KEYS #
|
|
||||||
cf_t1 ESTIMATE_LIVE_DATA_SIZE #
|
|
||||||
cf_t1 ESTIMATE_PENDING_COMPACTION_BYTES #
|
|
||||||
default NUM_IMMUTABLE_MEM_TABLE #
|
default NUM_IMMUTABLE_MEM_TABLE #
|
||||||
default MEM_TABLE_FLUSH_PENDING #
|
default MEM_TABLE_FLUSH_PENDING #
|
||||||
default COMPACTION_PENDING #
|
default COMPACTION_PENDING #
|
||||||
@@ -81,15 +63,6 @@ default NUM_ENTRIES_ACTIVE_MEM_TABLE #
|
|||||||
default NUM_ENTRIES_IMM_MEM_TABLES #
|
default NUM_ENTRIES_IMM_MEM_TABLES #
|
||||||
default NON_BLOCK_CACHE_SST_MEM_USAGE #
|
default NON_BLOCK_CACHE_SST_MEM_USAGE #
|
||||||
default NUM_LIVE_VERSIONS #
|
default NUM_LIVE_VERSIONS #
|
||||||
default NUM_IMMUTABLE_MEM_TABLE_FLUSHED #
|
|
||||||
default NUM_RUNNING_FLUSHES #
|
|
||||||
default NUM_RUNNING_COMPACTIONS #
|
|
||||||
default SIZE_ALL_MEM_TABLES #
|
|
||||||
default NUM_DELETES_ACTIVE_MEM_TABLE #
|
|
||||||
default NUM_DELETES_IMM_MEM_TABLES #
|
|
||||||
default ESTIMATE_NUM_KEYS #
|
|
||||||
default ESTIMATE_LIVE_DATA_SIZE #
|
|
||||||
default ESTIMATE_PENDING_COMPACTION_BYTES #
|
|
||||||
rev:cf_t2 NUM_IMMUTABLE_MEM_TABLE #
|
rev:cf_t2 NUM_IMMUTABLE_MEM_TABLE #
|
||||||
rev:cf_t2 MEM_TABLE_FLUSH_PENDING #
|
rev:cf_t2 MEM_TABLE_FLUSH_PENDING #
|
||||||
rev:cf_t2 COMPACTION_PENDING #
|
rev:cf_t2 COMPACTION_PENDING #
|
||||||
@@ -99,15 +72,6 @@ rev:cf_t2 NUM_ENTRIES_ACTIVE_MEM_TABLE #
|
|||||||
rev:cf_t2 NUM_ENTRIES_IMM_MEM_TABLES #
|
rev:cf_t2 NUM_ENTRIES_IMM_MEM_TABLES #
|
||||||
rev:cf_t2 NON_BLOCK_CACHE_SST_MEM_USAGE #
|
rev:cf_t2 NON_BLOCK_CACHE_SST_MEM_USAGE #
|
||||||
rev:cf_t2 NUM_LIVE_VERSIONS #
|
rev:cf_t2 NUM_LIVE_VERSIONS #
|
||||||
rev:cf_t2 NUM_IMMUTABLE_MEM_TABLE_FLUSHED #
|
|
||||||
rev:cf_t2 NUM_RUNNING_FLUSHES #
|
|
||||||
rev:cf_t2 NUM_RUNNING_COMPACTIONS #
|
|
||||||
rev:cf_t2 SIZE_ALL_MEM_TABLES #
|
|
||||||
rev:cf_t2 NUM_DELETES_ACTIVE_MEM_TABLE #
|
|
||||||
rev:cf_t2 NUM_DELETES_IMM_MEM_TABLES #
|
|
||||||
rev:cf_t2 ESTIMATE_NUM_KEYS #
|
|
||||||
rev:cf_t2 ESTIMATE_LIVE_DATA_SIZE #
|
|
||||||
rev:cf_t2 ESTIMATE_PENDING_COMPACTION_BYTES #
|
|
||||||
SELECT * FROM INFORMATION_SCHEMA.ROCKSDB_DBSTATS;
|
SELECT * FROM INFORMATION_SCHEMA.ROCKSDB_DBSTATS;
|
||||||
STAT_TYPE VALUE
|
STAT_TYPE VALUE
|
||||||
DB_BACKGROUND_ERRORS #
|
DB_BACKGROUND_ERRORS #
|
||||||
@@ -138,13 +102,18 @@ __system__ NUM_LEVELS #
|
|||||||
__system__ LEVEL0_FILE_NUM_COMPACTION_TRIGGER #
|
__system__ LEVEL0_FILE_NUM_COMPACTION_TRIGGER #
|
||||||
__system__ LEVEL0_SLOWDOWN_WRITES_TRIGGER #
|
__system__ LEVEL0_SLOWDOWN_WRITES_TRIGGER #
|
||||||
__system__ LEVEL0_STOP_WRITES_TRIGGER #
|
__system__ LEVEL0_STOP_WRITES_TRIGGER #
|
||||||
|
__system__ MAX_MEM_COMPACTION_LEVEL #
|
||||||
__system__ TARGET_FILE_SIZE_BASE #
|
__system__ TARGET_FILE_SIZE_BASE #
|
||||||
__system__ TARGET_FILE_SIZE_MULTIPLIER #
|
__system__ TARGET_FILE_SIZE_MULTIPLIER #
|
||||||
__system__ MAX_BYTES_FOR_LEVEL_BASE #
|
__system__ MAX_BYTES_FOR_LEVEL_BASE #
|
||||||
__system__ LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES #
|
__system__ LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES #
|
||||||
__system__ MAX_BYTES_FOR_LEVEL_MULTIPLIER #
|
__system__ MAX_BYTES_FOR_LEVEL_MULTIPLIER #
|
||||||
|
__system__ SOFT_RATE_LIMIT #
|
||||||
|
__system__ HARD_RATE_LIMIT #
|
||||||
|
__system__ RATE_LIMIT_DELAY_MAX_MILLISECONDS #
|
||||||
__system__ ARENA_BLOCK_SIZE #
|
__system__ ARENA_BLOCK_SIZE #
|
||||||
__system__ DISABLE_AUTO_COMPACTIONS #
|
__system__ DISABLE_AUTO_COMPACTIONS #
|
||||||
|
__system__ PURGE_REDUNDANT_KVS_WHILE_FLUSH #
|
||||||
__system__ MAX_SEQUENTIAL_SKIP_IN_ITERATIONS #
|
__system__ MAX_SEQUENTIAL_SKIP_IN_ITERATIONS #
|
||||||
__system__ MEMTABLE_FACTORY #
|
__system__ MEMTABLE_FACTORY #
|
||||||
__system__ INPLACE_UPDATE_SUPPORT #
|
__system__ INPLACE_UPDATE_SUPPORT #
|
||||||
@@ -172,6 +141,7 @@ __system__ TABLE_FACTORY::INDEX_TYPE #
|
|||||||
__system__ TABLE_FACTORY::DATA_BLOCK_INDEX_TYPE #
|
__system__ TABLE_FACTORY::DATA_BLOCK_INDEX_TYPE #
|
||||||
__system__ TABLE_FACTORY::INDEX_SHORTENING #
|
__system__ TABLE_FACTORY::INDEX_SHORTENING #
|
||||||
__system__ TABLE_FACTORY::DATA_BLOCK_HASH_TABLE_UTIL_RATIO #
|
__system__ TABLE_FACTORY::DATA_BLOCK_HASH_TABLE_UTIL_RATIO #
|
||||||
|
__system__ TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION #
|
||||||
__system__ TABLE_FACTORY::CHECKSUM #
|
__system__ TABLE_FACTORY::CHECKSUM #
|
||||||
__system__ TABLE_FACTORY::NO_BLOCK_CACHE #
|
__system__ TABLE_FACTORY::NO_BLOCK_CACHE #
|
||||||
__system__ TABLE_FACTORY::BLOCK_CACHE #
|
__system__ TABLE_FACTORY::BLOCK_CACHE #
|
||||||
@@ -182,7 +152,7 @@ __system__ TABLE_FACTORY::NUM_SHARD_BITS #
|
|||||||
__system__ TABLE_FACTORY::STRICT_CAPACITY_LIMIT #
|
__system__ TABLE_FACTORY::STRICT_CAPACITY_LIMIT #
|
||||||
__system__ TABLE_FACTORY::MEMORY_ALLOCATOR #
|
__system__ TABLE_FACTORY::MEMORY_ALLOCATOR #
|
||||||
__system__ TABLE_FACTORY::HIGH_PRI_POOL_RATIO #
|
__system__ TABLE_FACTORY::HIGH_PRI_POOL_RATIO #
|
||||||
__system__ TABLE_FACTORY::LOW_PRI_POOL_RATIO #
|
__system__ TABLE_FACTORY::BLOCK_CACHE_COMPRESSED #
|
||||||
__system__ TABLE_FACTORY::PERSISTENT_CACHE #
|
__system__ TABLE_FACTORY::PERSISTENT_CACHE #
|
||||||
__system__ TABLE_FACTORY::BLOCK_SIZE #
|
__system__ TABLE_FACTORY::BLOCK_SIZE #
|
||||||
__system__ TABLE_FACTORY::BLOCK_SIZE_DEVIATION #
|
__system__ TABLE_FACTORY::BLOCK_SIZE_DEVIATION #
|
||||||
@@ -198,10 +168,6 @@ __system__ TABLE_FACTORY::READ_AMP_BYTES_PER_BIT #
|
|||||||
__system__ TABLE_FACTORY::FORMAT_VERSION #
|
__system__ TABLE_FACTORY::FORMAT_VERSION #
|
||||||
__system__ TABLE_FACTORY::ENABLE_INDEX_COMPRESSION #
|
__system__ TABLE_FACTORY::ENABLE_INDEX_COMPRESSION #
|
||||||
__system__ TABLE_FACTORY::BLOCK_ALIGN #
|
__system__ TABLE_FACTORY::BLOCK_ALIGN #
|
||||||
__system__ TABLE_FACTORY::MAX_AUTO_READAHEAD_SIZE #
|
|
||||||
__system__ TABLE_FACTORY::PREPOPULATE_BLOCK_CACHE #
|
|
||||||
__system__ TABLE_FACTORY::INITIAL_AUTO_READAHEAD_SIZE #
|
|
||||||
__system__ TABLE_FACTORY::NUM_FILE_READS_FOR_AUTO_READAHEAD #
|
|
||||||
cf_t1 COMPARATOR #
|
cf_t1 COMPARATOR #
|
||||||
cf_t1 MERGE_OPERATOR #
|
cf_t1 MERGE_OPERATOR #
|
||||||
cf_t1 COMPACTION_FILTER #
|
cf_t1 COMPACTION_FILTER #
|
||||||
@@ -213,13 +179,18 @@ cf_t1 NUM_LEVELS #
|
|||||||
cf_t1 LEVEL0_FILE_NUM_COMPACTION_TRIGGER #
|
cf_t1 LEVEL0_FILE_NUM_COMPACTION_TRIGGER #
|
||||||
cf_t1 LEVEL0_SLOWDOWN_WRITES_TRIGGER #
|
cf_t1 LEVEL0_SLOWDOWN_WRITES_TRIGGER #
|
||||||
cf_t1 LEVEL0_STOP_WRITES_TRIGGER #
|
cf_t1 LEVEL0_STOP_WRITES_TRIGGER #
|
||||||
|
cf_t1 MAX_MEM_COMPACTION_LEVEL #
|
||||||
cf_t1 TARGET_FILE_SIZE_BASE #
|
cf_t1 TARGET_FILE_SIZE_BASE #
|
||||||
cf_t1 TARGET_FILE_SIZE_MULTIPLIER #
|
cf_t1 TARGET_FILE_SIZE_MULTIPLIER #
|
||||||
cf_t1 MAX_BYTES_FOR_LEVEL_BASE #
|
cf_t1 MAX_BYTES_FOR_LEVEL_BASE #
|
||||||
cf_t1 LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES #
|
cf_t1 LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES #
|
||||||
cf_t1 MAX_BYTES_FOR_LEVEL_MULTIPLIER #
|
cf_t1 MAX_BYTES_FOR_LEVEL_MULTIPLIER #
|
||||||
|
cf_t1 SOFT_RATE_LIMIT #
|
||||||
|
cf_t1 HARD_RATE_LIMIT #
|
||||||
|
cf_t1 RATE_LIMIT_DELAY_MAX_MILLISECONDS #
|
||||||
cf_t1 ARENA_BLOCK_SIZE #
|
cf_t1 ARENA_BLOCK_SIZE #
|
||||||
cf_t1 DISABLE_AUTO_COMPACTIONS #
|
cf_t1 DISABLE_AUTO_COMPACTIONS #
|
||||||
|
cf_t1 PURGE_REDUNDANT_KVS_WHILE_FLUSH #
|
||||||
cf_t1 MAX_SEQUENTIAL_SKIP_IN_ITERATIONS #
|
cf_t1 MAX_SEQUENTIAL_SKIP_IN_ITERATIONS #
|
||||||
cf_t1 MEMTABLE_FACTORY #
|
cf_t1 MEMTABLE_FACTORY #
|
||||||
cf_t1 INPLACE_UPDATE_SUPPORT #
|
cf_t1 INPLACE_UPDATE_SUPPORT #
|
||||||
@@ -247,6 +218,7 @@ cf_t1 TABLE_FACTORY::INDEX_TYPE #
|
|||||||
cf_t1 TABLE_FACTORY::DATA_BLOCK_INDEX_TYPE #
|
cf_t1 TABLE_FACTORY::DATA_BLOCK_INDEX_TYPE #
|
||||||
cf_t1 TABLE_FACTORY::INDEX_SHORTENING #
|
cf_t1 TABLE_FACTORY::INDEX_SHORTENING #
|
||||||
cf_t1 TABLE_FACTORY::DATA_BLOCK_HASH_TABLE_UTIL_RATIO #
|
cf_t1 TABLE_FACTORY::DATA_BLOCK_HASH_TABLE_UTIL_RATIO #
|
||||||
|
cf_t1 TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION #
|
||||||
cf_t1 TABLE_FACTORY::CHECKSUM #
|
cf_t1 TABLE_FACTORY::CHECKSUM #
|
||||||
cf_t1 TABLE_FACTORY::NO_BLOCK_CACHE #
|
cf_t1 TABLE_FACTORY::NO_BLOCK_CACHE #
|
||||||
cf_t1 TABLE_FACTORY::BLOCK_CACHE #
|
cf_t1 TABLE_FACTORY::BLOCK_CACHE #
|
||||||
@@ -257,7 +229,7 @@ cf_t1 TABLE_FACTORY::NUM_SHARD_BITS #
|
|||||||
cf_t1 TABLE_FACTORY::STRICT_CAPACITY_LIMIT #
|
cf_t1 TABLE_FACTORY::STRICT_CAPACITY_LIMIT #
|
||||||
cf_t1 TABLE_FACTORY::MEMORY_ALLOCATOR #
|
cf_t1 TABLE_FACTORY::MEMORY_ALLOCATOR #
|
||||||
cf_t1 TABLE_FACTORY::HIGH_PRI_POOL_RATIO #
|
cf_t1 TABLE_FACTORY::HIGH_PRI_POOL_RATIO #
|
||||||
cf_t1 TABLE_FACTORY::LOW_PRI_POOL_RATIO #
|
cf_t1 TABLE_FACTORY::BLOCK_CACHE_COMPRESSED #
|
||||||
cf_t1 TABLE_FACTORY::PERSISTENT_CACHE #
|
cf_t1 TABLE_FACTORY::PERSISTENT_CACHE #
|
||||||
cf_t1 TABLE_FACTORY::BLOCK_SIZE #
|
cf_t1 TABLE_FACTORY::BLOCK_SIZE #
|
||||||
cf_t1 TABLE_FACTORY::BLOCK_SIZE_DEVIATION #
|
cf_t1 TABLE_FACTORY::BLOCK_SIZE_DEVIATION #
|
||||||
@@ -273,10 +245,6 @@ cf_t1 TABLE_FACTORY::READ_AMP_BYTES_PER_BIT #
|
|||||||
cf_t1 TABLE_FACTORY::FORMAT_VERSION #
|
cf_t1 TABLE_FACTORY::FORMAT_VERSION #
|
||||||
cf_t1 TABLE_FACTORY::ENABLE_INDEX_COMPRESSION #
|
cf_t1 TABLE_FACTORY::ENABLE_INDEX_COMPRESSION #
|
||||||
cf_t1 TABLE_FACTORY::BLOCK_ALIGN #
|
cf_t1 TABLE_FACTORY::BLOCK_ALIGN #
|
||||||
cf_t1 TABLE_FACTORY::MAX_AUTO_READAHEAD_SIZE #
|
|
||||||
cf_t1 TABLE_FACTORY::PREPOPULATE_BLOCK_CACHE #
|
|
||||||
cf_t1 TABLE_FACTORY::INITIAL_AUTO_READAHEAD_SIZE #
|
|
||||||
cf_t1 TABLE_FACTORY::NUM_FILE_READS_FOR_AUTO_READAHEAD #
|
|
||||||
default COMPARATOR #
|
default COMPARATOR #
|
||||||
default MERGE_OPERATOR #
|
default MERGE_OPERATOR #
|
||||||
default COMPACTION_FILTER #
|
default COMPACTION_FILTER #
|
||||||
@@ -288,13 +256,18 @@ default NUM_LEVELS #
|
|||||||
default LEVEL0_FILE_NUM_COMPACTION_TRIGGER #
|
default LEVEL0_FILE_NUM_COMPACTION_TRIGGER #
|
||||||
default LEVEL0_SLOWDOWN_WRITES_TRIGGER #
|
default LEVEL0_SLOWDOWN_WRITES_TRIGGER #
|
||||||
default LEVEL0_STOP_WRITES_TRIGGER #
|
default LEVEL0_STOP_WRITES_TRIGGER #
|
||||||
|
default MAX_MEM_COMPACTION_LEVEL #
|
||||||
default TARGET_FILE_SIZE_BASE #
|
default TARGET_FILE_SIZE_BASE #
|
||||||
default TARGET_FILE_SIZE_MULTIPLIER #
|
default TARGET_FILE_SIZE_MULTIPLIER #
|
||||||
default MAX_BYTES_FOR_LEVEL_BASE #
|
default MAX_BYTES_FOR_LEVEL_BASE #
|
||||||
default LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES #
|
default LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES #
|
||||||
default MAX_BYTES_FOR_LEVEL_MULTIPLIER #
|
default MAX_BYTES_FOR_LEVEL_MULTIPLIER #
|
||||||
|
default SOFT_RATE_LIMIT #
|
||||||
|
default HARD_RATE_LIMIT #
|
||||||
|
default RATE_LIMIT_DELAY_MAX_MILLISECONDS #
|
||||||
default ARENA_BLOCK_SIZE #
|
default ARENA_BLOCK_SIZE #
|
||||||
default DISABLE_AUTO_COMPACTIONS #
|
default DISABLE_AUTO_COMPACTIONS #
|
||||||
|
default PURGE_REDUNDANT_KVS_WHILE_FLUSH #
|
||||||
default MAX_SEQUENTIAL_SKIP_IN_ITERATIONS #
|
default MAX_SEQUENTIAL_SKIP_IN_ITERATIONS #
|
||||||
default MEMTABLE_FACTORY #
|
default MEMTABLE_FACTORY #
|
||||||
default INPLACE_UPDATE_SUPPORT #
|
default INPLACE_UPDATE_SUPPORT #
|
||||||
@@ -322,6 +295,7 @@ default TABLE_FACTORY::INDEX_TYPE #
|
|||||||
default TABLE_FACTORY::DATA_BLOCK_INDEX_TYPE #
|
default TABLE_FACTORY::DATA_BLOCK_INDEX_TYPE #
|
||||||
default TABLE_FACTORY::INDEX_SHORTENING #
|
default TABLE_FACTORY::INDEX_SHORTENING #
|
||||||
default TABLE_FACTORY::DATA_BLOCK_HASH_TABLE_UTIL_RATIO #
|
default TABLE_FACTORY::DATA_BLOCK_HASH_TABLE_UTIL_RATIO #
|
||||||
|
default TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION #
|
||||||
default TABLE_FACTORY::CHECKSUM #
|
default TABLE_FACTORY::CHECKSUM #
|
||||||
default TABLE_FACTORY::NO_BLOCK_CACHE #
|
default TABLE_FACTORY::NO_BLOCK_CACHE #
|
||||||
default TABLE_FACTORY::BLOCK_CACHE #
|
default TABLE_FACTORY::BLOCK_CACHE #
|
||||||
@@ -332,7 +306,7 @@ default TABLE_FACTORY::NUM_SHARD_BITS #
|
|||||||
default TABLE_FACTORY::STRICT_CAPACITY_LIMIT #
|
default TABLE_FACTORY::STRICT_CAPACITY_LIMIT #
|
||||||
default TABLE_FACTORY::MEMORY_ALLOCATOR #
|
default TABLE_FACTORY::MEMORY_ALLOCATOR #
|
||||||
default TABLE_FACTORY::HIGH_PRI_POOL_RATIO #
|
default TABLE_FACTORY::HIGH_PRI_POOL_RATIO #
|
||||||
default TABLE_FACTORY::LOW_PRI_POOL_RATIO #
|
default TABLE_FACTORY::BLOCK_CACHE_COMPRESSED #
|
||||||
default TABLE_FACTORY::PERSISTENT_CACHE #
|
default TABLE_FACTORY::PERSISTENT_CACHE #
|
||||||
default TABLE_FACTORY::BLOCK_SIZE #
|
default TABLE_FACTORY::BLOCK_SIZE #
|
||||||
default TABLE_FACTORY::BLOCK_SIZE_DEVIATION #
|
default TABLE_FACTORY::BLOCK_SIZE_DEVIATION #
|
||||||
@@ -348,10 +322,6 @@ default TABLE_FACTORY::READ_AMP_BYTES_PER_BIT #
|
|||||||
default TABLE_FACTORY::FORMAT_VERSION #
|
default TABLE_FACTORY::FORMAT_VERSION #
|
||||||
default TABLE_FACTORY::ENABLE_INDEX_COMPRESSION #
|
default TABLE_FACTORY::ENABLE_INDEX_COMPRESSION #
|
||||||
default TABLE_FACTORY::BLOCK_ALIGN #
|
default TABLE_FACTORY::BLOCK_ALIGN #
|
||||||
default TABLE_FACTORY::MAX_AUTO_READAHEAD_SIZE #
|
|
||||||
default TABLE_FACTORY::PREPOPULATE_BLOCK_CACHE #
|
|
||||||
default TABLE_FACTORY::INITIAL_AUTO_READAHEAD_SIZE #
|
|
||||||
default TABLE_FACTORY::NUM_FILE_READS_FOR_AUTO_READAHEAD #
|
|
||||||
rev:cf_t2 COMPARATOR #
|
rev:cf_t2 COMPARATOR #
|
||||||
rev:cf_t2 MERGE_OPERATOR #
|
rev:cf_t2 MERGE_OPERATOR #
|
||||||
rev:cf_t2 COMPACTION_FILTER #
|
rev:cf_t2 COMPACTION_FILTER #
|
||||||
@@ -363,13 +333,18 @@ rev:cf_t2 NUM_LEVELS #
|
|||||||
rev:cf_t2 LEVEL0_FILE_NUM_COMPACTION_TRIGGER #
|
rev:cf_t2 LEVEL0_FILE_NUM_COMPACTION_TRIGGER #
|
||||||
rev:cf_t2 LEVEL0_SLOWDOWN_WRITES_TRIGGER #
|
rev:cf_t2 LEVEL0_SLOWDOWN_WRITES_TRIGGER #
|
||||||
rev:cf_t2 LEVEL0_STOP_WRITES_TRIGGER #
|
rev:cf_t2 LEVEL0_STOP_WRITES_TRIGGER #
|
||||||
|
rev:cf_t2 MAX_MEM_COMPACTION_LEVEL #
|
||||||
rev:cf_t2 TARGET_FILE_SIZE_BASE #
|
rev:cf_t2 TARGET_FILE_SIZE_BASE #
|
||||||
rev:cf_t2 TARGET_FILE_SIZE_MULTIPLIER #
|
rev:cf_t2 TARGET_FILE_SIZE_MULTIPLIER #
|
||||||
rev:cf_t2 MAX_BYTES_FOR_LEVEL_BASE #
|
rev:cf_t2 MAX_BYTES_FOR_LEVEL_BASE #
|
||||||
rev:cf_t2 LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES #
|
rev:cf_t2 LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES #
|
||||||
rev:cf_t2 MAX_BYTES_FOR_LEVEL_MULTIPLIER #
|
rev:cf_t2 MAX_BYTES_FOR_LEVEL_MULTIPLIER #
|
||||||
|
rev:cf_t2 SOFT_RATE_LIMIT #
|
||||||
|
rev:cf_t2 HARD_RATE_LIMIT #
|
||||||
|
rev:cf_t2 RATE_LIMIT_DELAY_MAX_MILLISECONDS #
|
||||||
rev:cf_t2 ARENA_BLOCK_SIZE #
|
rev:cf_t2 ARENA_BLOCK_SIZE #
|
||||||
rev:cf_t2 DISABLE_AUTO_COMPACTIONS #
|
rev:cf_t2 DISABLE_AUTO_COMPACTIONS #
|
||||||
|
rev:cf_t2 PURGE_REDUNDANT_KVS_WHILE_FLUSH #
|
||||||
rev:cf_t2 MAX_SEQUENTIAL_SKIP_IN_ITERATIONS #
|
rev:cf_t2 MAX_SEQUENTIAL_SKIP_IN_ITERATIONS #
|
||||||
rev:cf_t2 MEMTABLE_FACTORY #
|
rev:cf_t2 MEMTABLE_FACTORY #
|
||||||
rev:cf_t2 INPLACE_UPDATE_SUPPORT #
|
rev:cf_t2 INPLACE_UPDATE_SUPPORT #
|
||||||
@@ -397,6 +372,7 @@ rev:cf_t2 TABLE_FACTORY::INDEX_TYPE #
|
|||||||
rev:cf_t2 TABLE_FACTORY::DATA_BLOCK_INDEX_TYPE #
|
rev:cf_t2 TABLE_FACTORY::DATA_BLOCK_INDEX_TYPE #
|
||||||
rev:cf_t2 TABLE_FACTORY::INDEX_SHORTENING #
|
rev:cf_t2 TABLE_FACTORY::INDEX_SHORTENING #
|
||||||
rev:cf_t2 TABLE_FACTORY::DATA_BLOCK_HASH_TABLE_UTIL_RATIO #
|
rev:cf_t2 TABLE_FACTORY::DATA_BLOCK_HASH_TABLE_UTIL_RATIO #
|
||||||
|
rev:cf_t2 TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION #
|
||||||
rev:cf_t2 TABLE_FACTORY::CHECKSUM #
|
rev:cf_t2 TABLE_FACTORY::CHECKSUM #
|
||||||
rev:cf_t2 TABLE_FACTORY::NO_BLOCK_CACHE #
|
rev:cf_t2 TABLE_FACTORY::NO_BLOCK_CACHE #
|
||||||
rev:cf_t2 TABLE_FACTORY::BLOCK_CACHE #
|
rev:cf_t2 TABLE_FACTORY::BLOCK_CACHE #
|
||||||
@@ -407,7 +383,7 @@ rev:cf_t2 TABLE_FACTORY::NUM_SHARD_BITS #
|
|||||||
rev:cf_t2 TABLE_FACTORY::STRICT_CAPACITY_LIMIT #
|
rev:cf_t2 TABLE_FACTORY::STRICT_CAPACITY_LIMIT #
|
||||||
rev:cf_t2 TABLE_FACTORY::MEMORY_ALLOCATOR #
|
rev:cf_t2 TABLE_FACTORY::MEMORY_ALLOCATOR #
|
||||||
rev:cf_t2 TABLE_FACTORY::HIGH_PRI_POOL_RATIO #
|
rev:cf_t2 TABLE_FACTORY::HIGH_PRI_POOL_RATIO #
|
||||||
rev:cf_t2 TABLE_FACTORY::LOW_PRI_POOL_RATIO #
|
rev:cf_t2 TABLE_FACTORY::BLOCK_CACHE_COMPRESSED #
|
||||||
rev:cf_t2 TABLE_FACTORY::PERSISTENT_CACHE #
|
rev:cf_t2 TABLE_FACTORY::PERSISTENT_CACHE #
|
||||||
rev:cf_t2 TABLE_FACTORY::BLOCK_SIZE #
|
rev:cf_t2 TABLE_FACTORY::BLOCK_SIZE #
|
||||||
rev:cf_t2 TABLE_FACTORY::BLOCK_SIZE_DEVIATION #
|
rev:cf_t2 TABLE_FACTORY::BLOCK_SIZE_DEVIATION #
|
||||||
@@ -423,10 +399,6 @@ rev:cf_t2 TABLE_FACTORY::READ_AMP_BYTES_PER_BIT #
|
|||||||
rev:cf_t2 TABLE_FACTORY::FORMAT_VERSION #
|
rev:cf_t2 TABLE_FACTORY::FORMAT_VERSION #
|
||||||
rev:cf_t2 TABLE_FACTORY::ENABLE_INDEX_COMPRESSION #
|
rev:cf_t2 TABLE_FACTORY::ENABLE_INDEX_COMPRESSION #
|
||||||
rev:cf_t2 TABLE_FACTORY::BLOCK_ALIGN #
|
rev:cf_t2 TABLE_FACTORY::BLOCK_ALIGN #
|
||||||
rev:cf_t2 TABLE_FACTORY::MAX_AUTO_READAHEAD_SIZE #
|
|
||||||
rev:cf_t2 TABLE_FACTORY::PREPOPULATE_BLOCK_CACHE #
|
|
||||||
rev:cf_t2 TABLE_FACTORY::INITIAL_AUTO_READAHEAD_SIZE #
|
|
||||||
rev:cf_t2 TABLE_FACTORY::NUM_FILE_READS_FOR_AUTO_READAHEAD #
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
DROP TABLE t3;
|
DROP TABLE t3;
|
||||||
|
@@ -1,95 +0,0 @@
|
|||||||
set global rocksdb_strict_collation_exceptions = 't1,t2';
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
pk INT,
|
|
||||||
a VARCHAR(64),
|
|
||||||
PRIMARY KEY (pk),
|
|
||||||
KEY (a)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
|
||||||
INSERT INTO t1 VALUES (1, 'one');
|
|
||||||
RENAME TABLE t1 TO t1_trunc;
|
|
||||||
SELECT * FROM t1_trunc ORDER BY pk;
|
|
||||||
pk a
|
|
||||||
1 one
|
|
||||||
TRUNCATE TABLE t1_trunc;
|
|
||||||
SELECT * FROM t1_trunc;
|
|
||||||
pk a
|
|
||||||
CREATE TABLE t2 (
|
|
||||||
pk INT,
|
|
||||||
a VARCHAR(64),
|
|
||||||
PRIMARY KEY (pk),
|
|
||||||
KEY (a)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
|
|
||||||
PARTITION BY RANGE (pk) (
|
|
||||||
PARTITION p0 VALUES LESS THAN (3),
|
|
||||||
PARTITION p1 VALUES LESS THAN (6),
|
|
||||||
PARTITION p2 VALUES LESS THAN MAXVALUE
|
|
||||||
);
|
|
||||||
INSERT INTO t2 VALUES (1, 'one'), (4, 'four'), (7, 'seven');
|
|
||||||
RENAME TABLE t2 to t2_trunc;
|
|
||||||
SELECT * FROM t2_trunc ORDER BY pk;
|
|
||||||
pk a
|
|
||||||
1 one
|
|
||||||
4 four
|
|
||||||
7 seven
|
|
||||||
ALTER TABLE t2_trunc TRUNCATE PARTITION p0;
|
|
||||||
SELECT * FROM t2_trunc ORDER BY pk;
|
|
||||||
pk a
|
|
||||||
4 four
|
|
||||||
7 seven
|
|
||||||
TRUNCATE TABLE t2_trunc;
|
|
||||||
SELECT * FROM t2_trunc ORDER BY pk;
|
|
||||||
pk a
|
|
||||||
set global rocksdb_strict_collation_exceptions = default;
|
|
||||||
DROP TABLE t1_trunc, t2_trunc;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
pk INT PRIMARY KEY
|
|
||||||
) ENGINE=ROCKSDB;
|
|
||||||
INSERT INTO t1 VALUES (1), (2);
|
|
||||||
SELECT * FROM t1;
|
|
||||||
pk
|
|
||||||
1
|
|
||||||
2
|
|
||||||
SET DEBUG_DBUG = "+d,rocksdb_truncate_failure";
|
|
||||||
TRUNCATE TABLE t1;
|
|
||||||
ERROR HY000: Internal error: Simulated truncation failure.
|
|
||||||
SET DEBUG_DBUG = "-d,rocksdb_truncate_failure";
|
|
||||||
SELECT * FROM t1;
|
|
||||||
pk
|
|
||||||
1
|
|
||||||
2
|
|
||||||
CREATE TABLE t2 (
|
|
||||||
a INT
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
PARTITION BY RANGE (a) (
|
|
||||||
PARTITION p0 VALUES LESS THAN (3),
|
|
||||||
PARTITION p1 VALUES LESS THAN (6),
|
|
||||||
PARTITION p2 VALUES LESS THAN MAXVALUE
|
|
||||||
);
|
|
||||||
INSERT INTO t2 VALUES (1), (4), (7);
|
|
||||||
SET DEBUG_DBUG = "+d,rocksdb_truncate_failure";
|
|
||||||
TRUNCATE TABLE t2;
|
|
||||||
ERROR HY000: Internal error: Simulated truncation failure.
|
|
||||||
ALTER TABLE t2 TRUNCATE PARTITION p1;
|
|
||||||
ERROR HY000: Internal error: Simulated truncation failure.
|
|
||||||
SET DEBUG_DBUG = "-d,rocksdb_truncate_failure";
|
|
||||||
SELECT * FROM t2;
|
|
||||||
a
|
|
||||||
1
|
|
||||||
4
|
|
||||||
7
|
|
||||||
DROP TABLE t1, t2;
|
|
||||||
CREATE TABLE t1_crash (
|
|
||||||
pk INT PRIMARY KEY
|
|
||||||
) ENGINE=ROCKSDB;
|
|
||||||
INSERT INTO t1_crash VALUES (100), (1000);
|
|
||||||
SELECT * FROM t1_crash;
|
|
||||||
pk
|
|
||||||
100
|
|
||||||
1000
|
|
||||||
SET DEBUG_DBUG = "+d,rocksdb_truncate_failure_crash";
|
|
||||||
TRUNCATE TABLE t1_crash;
|
|
||||||
ERROR HY000: Lost connection to server during query
|
|
||||||
MyRocks: Removing truncated leftover table test.#truncate_tmp#t1_crash
|
|
||||||
DROP TABLE t1_crash;
|
|
||||||
Warnings:
|
|
||||||
Warning 1932 Table 'test.t1_crash' doesn't exist in engine
|
|
@@ -1,6 +1,12 @@
|
|||||||
|
call mtr.add_suppression("Column family 'cf1' not found");
|
||||||
|
call mtr.add_suppression("Column family 'rev:cf2' not found");
|
||||||
DROP TABLE IF EXISTS t1;
|
DROP TABLE IF EXISTS t1;
|
||||||
call mtr.add_suppression("Column family 'cf1' not found");
|
call mtr.add_suppression("Column family 'cf1' not found");
|
||||||
call mtr.add_suppression("Column family 'rev:cf2' not found");
|
call mtr.add_suppression("Column family 'rev:cf2' not found");
|
||||||
|
set global rocksdb_compact_cf = 'cf1';
|
||||||
|
set global rocksdb_compact_cf = 'rev:cf2';
|
||||||
|
set global rocksdb_signal_drop_index_thread = 1;
|
||||||
|
# restart
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
a int not null,
|
a int not null,
|
||||||
b int not null,
|
b int not null,
|
||||||
@@ -9,10 +15,6 @@ primary key (a,b) comment 'cf1',
|
|||||||
key (b) comment 'rev:cf2'
|
key (b) comment 'rev:cf2'
|
||||||
) ENGINE=RocksDB;
|
) ENGINE=RocksDB;
|
||||||
DELETE FROM t1;
|
DELETE FROM t1;
|
||||||
set global rocksdb_compact_cf = 'cf1';
|
|
||||||
set global rocksdb_compact_cf = 'rev:cf2';
|
|
||||||
set global rocksdb_signal_drop_index_thread = 1;
|
|
||||||
# restart
|
|
||||||
select variable_value into @a from information_schema.global_status where variable_name='rocksdb_compact_read_bytes';
|
select variable_value into @a from information_schema.global_status where variable_name='rocksdb_compact_read_bytes';
|
||||||
truncate table t1;
|
truncate table t1;
|
||||||
select case when variable_value-@a < 500000 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_compact_read_bytes';
|
select case when variable_value-@a < 500000 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_compact_read_bytes';
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -254,771 +254,3 @@ set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|||||||
SELECT c1 FROM t1;
|
SELECT c1 FROM t1;
|
||||||
c1
|
c1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
|
||||||
PRIMARY KEY (`c1`)
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="custom_p0_ttl_duration=1;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 4, 7),
|
|
||||||
PARTITION custom_p1 VALUES IN (2, 5, 8),
|
|
||||||
PARTITION custom_p2 VALUES IN (3, 6, 9)
|
|
||||||
);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -3600;
|
|
||||||
INSERT INTO t1 values (1);
|
|
||||||
INSERT INTO t1 values (2);
|
|
||||||
INSERT INTO t1 values (3);
|
|
||||||
INSERT INTO t1 values (4);
|
|
||||||
INSERT INTO t1 values (5);
|
|
||||||
INSERT INTO t1 values (6);
|
|
||||||
INSERT INTO t1 values (7);
|
|
||||||
INSERT INTO t1 values (8);
|
|
||||||
INSERT INTO t1 values (9);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1
|
|
||||||
1
|
|
||||||
2
|
|
||||||
3
|
|
||||||
4
|
|
||||||
5
|
|
||||||
6
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1
|
|
||||||
2
|
|
||||||
3
|
|
||||||
5
|
|
||||||
6
|
|
||||||
8
|
|
||||||
9
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
|
||||||
c2 INT,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
PRIMARY KEY (`c1`, `c2`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=my_custom_cf;custom_p2_cfname=baz'
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="custom_p0_ttl_duration=1;custom_p1_ttl_duration=7;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 4, 7),
|
|
||||||
PARTITION custom_p1 VALUES IN (2, 5, 8),
|
|
||||||
PARTITION custom_p2 VALUES IN (3, 6, 9)
|
|
||||||
);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -1200;
|
|
||||||
INSERT INTO t1 values (1,1,'a');
|
|
||||||
INSERT INTO t1 values (4,4,'aaaa');
|
|
||||||
INSERT INTO t1 values (7,7,'aaaaaaa');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 1200;
|
|
||||||
INSERT INTO t1 values (2,2,'aa');
|
|
||||||
INSERT INTO t1 values (3,3,'aaa');
|
|
||||||
INSERT INTO t1 values (5,5,'aaaaa');
|
|
||||||
INSERT INTO t1 values (6,6,'aaaaaa');
|
|
||||||
INSERT INTO t1 values (8,8,'aaaaaaaa');
|
|
||||||
INSERT INTO t1 values (9,9,'aaaaaaaaa');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name
|
|
||||||
1 1 a
|
|
||||||
2 2 aa
|
|
||||||
3 3 aaa
|
|
||||||
4 4 aaaa
|
|
||||||
5 5 aaaaa
|
|
||||||
6 6 aaaaaa
|
|
||||||
7 7 aaaaaaa
|
|
||||||
8 8 aaaaaaaa
|
|
||||||
9 9 aaaaaaaaa
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'my_custom_cf';
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name
|
|
||||||
2 2 aa
|
|
||||||
3 3 aaa
|
|
||||||
5 5 aaaaa
|
|
||||||
6 6 aaaaaa
|
|
||||||
8 8 aaaaaaaa
|
|
||||||
9 9 aaaaaaaaa
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name
|
|
||||||
2 2 aa
|
|
||||||
3 3 aaa
|
|
||||||
5 5 aaaaa
|
|
||||||
6 6 aaaaaa
|
|
||||||
8 8 aaaaaaaa
|
|
||||||
9 9 aaaaaaaaa
|
|
||||||
set @@global.rocksdb_compact_cf = 'my_custom_cf';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name
|
|
||||||
3 3 aaa
|
|
||||||
6 6 aaaaaa
|
|
||||||
9 9 aaaaaaaaa
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
|
||||||
c2 INT,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
event DATE,
|
|
||||||
PRIMARY KEY (`c1`, `c2`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="custom_p0_ttl_duration=9999;custom_p2_ttl_duration=5;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 2, 3),
|
|
||||||
PARTITION custom_p1 VALUES IN (4, 5, 6),
|
|
||||||
PARTITION custom_p2 VALUES IN (7, 8, 9)
|
|
||||||
);
|
|
||||||
INSERT INTO t1 VALUES (1, 1, "one", null);
|
|
||||||
INSERT INTO t1 VALUES (2, 2, "two", null);
|
|
||||||
INSERT INTO t1 VALUES (3, 3, "three", null);
|
|
||||||
INSERT INTO t1 VALUES (4, 4, "four", null);
|
|
||||||
INSERT INTO t1 VALUES (5, 5, "five", null);
|
|
||||||
INSERT INTO t1 VALUES (6, 6, "six", null);
|
|
||||||
INSERT INTO t1 VALUES (7, 7, "seven", null);
|
|
||||||
INSERT INTO t1 VALUES (8, 8, "eight", null);
|
|
||||||
INSERT INTO t1 VALUES (9, 9, "nine", null);
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name event
|
|
||||||
1 1 one NULL
|
|
||||||
2 2 two NULL
|
|
||||||
3 3 three NULL
|
|
||||||
4 4 four NULL
|
|
||||||
5 5 five NULL
|
|
||||||
6 6 six NULL
|
|
||||||
7 7 seven NULL
|
|
||||||
8 8 eight NULL
|
|
||||||
9 9 nine NULL
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 600;
|
|
||||||
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(`c2`,`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;';
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SHOW CREATE TABLE t1;
|
|
||||||
Table Create Table
|
|
||||||
t1 CREATE TABLE `t1` (
|
|
||||||
`c1` int(11) NOT NULL,
|
|
||||||
`c2` int(11) NOT NULL,
|
|
||||||
`name` varchar(25) NOT NULL,
|
|
||||||
`event` date DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`c2`,`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='custom_p0_ttl_duration=9999;custom_p2_ttl_duration=5;'
|
|
||||||
PARTITION BY LIST (`c1`)
|
|
||||||
(PARTITION `custom_p0` VALUES IN (1,2,3) ENGINE = ROCKSDB,
|
|
||||||
PARTITION `custom_p1` VALUES IN (4,5,6) ENGINE = ROCKSDB,
|
|
||||||
PARTITION `custom_p2` VALUES IN (7,8,9) ENGINE = ROCKSDB)
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 100;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name event
|
|
||||||
1 1 one NULL
|
|
||||||
2 2 two NULL
|
|
||||||
3 3 three NULL
|
|
||||||
4 4 four NULL
|
|
||||||
5 5 five NULL
|
|
||||||
6 6 six NULL
|
|
||||||
7 7 seven NULL
|
|
||||||
8 8 eight NULL
|
|
||||||
9 9 nine NULL
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 1200;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name event
|
|
||||||
1 1 one NULL
|
|
||||||
2 2 two NULL
|
|
||||||
3 3 three NULL
|
|
||||||
4 4 four NULL
|
|
||||||
5 5 five NULL
|
|
||||||
6 6 six NULL
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 BIGINT,
|
|
||||||
c2 TIMESTAMP NOT NULL,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
event DATE,
|
|
||||||
PRIMARY KEY (`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="ttl_duration=1;custom_p1_ttl_duration=100;custom_p1_ttl_col=c2;custom_p2_ttl_duration=5000;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 2, 3),
|
|
||||||
PARTITION custom_p1 VALUES IN (4, 5, 6),
|
|
||||||
PARTITION custom_p2 VALUES IN (7, 8, 9)
|
|
||||||
);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
INSERT INTO t1 VALUES (1, NOW(), "one", null);
|
|
||||||
INSERT INTO t1 VALUES (2, NOW(), "two", null);
|
|
||||||
INSERT INTO t1 VALUES (3, NOW(), "three", null);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
INSERT INTO t1 VALUES (4, NOW(), "four", null);
|
|
||||||
INSERT INTO t1 VALUES (5, NOW(), "five", null);
|
|
||||||
INSERT INTO t1 VALUES (6, NOW(), "six", null);
|
|
||||||
INSERT INTO t1 VALUES (7, NOW(), "seven", null);
|
|
||||||
INSERT INTO t1 VALUES (8, NOW(), "eight", null);
|
|
||||||
INSERT INTO t1 VALUES (9, NOW(), "nine", null);
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set @@global.rocksdb_compact_cf = 'bar';
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
c1
|
|
||||||
4
|
|
||||||
5
|
|
||||||
6
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 600;
|
|
||||||
set @@global.rocksdb_compact_cf = 'bar';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
c1
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 BIGINT,
|
|
||||||
c2 TIMESTAMP NOT NULL,
|
|
||||||
PRIMARY KEY (`c1`, `c2`)
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="ttl_duration=100;ttl_col=c2;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1),
|
|
||||||
PARTITION custom_p1 VALUES IN (2),
|
|
||||||
PARTITION custom_p2 VALUES IN (3)
|
|
||||||
);
|
|
||||||
INSERT INTO t1 values (1, NOW());
|
|
||||||
INSERT INTO t1 values (2, NOW());
|
|
||||||
INSERT INTO t1 values (3, NOW());
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
c1
|
|
||||||
1
|
|
||||||
2
|
|
||||||
3
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 300;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
c1
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
|
||||||
PRIMARY KEY (`c1`)
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="custom_p0_ttl_duration=1;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 4, 7),
|
|
||||||
PARTITION custom_p1 VALUES IN (2, 5, 8),
|
|
||||||
PARTITION custom_p2 VALUES IN (3, 6, 9)
|
|
||||||
);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -3600;
|
|
||||||
INSERT INTO t1 values (1);
|
|
||||||
INSERT INTO t1 values (2);
|
|
||||||
INSERT INTO t1 values (3);
|
|
||||||
INSERT INTO t1 values (4);
|
|
||||||
INSERT INTO t1 values (5);
|
|
||||||
INSERT INTO t1 values (6);
|
|
||||||
INSERT INTO t1 values (7);
|
|
||||||
INSERT INTO t1 values (8);
|
|
||||||
INSERT INTO t1 values (9);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1
|
|
||||||
1
|
|
||||||
2
|
|
||||||
3
|
|
||||||
4
|
|
||||||
5
|
|
||||||
6
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1
|
|
||||||
2
|
|
||||||
3
|
|
||||||
5
|
|
||||||
6
|
|
||||||
8
|
|
||||||
9
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
|
||||||
c2 INT,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
PRIMARY KEY (`c1`, `c2`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=my_custom_cf;custom_p2_cfname=baz'
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="custom_p0_ttl_duration=1;custom_p1_ttl_duration=7;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 4, 7),
|
|
||||||
PARTITION custom_p1 VALUES IN (2, 5, 8),
|
|
||||||
PARTITION custom_p2 VALUES IN (3, 6, 9)
|
|
||||||
);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -1200;
|
|
||||||
INSERT INTO t1 values (1,1,'a');
|
|
||||||
INSERT INTO t1 values (4,4,'aaaa');
|
|
||||||
INSERT INTO t1 values (7,7,'aaaaaaa');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 1200;
|
|
||||||
INSERT INTO t1 values (2,2,'aa');
|
|
||||||
INSERT INTO t1 values (3,3,'aaa');
|
|
||||||
INSERT INTO t1 values (5,5,'aaaaa');
|
|
||||||
INSERT INTO t1 values (6,6,'aaaaaa');
|
|
||||||
INSERT INTO t1 values (8,8,'aaaaaaaa');
|
|
||||||
INSERT INTO t1 values (9,9,'aaaaaaaaa');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name
|
|
||||||
1 1 a
|
|
||||||
2 2 aa
|
|
||||||
3 3 aaa
|
|
||||||
4 4 aaaa
|
|
||||||
5 5 aaaaa
|
|
||||||
6 6 aaaaaa
|
|
||||||
7 7 aaaaaaa
|
|
||||||
8 8 aaaaaaaa
|
|
||||||
9 9 aaaaaaaaa
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'my_custom_cf';
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name
|
|
||||||
2 2 aa
|
|
||||||
3 3 aaa
|
|
||||||
5 5 aaaaa
|
|
||||||
6 6 aaaaaa
|
|
||||||
8 8 aaaaaaaa
|
|
||||||
9 9 aaaaaaaaa
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name
|
|
||||||
2 2 aa
|
|
||||||
3 3 aaa
|
|
||||||
5 5 aaaaa
|
|
||||||
6 6 aaaaaa
|
|
||||||
8 8 aaaaaaaa
|
|
||||||
9 9 aaaaaaaaa
|
|
||||||
set @@global.rocksdb_compact_cf = 'my_custom_cf';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name
|
|
||||||
3 3 aaa
|
|
||||||
6 6 aaaaaa
|
|
||||||
9 9 aaaaaaaaa
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
|
||||||
c2 INT,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
event DATE,
|
|
||||||
PRIMARY KEY (`c1`, `c2`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="custom_p0_ttl_duration=9999;custom_p2_ttl_duration=5;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 2, 3),
|
|
||||||
PARTITION custom_p1 VALUES IN (4, 5, 6),
|
|
||||||
PARTITION custom_p2 VALUES IN (7, 8, 9)
|
|
||||||
);
|
|
||||||
INSERT INTO t1 VALUES (1, 1, "one", null);
|
|
||||||
INSERT INTO t1 VALUES (2, 2, "two", null);
|
|
||||||
INSERT INTO t1 VALUES (3, 3, "three", null);
|
|
||||||
INSERT INTO t1 VALUES (4, 4, "four", null);
|
|
||||||
INSERT INTO t1 VALUES (5, 5, "five", null);
|
|
||||||
INSERT INTO t1 VALUES (6, 6, "six", null);
|
|
||||||
INSERT INTO t1 VALUES (7, 7, "seven", null);
|
|
||||||
INSERT INTO t1 VALUES (8, 8, "eight", null);
|
|
||||||
INSERT INTO t1 VALUES (9, 9, "nine", null);
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name event
|
|
||||||
1 1 one NULL
|
|
||||||
2 2 two NULL
|
|
||||||
3 3 three NULL
|
|
||||||
4 4 four NULL
|
|
||||||
5 5 five NULL
|
|
||||||
6 6 six NULL
|
|
||||||
7 7 seven NULL
|
|
||||||
8 8 eight NULL
|
|
||||||
9 9 nine NULL
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 600;
|
|
||||||
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(`c2`,`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;';
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SHOW CREATE TABLE t1;
|
|
||||||
Table Create Table
|
|
||||||
t1 CREATE TABLE `t1` (
|
|
||||||
`c1` int(11) NOT NULL,
|
|
||||||
`c2` int(11) NOT NULL,
|
|
||||||
`name` varchar(25) NOT NULL,
|
|
||||||
`event` date DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`c2`,`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='custom_p0_ttl_duration=9999;custom_p2_ttl_duration=5;'
|
|
||||||
PARTITION BY LIST (`c1`)
|
|
||||||
(PARTITION `custom_p0` VALUES IN (1,2,3) ENGINE = ROCKSDB,
|
|
||||||
PARTITION `custom_p1` VALUES IN (4,5,6) ENGINE = ROCKSDB,
|
|
||||||
PARTITION `custom_p2` VALUES IN (7,8,9) ENGINE = ROCKSDB)
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 100;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name event
|
|
||||||
1 1 one NULL
|
|
||||||
2 2 two NULL
|
|
||||||
3 3 three NULL
|
|
||||||
4 4 four NULL
|
|
||||||
5 5 five NULL
|
|
||||||
6 6 six NULL
|
|
||||||
7 7 seven NULL
|
|
||||||
8 8 eight NULL
|
|
||||||
9 9 nine NULL
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 1200;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name event
|
|
||||||
1 1 one NULL
|
|
||||||
2 2 two NULL
|
|
||||||
3 3 three NULL
|
|
||||||
4 4 four NULL
|
|
||||||
5 5 five NULL
|
|
||||||
6 6 six NULL
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 BIGINT,
|
|
||||||
c2 TIMESTAMP DEFAULT NOW() NOT NULL,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
event DATE,
|
|
||||||
PRIMARY KEY (`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="ttl_duration=1;custom_p1_ttl_duration=100;custom_p1_ttl_col=c2;custom_p2_ttl_duration=5000;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 2, 3),
|
|
||||||
PARTITION custom_p1 VALUES IN (4, 5, 6),
|
|
||||||
PARTITION custom_p2 VALUES IN (7, 8, 9)
|
|
||||||
);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
INSERT INTO t1 VALUES (1, NOW(), "one", null);
|
|
||||||
INSERT INTO t1 VALUES (2, NOW(), "two", null);
|
|
||||||
INSERT INTO t1 VALUES (3, NOW(), "three", null);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
INSERT INTO t1 VALUES (4, NOW(), "four", null);
|
|
||||||
INSERT INTO t1 VALUES (5, NOW(), "five", null);
|
|
||||||
INSERT INTO t1 VALUES (6, NOW(), "six", null);
|
|
||||||
INSERT INTO t1 VALUES (7, NOW(), "seven", null);
|
|
||||||
INSERT INTO t1 VALUES (8, NOW(), "eight", null);
|
|
||||||
INSERT INTO t1 VALUES (9, NOW(), "nine", null);
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set @@global.rocksdb_compact_cf = 'bar';
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
c1
|
|
||||||
4
|
|
||||||
5
|
|
||||||
6
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 600;
|
|
||||||
set @@global.rocksdb_compact_cf = 'bar';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
c1
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 BIGINT,
|
|
||||||
c2 TIMESTAMP DEFAULT NOW() NOT NULL,
|
|
||||||
PRIMARY KEY (`c1`, `c2`)
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="ttl_duration=100;ttl_col=c2;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1),
|
|
||||||
PARTITION custom_p1 VALUES IN (2),
|
|
||||||
PARTITION custom_p2 VALUES IN (3)
|
|
||||||
);
|
|
||||||
INSERT INTO t1 values (1, NOW());
|
|
||||||
INSERT INTO t1 values (2, NOW());
|
|
||||||
INSERT INTO t1 values (3, NOW());
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
c1
|
|
||||||
1
|
|
||||||
2
|
|
||||||
3
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 300;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
c1
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
|
||||||
PRIMARY KEY (`c1`)
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="custom_p0_ttl_duration=1;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 4, 7),
|
|
||||||
PARTITION custom_p1 VALUES IN (2, 5, 8),
|
|
||||||
PARTITION custom_p2 VALUES IN (3, 6, 9)
|
|
||||||
);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -3600;
|
|
||||||
INSERT INTO t1 values (1);
|
|
||||||
INSERT INTO t1 values (2);
|
|
||||||
INSERT INTO t1 values (3);
|
|
||||||
INSERT INTO t1 values (4);
|
|
||||||
INSERT INTO t1 values (5);
|
|
||||||
INSERT INTO t1 values (6);
|
|
||||||
INSERT INTO t1 values (7);
|
|
||||||
INSERT INTO t1 values (8);
|
|
||||||
INSERT INTO t1 values (9);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1
|
|
||||||
1
|
|
||||||
2
|
|
||||||
3
|
|
||||||
4
|
|
||||||
5
|
|
||||||
6
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1
|
|
||||||
2
|
|
||||||
3
|
|
||||||
5
|
|
||||||
6
|
|
||||||
8
|
|
||||||
9
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
|
||||||
c2 INT,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
PRIMARY KEY (`c1`, `c2`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=my_custom_cf;custom_p2_cfname=baz'
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="custom_p0_ttl_duration=1;custom_p1_ttl_duration=7;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 4, 7),
|
|
||||||
PARTITION custom_p1 VALUES IN (2, 5, 8),
|
|
||||||
PARTITION custom_p2 VALUES IN (3, 6, 9)
|
|
||||||
);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -1200;
|
|
||||||
INSERT INTO t1 values (1,1,'a');
|
|
||||||
INSERT INTO t1 values (4,4,'aaaa');
|
|
||||||
INSERT INTO t1 values (7,7,'aaaaaaa');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 1200;
|
|
||||||
INSERT INTO t1 values (2,2,'aa');
|
|
||||||
INSERT INTO t1 values (3,3,'aaa');
|
|
||||||
INSERT INTO t1 values (5,5,'aaaaa');
|
|
||||||
INSERT INTO t1 values (6,6,'aaaaaa');
|
|
||||||
INSERT INTO t1 values (8,8,'aaaaaaaa');
|
|
||||||
INSERT INTO t1 values (9,9,'aaaaaaaaa');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name
|
|
||||||
1 1 a
|
|
||||||
2 2 aa
|
|
||||||
3 3 aaa
|
|
||||||
4 4 aaaa
|
|
||||||
5 5 aaaaa
|
|
||||||
6 6 aaaaaa
|
|
||||||
7 7 aaaaaaa
|
|
||||||
8 8 aaaaaaaa
|
|
||||||
9 9 aaaaaaaaa
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'my_custom_cf';
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name
|
|
||||||
2 2 aa
|
|
||||||
3 3 aaa
|
|
||||||
5 5 aaaaa
|
|
||||||
6 6 aaaaaa
|
|
||||||
8 8 aaaaaaaa
|
|
||||||
9 9 aaaaaaaaa
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name
|
|
||||||
2 2 aa
|
|
||||||
3 3 aaa
|
|
||||||
5 5 aaaaa
|
|
||||||
6 6 aaaaaa
|
|
||||||
8 8 aaaaaaaa
|
|
||||||
9 9 aaaaaaaaa
|
|
||||||
set @@global.rocksdb_compact_cf = 'my_custom_cf';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name
|
|
||||||
3 3 aaa
|
|
||||||
6 6 aaaaaa
|
|
||||||
9 9 aaaaaaaaa
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
|
||||||
c2 INT,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
event DATE,
|
|
||||||
PRIMARY KEY (`c1`, `c2`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="custom_p0_ttl_duration=9999;custom_p2_ttl_duration=5;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 2, 3),
|
|
||||||
PARTITION custom_p1 VALUES IN (4, 5, 6),
|
|
||||||
PARTITION custom_p2 VALUES IN (7, 8, 9)
|
|
||||||
);
|
|
||||||
INSERT INTO t1 VALUES (1, 1, "one", null);
|
|
||||||
INSERT INTO t1 VALUES (2, 2, "two", null);
|
|
||||||
INSERT INTO t1 VALUES (3, 3, "three", null);
|
|
||||||
INSERT INTO t1 VALUES (4, 4, "four", null);
|
|
||||||
INSERT INTO t1 VALUES (5, 5, "five", null);
|
|
||||||
INSERT INTO t1 VALUES (6, 6, "six", null);
|
|
||||||
INSERT INTO t1 VALUES (7, 7, "seven", null);
|
|
||||||
INSERT INTO t1 VALUES (8, 8, "eight", null);
|
|
||||||
INSERT INTO t1 VALUES (9, 9, "nine", null);
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name event
|
|
||||||
1 1 one NULL
|
|
||||||
2 2 two NULL
|
|
||||||
3 3 three NULL
|
|
||||||
4 4 four NULL
|
|
||||||
5 5 five NULL
|
|
||||||
6 6 six NULL
|
|
||||||
7 7 seven NULL
|
|
||||||
8 8 eight NULL
|
|
||||||
9 9 nine NULL
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 600;
|
|
||||||
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(`c2`,`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;';
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SHOW CREATE TABLE t1;
|
|
||||||
Table Create Table
|
|
||||||
t1 CREATE TABLE `t1` (
|
|
||||||
`c1` int(11) NOT NULL,
|
|
||||||
`c2` int(11) NOT NULL,
|
|
||||||
`name` varchar(25) NOT NULL,
|
|
||||||
`event` date DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`c2`,`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='custom_p0_ttl_duration=9999;custom_p2_ttl_duration=5;'
|
|
||||||
PARTITION BY LIST (`c1`)
|
|
||||||
(PARTITION `custom_p0` VALUES IN (1,2,3) ENGINE = ROCKSDB,
|
|
||||||
PARTITION `custom_p1` VALUES IN (4,5,6) ENGINE = ROCKSDB,
|
|
||||||
PARTITION `custom_p2` VALUES IN (7,8,9) ENGINE = ROCKSDB)
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 100;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name event
|
|
||||||
1 1 one NULL
|
|
||||||
2 2 two NULL
|
|
||||||
3 3 three NULL
|
|
||||||
4 4 four NULL
|
|
||||||
5 5 five NULL
|
|
||||||
6 6 six NULL
|
|
||||||
7 7 seven NULL
|
|
||||||
8 8 eight NULL
|
|
||||||
9 9 nine NULL
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 1200;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT * FROM t1;
|
|
||||||
c1 c2 name event
|
|
||||||
1 1 one NULL
|
|
||||||
2 2 two NULL
|
|
||||||
3 3 three NULL
|
|
||||||
4 4 four NULL
|
|
||||||
5 5 five NULL
|
|
||||||
6 6 six NULL
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 BIGINT,
|
|
||||||
c2 TIMESTAMP(6) NOT NULL,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
event DATE,
|
|
||||||
PRIMARY KEY (`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="ttl_duration=1;custom_p1_ttl_duration=100;custom_p1_ttl_col=c2;custom_p2_ttl_duration=5000;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 2, 3),
|
|
||||||
PARTITION custom_p1 VALUES IN (4, 5, 6),
|
|
||||||
PARTITION custom_p2 VALUES IN (7, 8, 9)
|
|
||||||
);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
INSERT INTO t1 VALUES (1, NOW(), "one", null);
|
|
||||||
INSERT INTO t1 VALUES (2, NOW(), "two", null);
|
|
||||||
INSERT INTO t1 VALUES (3, NOW(), "three", null);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
INSERT INTO t1 VALUES (4, NOW(), "four", null);
|
|
||||||
INSERT INTO t1 VALUES (5, NOW(), "five", null);
|
|
||||||
INSERT INTO t1 VALUES (6, NOW(), "six", null);
|
|
||||||
INSERT INTO t1 VALUES (7, NOW(), "seven", null);
|
|
||||||
INSERT INTO t1 VALUES (8, NOW(), "eight", null);
|
|
||||||
INSERT INTO t1 VALUES (9, NOW(), "nine", null);
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set @@global.rocksdb_compact_cf = 'bar';
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
c1
|
|
||||||
4
|
|
||||||
5
|
|
||||||
6
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 600;
|
|
||||||
set @@global.rocksdb_compact_cf = 'bar';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
c1
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 BIGINT,
|
|
||||||
c2 TIMESTAMP(6) NOT NULL,
|
|
||||||
PRIMARY KEY (`c1`, `c2`)
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="ttl_duration=100;ttl_col=c2;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1),
|
|
||||||
PARTITION custom_p1 VALUES IN (2),
|
|
||||||
PARTITION custom_p2 VALUES IN (3)
|
|
||||||
);
|
|
||||||
INSERT INTO t1 values (1, NOW());
|
|
||||||
INSERT INTO t1 values (2, NOW());
|
|
||||||
INSERT INTO t1 values (3, NOW());
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
c1
|
|
||||||
1
|
|
||||||
2
|
|
||||||
3
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 300;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
c1
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -368,57 +368,6 @@ a b
|
|||||||
10 10
|
10 10
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
a int,
|
|
||||||
b int,
|
|
||||||
ts TIMESTAMP NOT NULL,
|
|
||||||
PRIMARY KEY (a),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 100;
|
|
||||||
INSERT INTO t1 VALUES (1, 1, NOW());
|
|
||||||
INSERT INTO t1 VALUES (2, 2, NOW());
|
|
||||||
INSERT INTO t1 VALUES (3, 3, NOW());
|
|
||||||
INSERT INTO t1 VALUES (4, 4, NOW());
|
|
||||||
INSERT INTO t1 VALUES (5, 5, NOW());
|
|
||||||
INSERT INTO t1 VALUES (6, 6, NOW());
|
|
||||||
INSERT INTO t1 VALUES (7, 7, NOW());
|
|
||||||
INSERT INTO t1 VALUES (8, 8, NOW());
|
|
||||||
INSERT INTO t1 VALUES (9, 9, NOW());
|
|
||||||
INSERT INTO t1 VALUES (10, 10, NOW());
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
# None are expired
|
|
||||||
SELECT a, b FROM t1 FORCE INDEX (kb);
|
|
||||||
a b
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
5 5
|
|
||||||
6 6
|
|
||||||
7 7
|
|
||||||
8 8
|
|
||||||
9 9
|
|
||||||
10 10
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
UPDATE t1 SET ts=(ADDTIME(NOW(), 1)) WHERE a IN (4, 7);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
# 4 and 7 should be gone
|
|
||||||
SELECT a, b FROM t1 FORCE INDEX (kb);
|
|
||||||
a b
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
5 5
|
|
||||||
6 6
|
|
||||||
8 8
|
|
||||||
9 9
|
|
||||||
10 10
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
c1 INT,
|
||||||
c2 INT,
|
c2 INT,
|
||||||
name VARCHAR(25) NOT NULL,
|
name VARCHAR(25) NOT NULL,
|
||||||
|
@@ -334,67 +334,6 @@ c1
|
|||||||
9
|
9
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
c1 BIGINT,
|
|
||||||
c2 TIMESTAMP DEFAULT NOW() NOT NULL,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
event DATE,
|
|
||||||
PRIMARY KEY (`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;',
|
|
||||||
KEY kc2 (`c2`)
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="ttl_duration=1;custom_p1_ttl_duration=100;custom_p1_ttl_col=c2;custom_p2_ttl_duration=5000;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 2, 3),
|
|
||||||
PARTITION custom_p1 VALUES IN (4, 5, 6),
|
|
||||||
PARTITION custom_p2 VALUES IN (7, 8, 9)
|
|
||||||
);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
INSERT INTO t1 VALUES (1, NOW(), "one", null);
|
|
||||||
INSERT INTO t1 VALUES (2, NOW(), "two", null);
|
|
||||||
INSERT INTO t1 VALUES (3, NOW(), "three", null);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
INSERT INTO t1 VALUES (4, NOW(), "four", null);
|
|
||||||
INSERT INTO t1 VALUES (5, NOW(), "five", null);
|
|
||||||
INSERT INTO t1 VALUES (6, NOW(), "six", null);
|
|
||||||
INSERT INTO t1 VALUES (7, NOW(), "seven", null);
|
|
||||||
INSERT INTO t1 VALUES (8, NOW(), "eight", null);
|
|
||||||
INSERT INTO t1 VALUES (9, NOW(), "nine", null);
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set @@global.rocksdb_compact_cf = 'bar';
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
SELECT c1 FROM t1 FORCE INDEX (PRIMARY);
|
|
||||||
c1
|
|
||||||
4
|
|
||||||
5
|
|
||||||
6
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
SELECT c1 FROM t1 FORCE INDEX (kc2);
|
|
||||||
c1
|
|
||||||
4
|
|
||||||
5
|
|
||||||
6
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 600;
|
|
||||||
set @@global.rocksdb_compact_cf = 'bar';
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT c1 FROM t1 FORCE INDEX (PRIMARY);
|
|
||||||
c1
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
SELECT c1 FROM t1 FORCE INDEX (kc2);
|
|
||||||
c1
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
c1 INT,
|
||||||
c2 INT,
|
c2 INT,
|
||||||
PRIMARY KEY (`c1`) COMMENT 'custom_p0_cfname=foo;'
|
PRIMARY KEY (`c1`) COMMENT 'custom_p0_cfname=foo;'
|
||||||
|
@@ -219,34 +219,3 @@ CHECK TABLE t EXTENDED;
|
|||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t check status OK
|
test.t check status OK
|
||||||
DROP TABLE t;
|
DROP TABLE t;
|
||||||
#
|
|
||||||
# Validate lock acquired on SK during delete
|
|
||||||
#
|
|
||||||
CREATE TABLE t3 (pk INT PRIMARY KEY, sk INT, UNIQUE KEY (sk)) ENGINE=ROCKSDB;
|
|
||||||
INSERT INTO t3 VALUES (1, 100);
|
|
||||||
BEGIN;
|
|
||||||
# This should acquire a lock on sk = 100
|
|
||||||
DELETE FROM t3 WHERE pk = 1;
|
|
||||||
connect con1, localhost, root,,;
|
|
||||||
connection con1;
|
|
||||||
set session rocksdb_lock_wait_timeout=1;
|
|
||||||
set session transaction_isolation='REPEATABLE-READ';
|
|
||||||
SELECT * FROM t3;
|
|
||||||
pk sk
|
|
||||||
1 100
|
|
||||||
# RR: This should fail with lock wait timeout due to sk = 100
|
|
||||||
INSERT INTO t3 VALUES (2, 100);
|
|
||||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
|
||||||
set session transaction_isolation='READ-COMMITTED';
|
|
||||||
# RC: This should fail with lock wait timeout due to sk = 100
|
|
||||||
INSERT INTO t3 VALUES (2, 100);
|
|
||||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
|
||||||
connection default;
|
|
||||||
# The original transaction should be able to perform an insert
|
|
||||||
INSERT INTO t3 VALUES (3, 100);
|
|
||||||
COMMIT;
|
|
||||||
SELECT * FROM t3;
|
|
||||||
pk sk
|
|
||||||
3 100
|
|
||||||
disconnect con1;
|
|
||||||
DROP TABLE t3;
|
|
||||||
|
@@ -15,8 +15,8 @@ use strict;
|
|||||||
|
|
||||||
my $sst_dump=
|
my $sst_dump=
|
||||||
::mtr_exe_maybe_exists(
|
::mtr_exe_maybe_exists(
|
||||||
"$::bindir/storage/rocksdb$::multiconfig/mariadb-sst-dump",
|
"$::bindir/storage/rocksdb$::multiconfig/sst_dump",
|
||||||
"$::path_client_bindir/mariadb-sst-dump");
|
"$::path_client_bindir/sst_dump");
|
||||||
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
|
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
|
||||||
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
|
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
CREATE TABLE t0 (id1 VARCHAR(30), id2 INT, value INT, PRIMARY KEY (id1, id2)) ENGINE=rocksdb collate latin1_bin;
|
CREATE TABLE t0 (id1 VARCHAR(30), id2 INT, value INT, PRIMARY KEY (id1, id2)) ENGINE=rocksdb collate latin1_bin;
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
let $i = 1;
|
let $i = 1;
|
||||||
while ($i <= 100000) {
|
while ($i <= 10000) {
|
||||||
let $insert = INSERT INTO t0 VALUES('X', $i, $i);
|
let $insert = INSERT INTO t0 VALUES('X', $i, $i);
|
||||||
inc $i;
|
inc $i;
|
||||||
eval $insert;
|
eval $insert;
|
||||||
@@ -24,7 +24,7 @@ CREATE TABLE t1 (id1 BIGINT, id2 INT, id3 BIGINT, value INT, PRIMARY KEY (id1, i
|
|||||||
|
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
let $i = 1;
|
let $i = 1;
|
||||||
while ($i <= 100000) {
|
while ($i <= 10000) {
|
||||||
let $insert = INSERT INTO t1 VALUES(1, 1, $i, $i);
|
let $insert = INSERT INTO t1 VALUES(1, 1, $i, $i);
|
||||||
eval $insert;
|
eval $insert;
|
||||||
inc $i;
|
inc $i;
|
||||||
@@ -48,7 +48,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t2 (id1 INT, id2 VARCHAR(100), id3 BIGINT, value INT, PRIMARY KEY (id1, id2, id3)) ENGINE=rocksdb collate latin1_bin;
|
CREATE TABLE t2 (id1 INT, id2 VARCHAR(100), id3 BIGINT, value INT, PRIMARY KEY (id1, id2, id3)) ENGINE=rocksdb collate latin1_bin;
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
let $i = 1;
|
let $i = 1;
|
||||||
while ($i <= 100000) {
|
while ($i <= 10000) {
|
||||||
let $insert = INSERT INTO t2 VALUES($i, $i, $i, $i);
|
let $insert = INSERT INTO t2 VALUES($i, $i, $i, $i);
|
||||||
inc $i;
|
inc $i;
|
||||||
eval $insert;
|
eval $insert;
|
||||||
@@ -76,7 +76,7 @@ DROP TABLE t2;
|
|||||||
CREATE TABLE t3 (id1 BIGINT, id2 BIGINT, id3 BIGINT, id4 BIGINT, PRIMARY KEY (id1, id2, id3, id4)) ENGINE=rocksdb collate latin1_bin;
|
CREATE TABLE t3 (id1 BIGINT, id2 BIGINT, id3 BIGINT, id4 BIGINT, PRIMARY KEY (id1, id2, id3, id4)) ENGINE=rocksdb collate latin1_bin;
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
let $i = 1;
|
let $i = 1;
|
||||||
while ($i <= 100000) {
|
while ($i <= 10000) {
|
||||||
if ($i != 5000) {
|
if ($i != 5000) {
|
||||||
let $insert = INSERT INTO t3 VALUES(1, $i, $i, $i);
|
let $insert = INSERT INTO t3 VALUES(1, $i, $i, $i);
|
||||||
eval $insert;
|
eval $insert;
|
||||||
|
@@ -1,201 +0,0 @@
|
|||||||
--source include/have_rocksdb.inc
|
|
||||||
|
|
||||||
DELIMITER //;
|
|
||||||
CREATE FUNCTION is_compaction_stopped() RETURNS INT
|
|
||||||
BEGIN
|
|
||||||
SELECT variable_value INTO @cwb_1 FROM information_schema.global_status WHERE variable_name="rocksdb_compact_write_bytes";
|
|
||||||
SELECT SLEEP(3) INTO @a;
|
|
||||||
SELECT variable_value INTO @cwb_2 FROM information_schema.global_status WHERE variable_name="rocksdb_compact_write_bytes";
|
|
||||||
IF @cwb_2 > @cwb_1 THEN
|
|
||||||
RETURN 0;
|
|
||||||
END IF;
|
|
||||||
RETURN 1;
|
|
||||||
END//
|
|
||||||
DELIMITER ;//
|
|
||||||
|
|
||||||
|
|
||||||
let $datadir = `SELECT @@datadir`;
|
|
||||||
|
|
||||||
--disable_warnings
|
|
||||||
DROP TABLE IF EXISTS t1;
|
|
||||||
--enable_warnings
|
|
||||||
create table t1 (id int auto_increment, value int, value2 varchar(500), primary key (id), index(value2) comment 'cf_i') engine=rocksdb;
|
|
||||||
|
|
||||||
let $datadir = `SELECT @@datadir`;
|
|
||||||
|
|
||||||
# generating test data
|
|
||||||
--let MYSQLD_DATADIR=$datadir
|
|
||||||
perl;
|
|
||||||
my $row_count = 500000;
|
|
||||||
my $datadir = $ENV{'MYSQLD_DATADIR'};
|
|
||||||
open(DATA, ">", $datadir . "/se_loaddata.dat") || die "Can't open file: $!\n";
|
|
||||||
my $value = 'x' x 250;
|
|
||||||
for (my $i= 1; $i <= $row_count; $i++) {
|
|
||||||
print DATA "$i,$i,$value\n";
|
|
||||||
}
|
|
||||||
close(DATA);
|
|
||||||
EOF
|
|
||||||
|
|
||||||
SET SESSION rocksdb_bulk_load_allow_sk=1;
|
|
||||||
SET SESSION rocksdb_bulk_load=1;
|
|
||||||
|
|
||||||
--replace_result $datadir <DATADIR>
|
|
||||||
eval
|
|
||||||
LOAD DATA INFILE '$datadir/se_loaddata.dat' INTO TABLE t1
|
|
||||||
FIELDS TERMINATED BY ',' (id, value, value2);
|
|
||||||
|
|
||||||
SET SESSION rocksdb_bulk_load=0;
|
|
||||||
SET SESSION rocksdb_bulk_load_allow_sk=0;
|
|
||||||
|
|
||||||
--remove_file $datadir/se_loaddata.dat
|
|
||||||
|
|
||||||
|
|
||||||
--connect (con1,localhost,root,,)
|
|
||||||
--connect (con2,localhost,root,,)
|
|
||||||
|
|
||||||
# Note that finishing cancelling MC may take a few seconds after instruction,
|
|
||||||
# so testing with very large datasets or slowing down compaction is needed
|
|
||||||
# to make tests reliable. rocksdb_rate_limiter_bytes_per_sec=256k
|
|
||||||
# (in -master.opt) is an option to do the latter so that RocksDB has enough
|
|
||||||
# time to cancel compactions.
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # Cancelling MC, including pending MCs, by KILL statements
|
|
||||||
--echo #
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
SELECT variable_value into @executed_start FROM information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_cancelled";
|
|
||||||
|
|
||||||
connection con1;
|
|
||||||
--let $con1_id = `SELECT CONNECTION_ID()`
|
|
||||||
send SET GLOBAL rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
connection con2;
|
|
||||||
--let $con2_id = `SELECT CONNECTION_ID()`
|
|
||||||
set session rocksdb_manual_compaction_threads=2;
|
|
||||||
send SET GLOBAL rocksdb_compact_cf='cf_i';
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
let $wait_condition=
|
|
||||||
select variable_value = 1 from information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_running";
|
|
||||||
--source include/wait_condition.inc
|
|
||||||
let $wait_condition=
|
|
||||||
select variable_value = 1 from information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_pending";
|
|
||||||
--source include/wait_condition.inc
|
|
||||||
--disable_query_log
|
|
||||||
eval kill query $con1_id;
|
|
||||||
eval kill query $con2_id;
|
|
||||||
--enable_query_log
|
|
||||||
|
|
||||||
connection con1;
|
|
||||||
--error ER_INTERNAL_ERROR
|
|
||||||
reap;
|
|
||||||
|
|
||||||
connection con2;
|
|
||||||
--error ER_INTERNAL_ERROR
|
|
||||||
reap;
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
let $wait_condition=
|
|
||||||
select variable_value = 0 from information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_pending";
|
|
||||||
--source include/wait_condition.inc
|
|
||||||
|
|
||||||
SELECT variable_value into @executed_end FROM information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_cancelled";
|
|
||||||
SELECT @executed_end-@executed_start AS CANCELLED_MC;
|
|
||||||
|
|
||||||
let $wait_condition=
|
|
||||||
select is_compaction_stopped() = 1 from dual;
|
|
||||||
--source include/wait_condition.inc
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # Cancelling MC by global opt
|
|
||||||
--echo #
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
SELECT variable_value into @executed_start FROM information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_cancelled";
|
|
||||||
|
|
||||||
connection con1;
|
|
||||||
set session rocksdb_manual_compaction_threads=2;
|
|
||||||
send SET GLOBAL rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# waiting for compaction to actually start
|
|
||||||
connection default;
|
|
||||||
let $wait_condition=
|
|
||||||
select variable_value = 1 from information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_running";
|
|
||||||
--source include/wait_condition.inc
|
|
||||||
|
|
||||||
# Issuing second MC (pending)
|
|
||||||
connection con2;
|
|
||||||
send SET GLOBAL rocksdb_compact_cf='cf_i';
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
let $wait_condition=
|
|
||||||
select variable_value = 1 from information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_pending";
|
|
||||||
--source include/wait_condition.inc
|
|
||||||
set global rocksdb_cancel_manual_compactions=ON;
|
|
||||||
|
|
||||||
# first MC (running state) is cancelled
|
|
||||||
connection con1;
|
|
||||||
--error ER_INTERNAL_ERROR
|
|
||||||
reap;
|
|
||||||
|
|
||||||
# second MC (pending state) is also cancelled
|
|
||||||
connection con2;
|
|
||||||
--error ER_INTERNAL_ERROR
|
|
||||||
reap;
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
SELECT variable_value into @executed_end FROM information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_cancelled";
|
|
||||||
SELECT @executed_end-@executed_start AS CANCELLED_MC;
|
|
||||||
|
|
||||||
let $wait_condition=
|
|
||||||
select is_compaction_stopped() = 1 from dual;
|
|
||||||
--source include/wait_condition.inc
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # Cancelling OPTIMIZE TABLE by global opt
|
|
||||||
--echo #
|
|
||||||
connection con1;
|
|
||||||
send OPTIMIZE TABLE t1;
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
SELECT variable_value into @current_cwb FROM information_schema.global_status WHERE variable_name="rocksdb_compact_write_bytes";
|
|
||||||
|
|
||||||
let $wait_condition=
|
|
||||||
select count(*) = 1 from information_schema.processlist
|
|
||||||
where info IN ("OPTIMIZE TABLE t1");
|
|
||||||
--source include/wait_condition.inc
|
|
||||||
|
|
||||||
# compacting more than 100kb (at least a few percent)
|
|
||||||
let $wait_condition=
|
|
||||||
select variable_value > (@current_cwb + 100000) FROM information_schema.global_status WHERE variable_name="rocksdb_compact_write_bytes";
|
|
||||||
--source include/wait_condition.inc
|
|
||||||
|
|
||||||
set global rocksdb_cancel_manual_compactions=ON;
|
|
||||||
|
|
||||||
connection con1;
|
|
||||||
reap;
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
select 'PRIMARY' as idx, COUNT(*) as cnt FROM t1 FORCE INDEX (PRIMARY)
|
|
||||||
UNION ALL SELECT 'value2' as idx, COUNT(*) as cnt FROM t1 FORCE INDEX (value2);
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # Dropping Indexes complete even after cancelling MC
|
|
||||||
--echo #
|
|
||||||
INSERT INTO t1 (id) VALUES (null);
|
|
||||||
set global rocksdb_force_flush_memtable_now=ON;
|
|
||||||
|
|
||||||
SELECT variable_value into @current_cwb FROM information_schema.global_status WHERE variable_name="rocksdb_compact_write_bytes";
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
let $wait_condition=
|
|
||||||
select variable_value > @current_cwb FROM information_schema.global_status WHERE variable_name="rocksdb_compact_write_bytes";
|
|
||||||
set global rocksdb_cancel_manual_compactions=ON;
|
|
||||||
|
|
||||||
let $wait_condition = select count(*) = 0
|
|
||||||
as c from information_schema.rocksdb_global_info
|
|
||||||
where TYPE = 'DDL_DROP_INDEX_ONGOING';
|
|
||||||
--source include/wait_condition.inc
|
|
||||||
|
|
||||||
DROP FUNCTION is_compaction_stopped;
|
|
@@ -1,49 +0,0 @@
|
|||||||
--source include/have_rocksdb.inc
|
|
||||||
|
|
||||||
--connect (con1,localhost,root,,)
|
|
||||||
--connect (con2,localhost,root,,)
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
# longer than compaction wait timeout (60 seconds)
|
|
||||||
set global rocksdb_debug_manual_compaction_delay=80;
|
|
||||||
|
|
||||||
connection con1;
|
|
||||||
--let $con1_id = `SELECT CONNECTION_ID()`
|
|
||||||
send SET GLOBAL rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
let $wait_condition=
|
|
||||||
select variable_value = 1 from information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_running";
|
|
||||||
--source include/wait_condition.inc
|
|
||||||
|
|
||||||
connection con2;
|
|
||||||
--let $con2_id = `SELECT CONNECTION_ID()`
|
|
||||||
set session rocksdb_manual_compaction_threads=2;
|
|
||||||
send SET GLOBAL rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
let $wait_condition=
|
|
||||||
select variable_value = 1 from information_schema.global_status WHERE variable_name="rocksdb_manual_compactions_pending";
|
|
||||||
--source include/wait_condition.inc
|
|
||||||
--disable_query_log
|
|
||||||
eval kill query $con1_id;
|
|
||||||
eval kill query $con2_id;
|
|
||||||
--enable_query_log
|
|
||||||
|
|
||||||
# pending compaction can be cancelled instantly
|
|
||||||
connection con2;
|
|
||||||
--error ER_INTERNAL_ERROR
|
|
||||||
reap;
|
|
||||||
|
|
||||||
# running compaction hits timeout
|
|
||||||
connection con1;
|
|
||||||
--error ER_INTERNAL_ERROR
|
|
||||||
reap;
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
set global rocksdb_debug_manual_compaction_delay=0;
|
|
||||||
|
|
||||||
# next compaction starts after previous (running) compaction finishes
|
|
||||||
connection con1;
|
|
||||||
SET GLOBAL rocksdb_compact_cf='default';
|
|
@@ -69,7 +69,6 @@ gap_lock_issue254: MDEV-11735: MyRocks: Gap Lock detector support
|
|||||||
gap_lock_raise_error: MDEV-11735: MyRocks: Gap Lock detector support
|
gap_lock_raise_error: MDEV-11735: MyRocks: Gap Lock detector support
|
||||||
show_engine : MariaRocks: MariaDB doesnt support SHOW ENGINE rocksdb TRANSACTION STATUS
|
show_engine : MariaRocks: MariaDB doesnt support SHOW ENGINE rocksdb TRANSACTION STATUS
|
||||||
issue243_transactionStatus: MariaDB doesnt support SHOW ENGINE rocksdb TRANSACTION STATUS
|
issue243_transactionStatus: MariaDB doesnt support SHOW ENGINE rocksdb TRANSACTION STATUS
|
||||||
max_row_locks: MariaDB doesnt support SHOW ENGINE rocksdb TRANSACTION STATUS
|
|
||||||
rpl_row_not_found : MariaDB doesnt support slave_exec_mode='SEMI_STRICT'
|
rpl_row_not_found : MariaDB doesnt support slave_exec_mode='SEMI_STRICT'
|
||||||
rpl_row_not_found_rc : MariaDB doesnt support slave_exec_mode='SEMI_STRICT'
|
rpl_row_not_found_rc : MariaDB doesnt support slave_exec_mode='SEMI_STRICT'
|
||||||
|
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
--source include/have_rocksdb.inc
|
--source include/have_rocksdb.inc
|
||||||
|
|
||||||
|
call mtr.add_suppression("Column family 'cf1' not found");
|
||||||
|
call mtr.add_suppression("Column family 'rev:cf2' not found");
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
DROP TABLE IF EXISTS t1;
|
DROP TABLE IF EXISTS t1;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
@@ -7,6 +10,12 @@ DROP TABLE IF EXISTS t1;
|
|||||||
call mtr.add_suppression("Column family 'cf1' not found");
|
call mtr.add_suppression("Column family 'cf1' not found");
|
||||||
call mtr.add_suppression("Column family 'rev:cf2' not found");
|
call mtr.add_suppression("Column family 'rev:cf2' not found");
|
||||||
|
|
||||||
|
# Start from clean slate
|
||||||
|
set global rocksdb_compact_cf = 'cf1';
|
||||||
|
set global rocksdb_compact_cf = 'rev:cf2';
|
||||||
|
set global rocksdb_signal_drop_index_thread = 1;
|
||||||
|
--source include/restart_mysqld.inc
|
||||||
|
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
a int not null,
|
a int not null,
|
||||||
b int not null,
|
b int not null,
|
||||||
@@ -20,12 +29,6 @@ let $max = 50000;
|
|||||||
let $table = t1;
|
let $table = t1;
|
||||||
--source drop_table3_repopulate_table.inc
|
--source drop_table3_repopulate_table.inc
|
||||||
|
|
||||||
# Start from clean slate
|
|
||||||
set global rocksdb_compact_cf = 'cf1';
|
|
||||||
set global rocksdb_compact_cf = 'rev:cf2';
|
|
||||||
set global rocksdb_signal_drop_index_thread = 1;
|
|
||||||
--source include/restart_mysqld.inc
|
|
||||||
|
|
||||||
select variable_value into @a from information_schema.global_status where variable_name='rocksdb_compact_read_bytes';
|
select variable_value into @a from information_schema.global_status where variable_name='rocksdb_compact_read_bytes';
|
||||||
if ($truncate_table)
|
if ($truncate_table)
|
||||||
{
|
{
|
||||||
|
@@ -66,9 +66,6 @@ select * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO where TYPE = 'CF_FLAGS';
|
|||||||
|
|
||||||
CREATE TABLE t3 (a INT, PRIMARY KEY (a)) ENGINE=ROCKSDB;
|
CREATE TABLE t3 (a INT, PRIMARY KEY (a)) ENGINE=ROCKSDB;
|
||||||
insert into t3 (a) values (1), (2), (3);
|
insert into t3 (a) values (1), (2), (3);
|
||||||
|
|
||||||
SELECT IF(count(*) > 0, "TRUE", "FALSE") as metadata_exist FROM INFORMATION_SCHEMA.ROCKSDB_LIVE_FILES_METADATA where CF_NAME = 'default';
|
|
||||||
|
|
||||||
SET @ORIG_ROCKSDB_PAUSE_BACKGROUND_WORK = @@GLOBAL.ROCKSDB_PAUSE_BACKGROUND_WORK;
|
SET @ORIG_ROCKSDB_PAUSE_BACKGROUND_WORK = @@GLOBAL.ROCKSDB_PAUSE_BACKGROUND_WORK;
|
||||||
--let $t3_index_id = query_get_value(SELECT * FROM INFORMATION_SCHEMA.ROCKSDB_DDL WHERE TABLE_NAME = 't3', INDEX_NUMBER, 1)
|
--let $t3_index_id = query_get_value(SELECT * FROM INFORMATION_SCHEMA.ROCKSDB_DDL WHERE TABLE_NAME = 't3', INDEX_NUMBER, 1)
|
||||||
--let $t3_cf_id = query_get_value(SELECT * FROM INFORMATION_SCHEMA.ROCKSDB_DDL WHERE TABLE_NAME = 't3', COLUMN_FAMILY, 1)
|
--let $t3_cf_id = query_get_value(SELECT * FROM INFORMATION_SCHEMA.ROCKSDB_DDL WHERE TABLE_NAME = 't3', COLUMN_FAMILY, 1)
|
||||||
|
@@ -76,34 +76,5 @@ DELETE FROM t2 WHERE id1=10;
|
|||||||
--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/TIMESTAMP/ /(ACTIVE) [0-9]+ /\1 NUM / /(thread id) [0-9]+/\1 TID/ /0x[0-9a-f]+/PTR/ /(query id) [0-9]+/\1 QID/ /(root) [a-z ]+/\1 ACTION/
|
--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/TIMESTAMP/ /(ACTIVE) [0-9]+ /\1 NUM / /(thread id) [0-9]+/\1 TID/ /0x[0-9a-f]+/PTR/ /(query id) [0-9]+/\1 QID/ /(root) [a-z ]+/\1 ACTION/
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS;
|
SHOW ENGINE rocksdb TRANSACTION STATUS;
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
|
|
||||||
SET AUTOCOMMIT=1;
|
|
||||||
DROP TABLE t2;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Secondary Key with uniq key Tests
|
|
||||||
#
|
|
||||||
--disable_warnings
|
|
||||||
DROP TABLE IF EXISTS t2;
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
CREATE TABLE t2 (
|
|
||||||
id1 INT,
|
|
||||||
id2 INT,
|
|
||||||
value INT,
|
|
||||||
PRIMARY KEY (id1),
|
|
||||||
UNIQUE KEY (id2)
|
|
||||||
) ENGINE=rocksdb;
|
|
||||||
|
|
||||||
SET AUTOCOMMIT=0;
|
|
||||||
START TRANSACTION;
|
|
||||||
INSERT INTO t2 VALUES(1,2,0),(10,20,30);
|
|
||||||
UPDATE t2 SET value=3 WHERE id2=2;
|
|
||||||
DELETE FROM t2 WHERE id1=10;
|
|
||||||
|
|
||||||
--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/TIMESTAMP/ /(ACTIVE) [0-9]+ /\1 NUM / /(thread id) [0-9]+/\1 TID/ /0x[0-9a-f]+/PTR/ /(query id) [0-9]+/\1 QID/ /(root) [a-z ]+/\1 ACTION/
|
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS;
|
|
||||||
ROLLBACK;
|
|
||||||
|
|
||||||
SET AUTOCOMMIT=1;
|
SET AUTOCOMMIT=1;
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
|
@@ -15,18 +15,3 @@ EXPLAIN SELECT COUNT(*) FROM t1 FORCE INDEX(d);
|
|||||||
--echo # segfault here without the fix
|
--echo # segfault here without the fix
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX(d);
|
SELECT COUNT(*) FROM t1 FORCE INDEX(d);
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE `t1` (
|
|
||||||
`a` bigint(20) NOT NULL,
|
|
||||||
`b` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
|
|
||||||
`u` timestamp NOT NULL,
|
|
||||||
`d` bigint(20) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`a`,`b`),
|
|
||||||
KEY `d` (`d`)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='ttl_duration=1000;ttl_col=u';
|
|
||||||
INSERT INTO t1 VALUES (100, 'aaabbb', NOW(), 200);
|
|
||||||
--replace_column 9 #
|
|
||||||
EXPLAIN SELECT COUNT(*) FROM t1;
|
|
||||||
--echo # segfault here without the fix
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
@@ -1,2 +0,0 @@
|
|||||||
--rocksdb_max_subcompactions=1
|
|
||||||
--rocksdb_default_cf_options=target_file_size_base=100k;max_bytes_for_level_multiplier=1;max_bytes_for_level_base=1m;target_file_size_multiplier=1
|
|
@@ -1,52 +0,0 @@
|
|||||||
--source include/have_rocksdb.inc
|
|
||||||
|
|
||||||
DELIMITER //;
|
|
||||||
CREATE PROCEDURE compact_start()
|
|
||||||
BEGIN
|
|
||||||
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_compact_write_bytes';
|
|
||||||
END//
|
|
||||||
CREATE PROCEDURE compact_end()
|
|
||||||
BEGIN
|
|
||||||
select case when variable_value-@c > 0 then 'true' else 'false' end as checked from information_schema.global_status where variable_name='rocksdb_compact_write_bytes';
|
|
||||||
END//
|
|
||||||
DELIMITER ;//
|
|
||||||
|
|
||||||
--disable_warnings
|
|
||||||
DROP TABLE IF EXISTS t1;
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a int not null,
|
|
||||||
b int not null,
|
|
||||||
primary key (a,b),
|
|
||||||
key (b)
|
|
||||||
) ENGINE=RocksDB;
|
|
||||||
|
|
||||||
# Populate tables
|
|
||||||
let $max = 1000;
|
|
||||||
let $table = t1;
|
|
||||||
--source drop_table_repopulate_table.inc
|
|
||||||
|
|
||||||
# compact to move all data in files in Lmax level
|
|
||||||
set @@session.rocksdb_manual_compaction_bottommost_level='kSkip';
|
|
||||||
call compact_start();
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
call compact_end(); # should return true as compaction of lower levels is performed
|
|
||||||
|
|
||||||
# skip compaction of files in bottommost level i.e. Lmax->Lmax compaction and ensure rocksdb_compact_write_byte
|
|
||||||
# does not increase after compaction
|
|
||||||
set @@session.rocksdb_manual_compaction_bottommost_level='kSkip';
|
|
||||||
call compact_start();
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
call compact_end(); # should return false as files only in bottommost layer
|
|
||||||
|
|
||||||
# restore 'kForceOptimized' default setting and check that value of rocksdb_compact_write_byte increses after compaction
|
|
||||||
set @@session.rocksdb_manual_compaction_bottommost_level='kForceOptimized';
|
|
||||||
call compact_start();
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
call compact_end(); # should return true
|
|
||||||
|
|
||||||
# cleanup
|
|
||||||
DROP PROCEDURE compact_start;
|
|
||||||
DROP PROCEDURE compact_end;
|
|
||||||
drop table t1;
|
|
@@ -1,59 +0,0 @@
|
|||||||
--source include/have_rocksdb.inc
|
|
||||||
|
|
||||||
create table t1 (id1 bigint, id2 bigint, c1 bigint, c2 bigint, c3 bigint, c4 bigint, c5 bigint, c6 bigint, c7 bigint, primary key (id1, id2), index i(c1, c2));
|
|
||||||
--disable_query_log
|
|
||||||
let $i=0;
|
|
||||||
while ($i<1000)
|
|
||||||
{
|
|
||||||
inc $i;
|
|
||||||
eval insert t1(id1, id2, c1, c2, c3, c4, c5, c6, c7)
|
|
||||||
values($i, 0, $i, 0, 0, 0, 0, 0, $i);
|
|
||||||
}
|
|
||||||
--enable_query_log
|
|
||||||
|
|
||||||
# by default, no matching row should not have any row lock.
|
|
||||||
begin;
|
|
||||||
select * from t1 where c3=1 for update;
|
|
||||||
|
|
||||||
# This should report 0 row lock
|
|
||||||
--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/TIMESTAMP/ /(ACTIVE) [0-9]+ /\1 NUM / /(thread id) [0-9]+/\1 TID/ /0x[0-9a-f]+/PTR/ /(query id) [0-9]+/\1 QID/ /(root) [a-z ]+/\1 ACTION/
|
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS;
|
|
||||||
|
|
||||||
select * from t1 where c7 between 101 and 110 for update;
|
|
||||||
|
|
||||||
# This should report 10 row locks
|
|
||||||
--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/TIMESTAMP/ /(ACTIVE) [0-9]+ /\1 NUM / /(thread id) [0-9]+/\1 TID/ /0x[0-9a-f]+/PTR/ /(query id) [0-9]+/\1 QID/ /(root) [a-z ]+/\1 ACTION/
|
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS;
|
|
||||||
|
|
||||||
rollback;
|
|
||||||
|
|
||||||
set session rocksdb_lock_scanned_rows=on;
|
|
||||||
|
|
||||||
begin;
|
|
||||||
select * from t1 where c3=1 for update;
|
|
||||||
# This should report 1000 row locks
|
|
||||||
--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/TIMESTAMP/ /(ACTIVE) [0-9]+ /\1 NUM / /(thread id) [0-9]+/\1 TID/ /0x[0-9a-f]+/PTR/ /(query id) [0-9]+/\1 QID/ /(root) [a-z ]+/\1 ACTION/
|
|
||||||
SHOW ENGINE rocksdb TRANSACTION STATUS;
|
|
||||||
|
|
||||||
rollback;
|
|
||||||
set session rocksdb_lock_scanned_rows=off;
|
|
||||||
|
|
||||||
SET @start_rocksdb_max_row_locks = @@global.rocksdb_max_row_locks;
|
|
||||||
# small max row locks should not hit errors if number of locked rows is smaller
|
|
||||||
set global rocksdb_max_row_locks = 20;
|
|
||||||
select * from t1 where c3=1 for update;
|
|
||||||
select * from t1 where c7 between 101 and 110 for update;
|
|
||||||
|
|
||||||
set global rocksdb_max_row_locks = 5;
|
|
||||||
select * from t1 where c3=1 for update;
|
|
||||||
--error 1296
|
|
||||||
select * from t1 where c7 between 101 and 110 for update;
|
|
||||||
|
|
||||||
set session rocksdb_lock_scanned_rows=on;
|
|
||||||
--error 1296
|
|
||||||
select * from t1 where c3=1 for update;
|
|
||||||
--error 1296
|
|
||||||
select * from t1 where c7 between 101 and 110 for update;
|
|
||||||
set session rocksdb_lock_scanned_rows=off;
|
|
||||||
set @@global.rocksdb_max_row_locks = @start_rocksdb_max_row_locks;
|
|
||||||
drop table t1;
|
|
@@ -64,24 +64,10 @@ INSERT INTO t2 VALUES (1), (2);
|
|||||||
INSERT INTO t2 VALUES (3), (4);
|
INSERT INTO t2 VALUES (3), (4);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
# For write unprepared, writes can happen before commit, meaning some IOs can
|
SELECT COUNT(*) from INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT
|
||||||
# be attributed to specific statements/tables.
|
WHERE TABLE_NAME = 't2'
|
||||||
let $wup = `SELECT @@global.rocksdb_write_policy = 'write_unprepared'`;
|
AND STAT_TYPE = 'IO_WRITE_NANOS'
|
||||||
--disable_query_log
|
AND VALUE > 0;
|
||||||
if ($wup) {
|
|
||||||
SELECT COUNT(*) from INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT
|
|
||||||
WHERE TABLE_NAME = 't2'
|
|
||||||
AND STAT_TYPE = 'IO_WRITE_NANOS'
|
|
||||||
AND VALUE = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$wup) {
|
|
||||||
SELECT COUNT(*) from INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT
|
|
||||||
WHERE TABLE_NAME = 't2'
|
|
||||||
AND STAT_TYPE = 'IO_WRITE_NANOS'
|
|
||||||
AND VALUE > 0;
|
|
||||||
}
|
|
||||||
--enable_query_log
|
|
||||||
|
|
||||||
SELECT COUNT(*) from INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT_GLOBAL
|
SELECT COUNT(*) from INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT_GLOBAL
|
||||||
WHERE STAT_TYPE = 'IO_WRITE_NANOS' AND VALUE > 0;
|
WHERE STAT_TYPE = 'IO_WRITE_NANOS' AND VALUE > 0;
|
||||||
|
@@ -1150,10 +1150,9 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, a int) ENGINE=RocksDB;
|
|||||||
set @a=-1;
|
set @a=-1;
|
||||||
insert into t1 select (@a:=@a+1), 1234 from information_schema.session_variables limit 100;
|
insert into t1 select (@a:=@a+1), 1234 from information_schema.session_variables limit 100;
|
||||||
set @tmp1= @@rocksdb_max_row_locks;
|
set @tmp1= @@rocksdb_max_row_locks;
|
||||||
set GLOBAL rocksdb_max_row_locks= 20;
|
set rocksdb_max_row_locks= 20;
|
||||||
--error ER_GET_ERRMSG
|
--error ER_GET_ERRMSG
|
||||||
update t1 set a=a+10;
|
update t1 set a=a+10;
|
||||||
set @@global.rocksdb_max_row_locks = @tmp1;
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
--rocksdb_max_bottom_pri_background_compactions=1
|
|
@@ -1,30 +0,0 @@
|
|||||||
--source include/have_rocksdb.inc
|
|
||||||
--source include/linux.inc
|
|
||||||
|
|
||||||
--exec grep "Set 1 compaction thread(s) with lower scheduling priority." $MYSQLTEST_VARDIR/log/mysqld.1.err | tail -n 1 | wc -l
|
|
||||||
|
|
||||||
# Needs at least one compaction to happen to change priority
|
|
||||||
--disable_warnings
|
|
||||||
DROP TABLE IF EXISTS t1;
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a int not null,
|
|
||||||
b int not null,
|
|
||||||
primary key (a,b),
|
|
||||||
key (b)
|
|
||||||
) ENGINE=RocksDB;
|
|
||||||
|
|
||||||
# Populate tables
|
|
||||||
let $max = 1000;
|
|
||||||
let $table = t1;
|
|
||||||
--source drop_table_repopulate_table.inc
|
|
||||||
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
|
|
||||||
--let pid_file = query_get_value(SELECT @@pid_file, @@pid_file, 1)
|
|
||||||
--let print_bottom_priority = 1
|
|
||||||
--let expected_thread_counts = 1
|
|
||||||
--source rocksdb_bottom_pri_compaction_check.inc
|
|
||||||
|
|
||||||
drop table t1;
|
|
@@ -1 +0,0 @@
|
|||||||
--rocksdb_max_bottom_pri_background_compactions=5
|
|
@@ -1,27 +0,0 @@
|
|||||||
--source include/have_rocksdb.inc
|
|
||||||
--source include/linux.inc
|
|
||||||
|
|
||||||
--exec grep "Set 5 compaction thread(s) with lower scheduling priority." $MYSQLTEST_VARDIR/log/mysqld.1.err | tail -n 1 | wc -l
|
|
||||||
|
|
||||||
--let pid_file = query_get_value(SELECT @@pid_file, @@pid_file, 1)
|
|
||||||
--let print_bottom_priority = 0
|
|
||||||
--let expected_thread_counts = 5
|
|
||||||
--source rocksdb_bottom_pri_compaction_check.inc
|
|
||||||
|
|
||||||
--echo "Increasing bottom pri compaction threads online."
|
|
||||||
SET GLOBAL rocksdb_max_bottom_pri_background_compactions=10;
|
|
||||||
--exec grep "Set 10 compaction thread(s) with lower scheduling priority." $MYSQLTEST_VARDIR/log/mysqld.1.err | tail -n 1 | wc -l
|
|
||||||
--let expected_thread_counts = 10
|
|
||||||
--source rocksdb_bottom_pri_compaction_check.inc
|
|
||||||
|
|
||||||
|
|
||||||
--echo "Decreasing bottom pri compaction threads online."
|
|
||||||
SET GLOBAL rocksdb_max_bottom_pri_background_compactions=2;
|
|
||||||
--exec grep "Set 2 compaction thread(s) with lower scheduling priority." $MYSQLTEST_VARDIR/log/mysqld.1.err | tail -n 1 | wc -l
|
|
||||||
--let expected_thread_counts = 2
|
|
||||||
--source rocksdb_bottom_pri_compaction_check.inc
|
|
||||||
|
|
||||||
--error ER_ERROR_WHEN_EXECUTING_COMMAND
|
|
||||||
SET GLOBAL rocksdb_max_bottom_pri_background_compactions=0;
|
|
||||||
|
|
||||||
SET GLOBAL rocksdb_max_bottom_pri_background_compactions=5;
|
|
@@ -1,40 +0,0 @@
|
|||||||
perl;
|
|
||||||
$pid_file = $ENV{pid_file};
|
|
||||||
$print_bottom_priority = $ENV{print_bottom_priority};
|
|
||||||
$expected_thread_counts = $ENV{expected_thread_counts};
|
|
||||||
|
|
||||||
if(!defined($print_bottom_priority)) {
|
|
||||||
$print_bottom_priority = 0;
|
|
||||||
}
|
|
||||||
if(!defined($expected_thread_counts)) {
|
|
||||||
$expected_thread_counts = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get PID of mysqld
|
|
||||||
open(my $fh, '<', $pid_file) || die "Cannot open pid file $pid_file\n";
|
|
||||||
my $pid = <$fh>;
|
|
||||||
$pid =~ s/\s//g;
|
|
||||||
close($fh);
|
|
||||||
|
|
||||||
if ($pid eq "") {
|
|
||||||
die "Couldn't retrieve PID from PID file.\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($print_bottom_priority) {
|
|
||||||
print "Bottom thread priority:\n";
|
|
||||||
system("cat /proc/$pid/task/*/stat | grep bottom | awk '{print \$19}'");
|
|
||||||
}
|
|
||||||
|
|
||||||
print "Bottom thread counts:\n";
|
|
||||||
my $retries = 10;
|
|
||||||
for(my $i= 0; $i <= $retries; $i++) {
|
|
||||||
$count=`cat /proc/$pid/task/*/stat | grep bottom | wc -l`;
|
|
||||||
chomp($count);
|
|
||||||
if ($count != $expected_thread_counts) {
|
|
||||||
sleep(1);
|
|
||||||
} else {
|
|
||||||
print "$count\n";
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
@@ -72,22 +72,8 @@ insert into t values (4), (1);
|
|||||||
select * from t;
|
select * from t;
|
||||||
rollback;
|
rollback;
|
||||||
|
|
||||||
# In repeatable read, rollbacks in write unprepared confuses the snapshot
|
|
||||||
# validation logic into thinking that a write has happened, because it sees
|
|
||||||
# the rollback writes in the DB.
|
|
||||||
let $snapshot_conflict = `SELECT @@global.rocksdb_write_policy = 'write_unprepared' and @@session.tx_isolation = 'repeatable-read'`;
|
|
||||||
connection con2;
|
connection con2;
|
||||||
--disable_result_log
|
--reap
|
||||||
if ($snapshot_conflict)
|
|
||||||
{
|
|
||||||
--error ER_LOCK_DEADLOCK
|
|
||||||
--reap
|
|
||||||
}
|
|
||||||
if (!$snapshot_conflict)
|
|
||||||
{
|
|
||||||
--reap
|
|
||||||
}
|
|
||||||
--enable_result_log
|
|
||||||
rollback;
|
rollback;
|
||||||
|
|
||||||
connection con1;
|
connection con1;
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
--loose-enable-partition
|
|
@@ -1,115 +0,0 @@
|
|||||||
--source include/have_rocksdb.inc
|
|
||||||
--source include/have_debug_sync.inc
|
|
||||||
--source include/not_valgrind.inc
|
|
||||||
|
|
||||||
#
|
|
||||||
# Test truncation of tables with potential collation issues
|
|
||||||
#
|
|
||||||
|
|
||||||
set global rocksdb_strict_collation_exceptions = 't1,t2';
|
|
||||||
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
pk INT,
|
|
||||||
a VARCHAR(64),
|
|
||||||
PRIMARY KEY (pk),
|
|
||||||
KEY (a)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
|
||||||
|
|
||||||
INSERT INTO t1 VALUES (1, 'one');
|
|
||||||
RENAME TABLE t1 TO t1_trunc;
|
|
||||||
SELECT * FROM t1_trunc ORDER BY pk;
|
|
||||||
TRUNCATE TABLE t1_trunc;
|
|
||||||
SELECT * FROM t1_trunc;
|
|
||||||
|
|
||||||
CREATE TABLE t2 (
|
|
||||||
pk INT,
|
|
||||||
a VARCHAR(64),
|
|
||||||
PRIMARY KEY (pk),
|
|
||||||
KEY (a)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
|
|
||||||
PARTITION BY RANGE (pk) (
|
|
||||||
PARTITION p0 VALUES LESS THAN (3),
|
|
||||||
PARTITION p1 VALUES LESS THAN (6),
|
|
||||||
PARTITION p2 VALUES LESS THAN MAXVALUE
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO t2 VALUES (1, 'one'), (4, 'four'), (7, 'seven');
|
|
||||||
RENAME TABLE t2 to t2_trunc;
|
|
||||||
SELECT * FROM t2_trunc ORDER BY pk;
|
|
||||||
ALTER TABLE t2_trunc TRUNCATE PARTITION p0;
|
|
||||||
SELECT * FROM t2_trunc ORDER BY pk;
|
|
||||||
TRUNCATE TABLE t2_trunc;
|
|
||||||
SELECT * FROM t2_trunc ORDER BY pk;
|
|
||||||
|
|
||||||
set global rocksdb_strict_collation_exceptions = default;
|
|
||||||
|
|
||||||
DROP TABLE t1_trunc, t2_trunc;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Test truncation of tables with explicit failures during create
|
|
||||||
#
|
|
||||||
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
pk INT PRIMARY KEY
|
|
||||||
) ENGINE=ROCKSDB;
|
|
||||||
|
|
||||||
INSERT INTO t1 VALUES (1), (2);
|
|
||||||
SELECT * FROM t1;
|
|
||||||
|
|
||||||
SET DEBUG_DBUG = "+d,rocksdb_truncate_failure";
|
|
||||||
--error 1815
|
|
||||||
TRUNCATE TABLE t1;
|
|
||||||
SET DEBUG_DBUG = "-d,rocksdb_truncate_failure";
|
|
||||||
SELECT * FROM t1;
|
|
||||||
|
|
||||||
CREATE TABLE t2 (
|
|
||||||
a INT
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
PARTITION BY RANGE (a) (
|
|
||||||
PARTITION p0 VALUES LESS THAN (3),
|
|
||||||
PARTITION p1 VALUES LESS THAN (6),
|
|
||||||
PARTITION p2 VALUES LESS THAN MAXVALUE
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO t2 VALUES (1), (4), (7);
|
|
||||||
|
|
||||||
SET DEBUG_DBUG = "+d,rocksdb_truncate_failure";
|
|
||||||
--error 1815
|
|
||||||
TRUNCATE TABLE t2;
|
|
||||||
--error 1815
|
|
||||||
ALTER TABLE t2 TRUNCATE PARTITION p1;
|
|
||||||
SET DEBUG_DBUG = "-d,rocksdb_truncate_failure";
|
|
||||||
SELECT * FROM t2;
|
|
||||||
|
|
||||||
DROP TABLE t1, t2;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Crash the server during server truncation and verify the table is removed
|
|
||||||
#
|
|
||||||
|
|
||||||
CREATE TABLE t1_crash (
|
|
||||||
pk INT PRIMARY KEY
|
|
||||||
) ENGINE=ROCKSDB;
|
|
||||||
|
|
||||||
INSERT INTO t1_crash VALUES (100), (1000);
|
|
||||||
SELECT * FROM t1_crash;
|
|
||||||
|
|
||||||
--let LOG=$MYSQLTEST_VARDIR/tmp/rocksdb_truncate_failure.err
|
|
||||||
--exec echo "restart:--rocksdb_validate_tables=2 --log-error=$LOG" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
|
||||||
|
|
||||||
SET DEBUG_DBUG = "+d,rocksdb_truncate_failure_crash";
|
|
||||||
--error 2013
|
|
||||||
TRUNCATE TABLE t1_crash;
|
|
||||||
--source include/wait_until_disconnected.inc
|
|
||||||
--enable_reconnect
|
|
||||||
--source include/wait_until_connected_again.inc
|
|
||||||
--disable_reconnect
|
|
||||||
--exec grep 'Removing truncated leftover' $LOG | cut -d] -f2
|
|
||||||
DROP TABLE t1_crash;
|
|
||||||
|
|
||||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
|
||||||
shutdown_server;
|
|
||||||
--source include/wait_until_disconnected.inc
|
|
||||||
--enable_reconnect
|
|
||||||
--source include/wait_until_connected_again.inc
|
|
||||||
--disable_reconnect
|
|
@@ -1,547 +0,0 @@
|
|||||||
#
|
|
||||||
# Specify the timestamp column type using $coltype
|
|
||||||
# and the timestamp generator using $timegen
|
|
||||||
#
|
|
||||||
|
|
||||||
# Basic TTL test
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
`a` binary(8) NOT NULL,
|
|
||||||
`b` varbinary(64) NOT NULL,
|
|
||||||
`c` varbinary(256) NOT NULL,
|
|
||||||
`ts` $coltype NOT NULL,
|
|
||||||
`value` mediumblob NOT NULL,
|
|
||||||
PRIMARY KEY (`b`,`a`,`c`)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values ('a', 'b', 'c', $timegen, 'd');
|
|
||||||
eval INSERT INTO t1 values ('d', 'e', 'f', $timegen, 'g');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# column before TTL in value
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
PRIMARY KEY (a)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values (1, 3, $timegen, 5);
|
|
||||||
eval INSERT INTO t1 values (2, 4, $timegen, 6);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# multi-part PK w/ TTL
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
PRIMARY KEY (a,c)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values (1, 3, 5, $timegen);
|
|
||||||
eval INSERT INTO t1 values (2, 4, 6, $timegen);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# multi-part PK w/ TTL
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
PRIMARY KEY (a,c)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values (1, 3, 5, $timegen);
|
|
||||||
eval INSERT INTO t1 values (2, 4, 6, $timegen);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# nullable column(s) before TTL
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int,
|
|
||||||
c int,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
PRIMARY KEY (a)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values (1, NULL, NULL, $timegen);
|
|
||||||
eval INSERT INTO t1 values (2, NULL, NULL, $timegen);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# variable len columns + null column(s) before TTL
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
`a` binary(8) NOT NULL,
|
|
||||||
`b` varbinary(64),
|
|
||||||
`c` varbinary(256),
|
|
||||||
`ts` $coltype NOT NULL,
|
|
||||||
`value` mediumblob NOT NULL,
|
|
||||||
PRIMARY KEY (`a`)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values ('a', NULL, 'bc', $timegen, 'd');
|
|
||||||
eval INSERT INTO t1 values ('d', 'efghijk', NULL, $timegen, 'l');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# TTL implicitly generated (no ttl column)
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
PRIMARY KEY (a)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
INSERT INTO t1 values (1, 3, 5);
|
|
||||||
INSERT INTO t1 values (2, 4, 6);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# TTL field as the PK
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a int,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
PRIMARY KEY (a, ts)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=5;ttl_col=ts;';
|
|
||||||
|
|
||||||
eval INSERT INTO t1 values (1, $timegen);
|
|
||||||
eval INSERT INTO t1 values (2, $timegen);
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = -10;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
# should all still be there..
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 10;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
|
|
||||||
# TTL field inside multi-part pk
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
PRIMARY KEY (a, ts)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values (1, 3, $timegen, 5);
|
|
||||||
eval INSERT INTO t1 values (2, 4, $timegen, 6);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# TTL field inside key with variable length things..
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
`a` binary(8) NOT NULL,
|
|
||||||
`b` varbinary(64),
|
|
||||||
`c` varbinary(256),
|
|
||||||
`ts` $coltype NOT NULL,
|
|
||||||
`value` mediumblob NOT NULL,
|
|
||||||
PRIMARY KEY (`a`, `ts`)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values ('a', NULL, 'bc', $timegen, 'd');
|
|
||||||
eval INSERT INTO t1 values ('de', 'fghijk', NULL, $timegen, 'l');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# TTL test where you compact (values still exist), real_sleep, then compact again,
|
|
||||||
# values should now be gone.
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a INT NOT NULL,
|
|
||||||
b varbinary(64) NOT NULL,
|
|
||||||
c varbinary(256) NOT NULL,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
value mediumblob NOT NULL,
|
|
||||||
PRIMARY KEY (b,a,c)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
|
||||||
COMMENT='ttl_duration=10;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
eval INSERT INTO t1 values (1, 'b', 'c', $timegen, 'd');
|
|
||||||
eval INSERT INTO t1 values (2, 'e', 'f', $timegen, 'g');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 300;
|
|
||||||
eval INSERT INTO t1 values (3, 'i', 'j', $timegen, 'k');
|
|
||||||
eval INSERT INTO t1 values (4, 'm', 'n', $timegen, 'o');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
# Nothing should get removed here.
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = -3600;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1;
|
|
||||||
|
|
||||||
# 1 and 2 should get removed here.
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1;
|
|
||||||
|
|
||||||
# 3 and 4 should get removed here.
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1;
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# TTL field with nullable ttl column (should fail)
|
|
||||||
--error ER_RDB_TTL_COL_FORMAT
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) UNSIGNED NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
ts $coltype,
|
|
||||||
PRIMARY KEY (a,c)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
# TTL field with non 8-bit integer column (should fail)
|
|
||||||
--error ER_RDB_TTL_COL_FORMAT
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) UNSIGNED NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
ts int,
|
|
||||||
PRIMARY KEY (a,c)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
# TTL duration as some random garbage value
|
|
||||||
--error ER_RDB_TTL_DURATION_FORMAT
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) UNSIGNED NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
PRIMARY KEY (a,c)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=abc;';
|
|
||||||
|
|
||||||
# TTL col is some column outside of the table
|
|
||||||
--error ER_RDB_TTL_COL_FORMAT
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) UNSIGNED NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
PRIMARY KEY (a,c)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=abc;';
|
|
||||||
|
|
||||||
# TTL col must have accompanying duration
|
|
||||||
--error ER_RDB_TTL_COL_FORMAT
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) UNSIGNED NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
PRIMARY KEY (a,c)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_col=abc;';
|
|
||||||
|
|
||||||
# Make sure it doesn't filter out things early
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
PRIMARY KEY (a)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=500;';
|
|
||||||
|
|
||||||
INSERT INTO t1 values (1);
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Testing altering table comment with updated TTL duration
|
|
||||||
# This should trigger a rebuild of the table
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a INT PRIMARY KEY
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=100;';
|
|
||||||
|
|
||||||
INSERT INTO t1 values (1);
|
|
||||||
SELECT * FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
ALTER TABLE t1 COMMENT = 'ttl_duration=1';
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SHOW CREATE TABLE t1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Tables with hidden PK and SK disabled
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a INT PRIMARY KEY,
|
|
||||||
b INT
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=100;';
|
|
||||||
|
|
||||||
--error ER_RDB_TTL_UNSUPPORTED
|
|
||||||
ALTER TABLE t1 DROP PRIMARY KEY;
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Test replacing PK, ttl should still work after
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a INT PRIMARY KEY,
|
|
||||||
b INT
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=5;';
|
|
||||||
|
|
||||||
INSERT INTO t1 VALUES (1,1);
|
|
||||||
INSERT INTO t1 VALUES (2,2);
|
|
||||||
|
|
||||||
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(b);
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = -3600;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
|
|
||||||
--sorted_result
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
|
|
||||||
--sorted_result
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Make sure table comment filled with other text before/after will work
|
|
||||||
# (basically, it needs semicolon before and after)
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a $coltype NOT NULL,
|
|
||||||
b int,
|
|
||||||
PRIMARY KEY (a,b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='asdadfasdfsadfadf ;ttl_duration=1; asfasdfasdfadfa';
|
|
||||||
eval INSERT INTO t1 values ($timegen, 1);
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
ALTER TABLE t1 COMMENT = 'adsf;;ttl_duration=5;asfasdfa;ttl_col=a;asdfasdf;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 300;
|
|
||||||
eval INSERT INTO t1 values ($timegen, 2);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
|
|
||||||
# nothing removed here
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
# all removed here
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Test to make sure that TTL retains original timestamp during update
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
PRIMARY KEY (a)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=5;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
INSERT INTO t1 values (1);
|
|
||||||
INSERT INTO t1 values (3);
|
|
||||||
INSERT INTO t1 values (5);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 300;
|
|
||||||
INSERT INTO t1 values (7);
|
|
||||||
INSERT INTO t1 values (9);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
UPDATE t1 SET a=a+1;
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# 1,3,5 should be dropped
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# test behaviour on update with TTL column, TTL time can be updated here.
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a INT,
|
|
||||||
b $coltype NOT NULL,
|
|
||||||
PRIMARY KEY (a)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=5;ttl_col=b;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
eval INSERT INTO t1 values (1, $timegen);
|
|
||||||
eval INSERT INTO t1 values (3, $timegen);
|
|
||||||
eval INSERT INTO t1 values (5, $timegen);
|
|
||||||
eval INSERT INTO t1 values (7, $timegen);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 300;
|
|
||||||
eval UPDATE t1 SET b=$timegen WHERE a < 4;
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# 5 and 7 should be gone here
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Test rows expired stat variable and disable ttl variable
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
PRIMARY KEY (a)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
INSERT INTO t1 values (1);
|
|
||||||
INSERT INTO t1 values (2);
|
|
||||||
INSERT INTO t1 values (3);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
set global rocksdb_enable_ttl=0;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
|
||||||
set global rocksdb_enable_ttl=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
select variable_value-@c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
|
|
||||||
# Table with TTL won't increment rows expired when no records have been
|
|
||||||
# compacted
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
PRIMARY KEY (a)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=100;';
|
|
||||||
|
|
||||||
INSERT INTO t1 values (1);
|
|
||||||
INSERT INTO t1 values (2);
|
|
||||||
INSERT INTO t1 values (3);
|
|
||||||
|
|
||||||
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
select variable_value-@c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
@@ -1,18 +1,545 @@
|
|||||||
--source include/have_debug.inc
|
--source include/have_debug.inc
|
||||||
--source include/have_rocksdb.inc
|
--source include/have_rocksdb.inc
|
||||||
|
|
||||||
--let $coltype=bigint(20) UNSIGNED
|
# Basic TTL test
|
||||||
--let $timegen=UNIX_TIMESTAMP()
|
CREATE TABLE t1 (
|
||||||
--source ttl_primary.inc
|
`a` binary(8) NOT NULL,
|
||||||
|
`b` varbinary(64) NOT NULL,
|
||||||
|
`c` varbinary(256) NOT NULL,
|
||||||
|
`ts` bigint(20) UNSIGNED NOT NULL,
|
||||||
|
`value` mediumblob NOT NULL,
|
||||||
|
PRIMARY KEY (`b`,`a`,`c`)
|
||||||
|
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
--let $coltype=TIMESTAMP
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
--let $timegen=NOW()
|
INSERT INTO t1 values ('a', 'b', 'c', UNIX_TIMESTAMP(), 'd');
|
||||||
--source ttl_primary.inc
|
INSERT INTO t1 values ('d', 'e', 'f', UNIX_TIMESTAMP(), 'g');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
--let $coltype=TIMESTAMP DEFAULT NOW()
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
--let $timegen=NOW()
|
SELECT COUNT(*) FROM t1;
|
||||||
--source ttl_primary.inc
|
DROP TABLE t1;
|
||||||
|
|
||||||
--let $coltype=TIMESTAMP(6)
|
# column before TTL in value
|
||||||
--let $timegen=NOW()
|
CREATE TABLE t1 (
|
||||||
--source ttl_primary.inc
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
PRIMARY KEY (a)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1, 3, UNIX_TIMESTAMP(), 5);
|
||||||
|
INSERT INTO t1 values (2, 4, UNIX_TIMESTAMP(), 6);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# multi-part PK w/ TTL
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
PRIMARY KEY (a,c)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1, 3, 5, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (2, 4, 6, UNIX_TIMESTAMP());
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# multi-part PK w/ TTL
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
PRIMARY KEY (a,c)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1, 3, 5, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (2, 4, 6, UNIX_TIMESTAMP());
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# nullable column(s) before TTL
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int,
|
||||||
|
c int,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
PRIMARY KEY (a)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1, NULL, NULL, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (2, NULL, NULL, UNIX_TIMESTAMP());
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# variable len columns + null column(s) before TTL
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` binary(8) NOT NULL,
|
||||||
|
`b` varbinary(64),
|
||||||
|
`c` varbinary(256),
|
||||||
|
`ts` bigint(20) UNSIGNED NOT NULL,
|
||||||
|
`value` mediumblob NOT NULL,
|
||||||
|
PRIMARY KEY (`a`)
|
||||||
|
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values ('a', NULL, 'bc', UNIX_TIMESTAMP(), 'd');
|
||||||
|
INSERT INTO t1 values ('d', 'efghijk', NULL, UNIX_TIMESTAMP(), 'l');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# TTL implicitly generated (no ttl column)
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
PRIMARY KEY (a)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1, 3, 5);
|
||||||
|
INSERT INTO t1 values (2, 4, 6);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# TTL field as the PK
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a int,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
PRIMARY KEY (a, ts)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=5;ttl_col=ts;';
|
||||||
|
|
||||||
|
INSERT INTO t1 values (1, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (2, UNIX_TIMESTAMP());
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = -10;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
# should all still be there..
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 10;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
|
||||||
|
# TTL field inside multi-part pk
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
PRIMARY KEY (a, ts)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1, 3, UNIX_TIMESTAMP(), 5);
|
||||||
|
INSERT INTO t1 values (2, 4, UNIX_TIMESTAMP(), 6);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# TTL field inside key with variable length things..
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` binary(8) NOT NULL,
|
||||||
|
`b` varbinary(64),
|
||||||
|
`c` varbinary(256),
|
||||||
|
`ts` bigint(20) UNSIGNED NOT NULL,
|
||||||
|
`value` mediumblob NOT NULL,
|
||||||
|
PRIMARY KEY (`a`, `ts`)
|
||||||
|
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values ('a', NULL, 'bc', UNIX_TIMESTAMP(), 'd');
|
||||||
|
INSERT INTO t1 values ('de', 'fghijk', NULL, UNIX_TIMESTAMP(), 'l');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# TTL test where you compact (values still exist), real_sleep, then compact again,
|
||||||
|
# values should now be gone.
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT NOT NULL,
|
||||||
|
b varbinary(64) NOT NULL,
|
||||||
|
c varbinary(256) NOT NULL,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
value mediumblob NOT NULL,
|
||||||
|
PRIMARY KEY (b,a,c)
|
||||||
|
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
||||||
|
COMMENT='ttl_duration=10;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -300;
|
||||||
|
INSERT INTO t1 values (1, 'b', 'c', UNIX_TIMESTAMP(), 'd');
|
||||||
|
INSERT INTO t1 values (2, 'e', 'f', UNIX_TIMESTAMP(), 'g');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 300;
|
||||||
|
INSERT INTO t1 values (3, 'i', 'j', UNIX_TIMESTAMP(), 'k');
|
||||||
|
INSERT INTO t1 values (4, 'm', 'n', UNIX_TIMESTAMP(), 'o');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
|
# Nothing should get removed here.
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = -3600;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1;
|
||||||
|
|
||||||
|
# 1 and 2 should get removed here.
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1;
|
||||||
|
|
||||||
|
# 3 and 4 should get removed here.
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# TTL field with nullable ttl column (should fail)
|
||||||
|
--error ER_RDB_TTL_COL_FORMAT
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) UNSIGNED NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
ts bigint(20),
|
||||||
|
PRIMARY KEY (a,c)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
# TTL field with non 8-bit integer column (should fail)
|
||||||
|
--error ER_RDB_TTL_COL_FORMAT
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) UNSIGNED NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
ts int,
|
||||||
|
PRIMARY KEY (a,c)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
# TTL duration as some random garbage value
|
||||||
|
--error ER_RDB_TTL_DURATION_FORMAT
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) UNSIGNED NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
PRIMARY KEY (a,c)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=abc;';
|
||||||
|
|
||||||
|
# TTL col is some column outside of the table
|
||||||
|
--error ER_RDB_TTL_COL_FORMAT
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) UNSIGNED NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
PRIMARY KEY (a,c)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=abc;';
|
||||||
|
|
||||||
|
# TTL col must have accompanying duration
|
||||||
|
--error ER_RDB_TTL_COL_FORMAT
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) UNSIGNED NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
PRIMARY KEY (a,c)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_col=abc;';
|
||||||
|
|
||||||
|
# Make sure it doesn't filter out things early
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
PRIMARY KEY (a)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=500;';
|
||||||
|
|
||||||
|
INSERT INTO t1 values (1);
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Testing altering table comment with updated TTL duration
|
||||||
|
# This should trigger a rebuild of the table
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT PRIMARY KEY
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=100;';
|
||||||
|
|
||||||
|
INSERT INTO t1 values (1);
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -300;
|
||||||
|
ALTER TABLE t1 COMMENT = 'ttl_duration=1';
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Tables with hidden PK and SK disabled
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT PRIMARY KEY,
|
||||||
|
b INT
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=100;';
|
||||||
|
|
||||||
|
--error ER_RDB_TTL_UNSUPPORTED
|
||||||
|
ALTER TABLE t1 DROP PRIMARY KEY;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Test replacing PK, ttl should still work after
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT PRIMARY KEY,
|
||||||
|
b INT
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=5;';
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES (1,1);
|
||||||
|
INSERT INTO t1 VALUES (2,2);
|
||||||
|
|
||||||
|
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(b);
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = -3600;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set @@global.rocksdb_compact_cf = 'default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
||||||
|
set @@global.rocksdb_compact_cf = 'default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Make sure table comment filled with other text before/after will work
|
||||||
|
# (basically, it needs semicolon before and after)
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) UNSIGNED NOT NULL,
|
||||||
|
b int,
|
||||||
|
PRIMARY KEY (a,b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='asdadfasdfsadfadf ;ttl_duration=1; asfasdfasdfadfa';
|
||||||
|
INSERT INTO t1 values (UNIX_TIMESTAMP(), 1);
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
ALTER TABLE t1 COMMENT = 'adsf;;ttl_duration=5;asfasdfa;ttl_col=a;asdfasdf;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 300;
|
||||||
|
INSERT INTO t1 values (UNIX_TIMESTAMP(), 2);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
|
||||||
|
# nothing removed here
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
# all removed here
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Test to make sure that TTL retains original timestamp during update
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
PRIMARY KEY (a)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=5;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -300;
|
||||||
|
INSERT INTO t1 values (1);
|
||||||
|
INSERT INTO t1 values (3);
|
||||||
|
INSERT INTO t1 values (5);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 300;
|
||||||
|
INSERT INTO t1 values (7);
|
||||||
|
INSERT INTO t1 values (9);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
|
UPDATE t1 SET a=a+1;
|
||||||
|
--sorted_result
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
# 1,3,5 should be dropped
|
||||||
|
--sorted_result
|
||||||
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# test behaviour on update with TTL column, TTL time can be updated here.
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT,
|
||||||
|
b bigint(20) UNSIGNED NOT NULL,
|
||||||
|
PRIMARY KEY (a)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=5;ttl_col=b;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -300;
|
||||||
|
INSERT INTO t1 values (1, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (3, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (5, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (7, UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 300;
|
||||||
|
UPDATE t1 SET b=UNIX_TIMESTAMP() WHERE a < 4;
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
# 5 and 7 should be gone here
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Test rows expired stat variable and disable ttl variable
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
PRIMARY KEY (a)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1);
|
||||||
|
INSERT INTO t1 values (2);
|
||||||
|
INSERT INTO t1 values (3);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
|
set global rocksdb_enable_ttl=0;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
||||||
|
set global rocksdb_enable_ttl=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
select variable_value-@c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
|
||||||
|
# Table with TTL won't increment rows expired when no records have been
|
||||||
|
# compacted
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
PRIMARY KEY (a)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=100;';
|
||||||
|
|
||||||
|
INSERT INTO t1 values (1);
|
||||||
|
INSERT INTO t1 values (2);
|
||||||
|
INSERT INTO t1 values (3);
|
||||||
|
|
||||||
|
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
select variable_value-@c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
@@ -1,255 +0,0 @@
|
|||||||
#
|
|
||||||
# Specify the timestamp column type using $coltype
|
|
||||||
# and the timestamp generator using $timegen
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# Create a table with multiple partitions, but in the comment don't specify
|
|
||||||
# that per-partition based column families (CF) should be created. Expect that
|
|
||||||
# default CF will be used and new one won't be created.
|
|
||||||
#
|
|
||||||
# In addition, specify TTL on one of the partitions. Insert a few things
|
|
||||||
# inside all the partitions, verify after compaction that the rows inside the
|
|
||||||
# partition with TTL has disappeared.
|
|
||||||
#
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
|
||||||
PRIMARY KEY (`c1`)
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="custom_p0_ttl_duration=1;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 4, 7),
|
|
||||||
PARTITION custom_p1 VALUES IN (2, 5, 8),
|
|
||||||
PARTITION custom_p2 VALUES IN (3, 6, 9)
|
|
||||||
);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -3600;
|
|
||||||
INSERT INTO t1 values (1);
|
|
||||||
INSERT INTO t1 values (2);
|
|
||||||
INSERT INTO t1 values (3);
|
|
||||||
INSERT INTO t1 values (4);
|
|
||||||
INSERT INTO t1 values (5);
|
|
||||||
INSERT INTO t1 values (6);
|
|
||||||
INSERT INTO t1 values (7);
|
|
||||||
INSERT INTO t1 values (8);
|
|
||||||
INSERT INTO t1 values (9);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# 1,4, and 7 should be gone
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Create a table with multiple partitions and request for separate CF to be
|
|
||||||
# created per every partition. As a result we expect three different CF-s to be
|
|
||||||
# created.
|
|
||||||
#
|
|
||||||
# In addition, specify TTL on some of the partitions. Insert a few things
|
|
||||||
# inside all the partitions, verify after compaction that the rows inside the
|
|
||||||
# partition with TTL has disappeared.
|
|
||||||
#
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
|
||||||
c2 INT,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
PRIMARY KEY (`c1`, `c2`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=my_custom_cf;custom_p2_cfname=baz'
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="custom_p0_ttl_duration=1;custom_p1_ttl_duration=7;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 4, 7),
|
|
||||||
PARTITION custom_p1 VALUES IN (2, 5, 8),
|
|
||||||
PARTITION custom_p2 VALUES IN (3, 6, 9)
|
|
||||||
);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -1200;
|
|
||||||
INSERT INTO t1 values (1,1,'a');
|
|
||||||
INSERT INTO t1 values (4,4,'aaaa');
|
|
||||||
INSERT INTO t1 values (7,7,'aaaaaaa');
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 1200;
|
|
||||||
INSERT INTO t1 values (2,2,'aa');
|
|
||||||
INSERT INTO t1 values (3,3,'aaa');
|
|
||||||
INSERT INTO t1 values (5,5,'aaaaa');
|
|
||||||
INSERT INTO t1 values (6,6,'aaaaaa');
|
|
||||||
INSERT INTO t1 values (8,8,'aaaaaaaa');
|
|
||||||
INSERT INTO t1 values (9,9,'aaaaaaaaa');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'my_custom_cf';
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1;
|
|
||||||
|
|
||||||
# Now 2,5,8 should be removed (this verifies that TTL is only operating on the
|
|
||||||
# particular CF.
|
|
||||||
set @@global.rocksdb_compact_cf = 'my_custom_cf';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1;
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Create a table with CF-s/TTL per partition and verify that ALTER TABLE + DROP
|
|
||||||
# PRIMARY, ADD PRIMARY work for that scenario and data is persisted/filtered as
|
|
||||||
# expected.
|
|
||||||
#
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 INT,
|
|
||||||
c2 INT,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
event DATE,
|
|
||||||
PRIMARY KEY (`c1`, `c2`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="custom_p0_ttl_duration=9999;custom_p2_ttl_duration=5;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 2, 3),
|
|
||||||
PARTITION custom_p1 VALUES IN (4, 5, 6),
|
|
||||||
PARTITION custom_p2 VALUES IN (7, 8, 9)
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO t1 VALUES (1, 1, "one", null);
|
|
||||||
INSERT INTO t1 VALUES (2, 2, "two", null);
|
|
||||||
INSERT INTO t1 VALUES (3, 3, "three", null);
|
|
||||||
|
|
||||||
INSERT INTO t1 VALUES (4, 4, "four", null);
|
|
||||||
INSERT INTO t1 VALUES (5, 5, "five", null);
|
|
||||||
INSERT INTO t1 VALUES (6, 6, "six", null);
|
|
||||||
|
|
||||||
INSERT INTO t1 VALUES (7, 7, "seven", null);
|
|
||||||
INSERT INTO t1 VALUES (8, 8, "eight", null);
|
|
||||||
INSERT INTO t1 VALUES (9, 9, "nine", null);
|
|
||||||
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1;
|
|
||||||
|
|
||||||
# TTL should be reset after alter table
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 600;
|
|
||||||
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(`c2`,`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;';
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SHOW CREATE TABLE t1;
|
|
||||||
|
|
||||||
# ...so nothing should be gone here
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 100;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 1200;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1;
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Create a table with non-partitioned TTL duration, with partitioned TTL
|
|
||||||
# columns
|
|
||||||
#
|
|
||||||
# In this case the same TTL duration will be applied across different TTL
|
|
||||||
# columns in different partitions, except for in p2 where we override the ttl
|
|
||||||
# duration.
|
|
||||||
#
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
c1 BIGINT,
|
|
||||||
c2 $coltype NOT NULL,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
event DATE,
|
|
||||||
PRIMARY KEY (`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="ttl_duration=1;custom_p1_ttl_duration=100;custom_p1_ttl_col=c2;custom_p2_ttl_duration=5000;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 2, 3),
|
|
||||||
PARTITION custom_p1 VALUES IN (4, 5, 6),
|
|
||||||
PARTITION custom_p2 VALUES IN (7, 8, 9)
|
|
||||||
);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
eval INSERT INTO t1 VALUES (1, $timegen, "one", null);
|
|
||||||
eval INSERT INTO t1 VALUES (2, $timegen, "two", null);
|
|
||||||
eval INSERT INTO t1 VALUES (3, $timegen, "three", null);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
eval INSERT INTO t1 VALUES (4, $timegen, "four", null);
|
|
||||||
eval INSERT INTO t1 VALUES (5, $timegen, "five", null);
|
|
||||||
eval INSERT INTO t1 VALUES (6, $timegen, "six", null);
|
|
||||||
|
|
||||||
eval INSERT INTO t1 VALUES (7, $timegen, "seven", null);
|
|
||||||
eval INSERT INTO t1 VALUES (8, $timegen, "eight", null);
|
|
||||||
eval INSERT INTO t1 VALUES (9, $timegen, "nine", null);
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set @@global.rocksdb_compact_cf = 'bar';
|
|
||||||
|
|
||||||
# here we expect only 1,2,3 to be gone, ttl implicit.
|
|
||||||
--sorted_result
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
|
|
||||||
# here we expect only 4,5,6 to be gone, ttl based on column c2.
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 600;
|
|
||||||
set @@global.rocksdb_compact_cf = 'bar';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
--sorted_result
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
|
|
||||||
# at this point only 7,8,9 should be left..
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Make sure non-partitioned TTL duration/col still works on table with
|
|
||||||
# partitions.
|
|
||||||
#
|
|
||||||
# Simultaneously tests when TTL col is part of the key in partitioned table
|
|
||||||
#
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
c1 BIGINT,
|
|
||||||
c2 $coltype NOT NULL,
|
|
||||||
PRIMARY KEY (`c1`, `c2`)
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="ttl_duration=100;ttl_col=c2;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1),
|
|
||||||
PARTITION custom_p1 VALUES IN (2),
|
|
||||||
PARTITION custom_p2 VALUES IN (3)
|
|
||||||
);
|
|
||||||
|
|
||||||
eval INSERT INTO t1 values (1, $timegen);
|
|
||||||
eval INSERT INTO t1 values (2, $timegen);
|
|
||||||
eval INSERT INTO t1 values (3, $timegen);
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# everything should still be here
|
|
||||||
--sorted_result
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 300;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
# everything should now be gone
|
|
||||||
--sorted_result
|
|
||||||
SELECT c1 FROM t1;
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
@@ -2,18 +2,253 @@
|
|||||||
--source include/have_rocksdb.inc
|
--source include/have_rocksdb.inc
|
||||||
--source include/have_partition.inc
|
--source include/have_partition.inc
|
||||||
|
|
||||||
--let $coltype=BIGINT UNSIGNED
|
#
|
||||||
--let $timegen=UNIX_TIMESTAMP()
|
# Create a table with multiple partitions, but in the comment don't specify
|
||||||
--source ttl_primary_with_partitions.inc
|
# that per-partition based column families (CF) should be created. Expect that
|
||||||
|
# default CF will be used and new one won't be created.
|
||||||
|
#
|
||||||
|
# In addition, specify TTL on one of the partitions. Insert a few things
|
||||||
|
# inside all the partitions, verify after compaction that the rows inside the
|
||||||
|
# partition with TTL has disappeared.
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
c1 INT,
|
||||||
|
PRIMARY KEY (`c1`)
|
||||||
|
) ENGINE=ROCKSDB
|
||||||
|
COMMENT="custom_p0_ttl_duration=1;"
|
||||||
|
PARTITION BY LIST(c1) (
|
||||||
|
PARTITION custom_p0 VALUES IN (1, 4, 7),
|
||||||
|
PARTITION custom_p1 VALUES IN (2, 5, 8),
|
||||||
|
PARTITION custom_p2 VALUES IN (3, 6, 9)
|
||||||
|
);
|
||||||
|
|
||||||
--let $coltype=TIMESTAMP
|
set global rocksdb_debug_ttl_rec_ts = -3600;
|
||||||
--let $timegen=NOW()
|
INSERT INTO t1 values (1);
|
||||||
--source ttl_primary_with_partitions.inc
|
INSERT INTO t1 values (2);
|
||||||
|
INSERT INTO t1 values (3);
|
||||||
|
INSERT INTO t1 values (4);
|
||||||
|
INSERT INTO t1 values (5);
|
||||||
|
INSERT INTO t1 values (6);
|
||||||
|
INSERT INTO t1 values (7);
|
||||||
|
INSERT INTO t1 values (8);
|
||||||
|
INSERT INTO t1 values (9);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
--let $coltype=TIMESTAMP DEFAULT NOW()
|
--sorted_result
|
||||||
--let $timegen=NOW()
|
SELECT * FROM t1;
|
||||||
--source ttl_primary_with_partitions.inc
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
--let $coltype=TIMESTAMP(6)
|
# 1,4, and 7 should be gone
|
||||||
--let $timegen=NOW()
|
--sorted_result
|
||||||
--source ttl_primary_with_partitions.inc
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Create a table with multiple partitions and request for separate CF to be
|
||||||
|
# created per every partition. As a result we expect three different CF-s to be
|
||||||
|
# created.
|
||||||
|
#
|
||||||
|
# In addition, specify TTL on some of the partitions. Insert a few things
|
||||||
|
# inside all the partitions, verify after compaction that the rows inside the
|
||||||
|
# partition with TTL has disappeared.
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
c1 INT,
|
||||||
|
c2 INT,
|
||||||
|
name VARCHAR(25) NOT NULL,
|
||||||
|
PRIMARY KEY (`c1`, `c2`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=my_custom_cf;custom_p2_cfname=baz'
|
||||||
|
) ENGINE=ROCKSDB
|
||||||
|
COMMENT="custom_p0_ttl_duration=1;custom_p1_ttl_duration=7;"
|
||||||
|
PARTITION BY LIST(c1) (
|
||||||
|
PARTITION custom_p0 VALUES IN (1, 4, 7),
|
||||||
|
PARTITION custom_p1 VALUES IN (2, 5, 8),
|
||||||
|
PARTITION custom_p2 VALUES IN (3, 6, 9)
|
||||||
|
);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -1200;
|
||||||
|
INSERT INTO t1 values (1,1,'a');
|
||||||
|
INSERT INTO t1 values (4,4,'aaaa');
|
||||||
|
INSERT INTO t1 values (7,7,'aaaaaaa');
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 1200;
|
||||||
|
INSERT INTO t1 values (2,2,'aa');
|
||||||
|
INSERT INTO t1 values (3,3,'aaa');
|
||||||
|
INSERT INTO t1 values (5,5,'aaaaa');
|
||||||
|
INSERT INTO t1 values (6,6,'aaaaaa');
|
||||||
|
INSERT INTO t1 values (8,8,'aaaaaaaa');
|
||||||
|
INSERT INTO t1 values (9,9,'aaaaaaaaa');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set @@global.rocksdb_compact_cf = 'foo';
|
||||||
|
set @@global.rocksdb_compact_cf = 'my_custom_cf';
|
||||||
|
--sorted_result
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
||||||
|
set @@global.rocksdb_compact_cf = 'foo';
|
||||||
|
--sorted_result
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
# Now 2,5,8 should be removed (this verifies that TTL is only operating on the
|
||||||
|
# particular CF.
|
||||||
|
set @@global.rocksdb_compact_cf = 'my_custom_cf';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
--sorted_result
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Create a table with CF-s/TTL per partition and verify that ALTER TABLE + DROP
|
||||||
|
# PRIMARY, ADD PRIMARY work for that scenario and data is persisted/filtered as
|
||||||
|
# expected.
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
c1 INT,
|
||||||
|
c2 INT,
|
||||||
|
name VARCHAR(25) NOT NULL,
|
||||||
|
event DATE,
|
||||||
|
PRIMARY KEY (`c1`, `c2`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
||||||
|
) ENGINE=ROCKSDB
|
||||||
|
COMMENT="custom_p0_ttl_duration=9999;custom_p2_ttl_duration=5;"
|
||||||
|
PARTITION BY LIST(c1) (
|
||||||
|
PARTITION custom_p0 VALUES IN (1, 2, 3),
|
||||||
|
PARTITION custom_p1 VALUES IN (4, 5, 6),
|
||||||
|
PARTITION custom_p2 VALUES IN (7, 8, 9)
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES (1, 1, "one", null);
|
||||||
|
INSERT INTO t1 VALUES (2, 2, "two", null);
|
||||||
|
INSERT INTO t1 VALUES (3, 3, "three", null);
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES (4, 4, "four", null);
|
||||||
|
INSERT INTO t1 VALUES (5, 5, "five", null);
|
||||||
|
INSERT INTO t1 VALUES (6, 6, "six", null);
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES (7, 7, "seven", null);
|
||||||
|
INSERT INTO t1 VALUES (8, 8, "eight", null);
|
||||||
|
INSERT INTO t1 VALUES (9, 9, "nine", null);
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
# TTL should be reset after alter table
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 600;
|
||||||
|
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(`c2`,`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;';
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
|
||||||
|
# ...so nothing should be gone here
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 100;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set @@global.rocksdb_compact_cf = 'baz';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
--sorted_result
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 1200;
|
||||||
|
set @@global.rocksdb_compact_cf = 'foo';
|
||||||
|
set @@global.rocksdb_compact_cf = 'baz';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
--sorted_result
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Create a table with non-partitioned TTL duration, with partitioned TTL
|
||||||
|
# columns
|
||||||
|
#
|
||||||
|
# In this case the same TTL duration will be applied across different TTL
|
||||||
|
# columns in different partitions, except for in p2 where we override the ttl
|
||||||
|
# duration.
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
c1 BIGINT,
|
||||||
|
c2 BIGINT UNSIGNED NOT NULL,
|
||||||
|
name VARCHAR(25) NOT NULL,
|
||||||
|
event DATE,
|
||||||
|
PRIMARY KEY (`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
|
||||||
|
) ENGINE=ROCKSDB
|
||||||
|
COMMENT="ttl_duration=1;custom_p1_ttl_duration=100;custom_p1_ttl_col=c2;custom_p2_ttl_duration=5000;"
|
||||||
|
PARTITION BY LIST(c1) (
|
||||||
|
PARTITION custom_p0 VALUES IN (1, 2, 3),
|
||||||
|
PARTITION custom_p1 VALUES IN (4, 5, 6),
|
||||||
|
PARTITION custom_p2 VALUES IN (7, 8, 9)
|
||||||
|
);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -300;
|
||||||
|
INSERT INTO t1 VALUES (1, UNIX_TIMESTAMP(), "one", null);
|
||||||
|
INSERT INTO t1 VALUES (2, UNIX_TIMESTAMP(), "two", null);
|
||||||
|
INSERT INTO t1 VALUES (3, UNIX_TIMESTAMP(), "three", null);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES (4, UNIX_TIMESTAMP(), "four", null);
|
||||||
|
INSERT INTO t1 VALUES (5, UNIX_TIMESTAMP(), "five", null);
|
||||||
|
INSERT INTO t1 VALUES (6, UNIX_TIMESTAMP(), "six", null);
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES (7, UNIX_TIMESTAMP(), "seven", null);
|
||||||
|
INSERT INTO t1 VALUES (8, UNIX_TIMESTAMP(), "eight", null);
|
||||||
|
INSERT INTO t1 VALUES (9, UNIX_TIMESTAMP(), "nine", null);
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set @@global.rocksdb_compact_cf = 'foo';
|
||||||
|
set @@global.rocksdb_compact_cf = 'baz';
|
||||||
|
set @@global.rocksdb_compact_cf = 'bar';
|
||||||
|
|
||||||
|
# here we expect only 1,2,3 to be gone, ttl implicit.
|
||||||
|
--sorted_result
|
||||||
|
SELECT c1 FROM t1;
|
||||||
|
|
||||||
|
# here we expect only 4,5,6 to be gone, ttl based on column c2.
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 600;
|
||||||
|
set @@global.rocksdb_compact_cf = 'bar';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
--sorted_result
|
||||||
|
SELECT c1 FROM t1;
|
||||||
|
|
||||||
|
# at this point only 7,8,9 should be left..
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Make sure non-partitioned TTL duration/col still works on table with
|
||||||
|
# partitions.
|
||||||
|
#
|
||||||
|
# Simultaneously tests when TTL col is part of the key in partitioned table
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
c1 BIGINT,
|
||||||
|
c2 BIGINT UNSIGNED NOT NULL,
|
||||||
|
PRIMARY KEY (`c1`, `c2`)
|
||||||
|
) ENGINE=ROCKSDB
|
||||||
|
COMMENT="ttl_duration=100;ttl_col=c2;"
|
||||||
|
PARTITION BY LIST(c1) (
|
||||||
|
PARTITION custom_p0 VALUES IN (1),
|
||||||
|
PARTITION custom_p1 VALUES IN (2),
|
||||||
|
PARTITION custom_p2 VALUES IN (3)
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO t1 values (1, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (2, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (3, UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
# everything should still be here
|
||||||
|
--sorted_result
|
||||||
|
SELECT c1 FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 300;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
# everything should now be gone
|
||||||
|
--sorted_result
|
||||||
|
SELECT c1 FROM t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
@@ -1,783 +0,0 @@
|
|||||||
#
|
|
||||||
# Specify the timestamp column type using $coltype,
|
|
||||||
# the timestamp generator using $timegen,
|
|
||||||
# and the timestamp generater + 1 sec using $timegen_1s
|
|
||||||
#
|
|
||||||
|
|
||||||
# Basic TTL test, pk ignored, no sk
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
`a` binary(8) NOT NULL,
|
|
||||||
`b` varbinary(64) NOT NULL,
|
|
||||||
`c` varbinary(256) NOT NULL,
|
|
||||||
`ts` $coltype NOT NULL,
|
|
||||||
`value` mediumblob NOT NULL,
|
|
||||||
PRIMARY KEY (`b`,`a`,`c`)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values ('a', 'b', 'c', $timegen, 'd');
|
|
||||||
eval INSERT INTO t1 values ('d', 'e', 'f', $timegen, 'g');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 0;
|
|
||||||
|
|
||||||
# no rows should be filtered
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Basic TTL test
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
`a` binary(8) NOT NULL,
|
|
||||||
`b` varbinary(64) NOT NULL,
|
|
||||||
`c` varbinary(256) NOT NULL,
|
|
||||||
`ts` $coltype NOT NULL,
|
|
||||||
`value` mediumblob NOT NULL,
|
|
||||||
PRIMARY KEY (`b`,`a`,`c`),
|
|
||||||
KEY kb (`b`)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values ('a', 'b', 'c', $timegen, 'd');
|
|
||||||
eval INSERT INTO t1 values ('d', 'e', 'f', $timegen, 'g');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 0;
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# column before TTL in value
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
PRIMARY KEY (a),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values (1, 3, $timegen, 5);
|
|
||||||
eval INSERT INTO t1 values (2, 4, $timegen, 6);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 0;
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# multi-part PK w/ TTL
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
PRIMARY KEY (a,c),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values (1, 3, 5, $timegen);
|
|
||||||
eval INSERT INTO t1 values (2, 4, 6, $timegen);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# nullable column(s) before TTL
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int,
|
|
||||||
c int,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
PRIMARY KEY (a),
|
|
||||||
KEY kbc (b, c)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values (1, NULL, NULL, $timegen);
|
|
||||||
eval INSERT INTO t1 values (2, NULL, NULL, $timegen);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# variable len columns + null column(s) before TTL
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
`a` binary(8) NOT NULL,
|
|
||||||
`b` varbinary(64),
|
|
||||||
`c` varbinary(256),
|
|
||||||
`ts` $coltype NOT NULL,
|
|
||||||
`value` mediumblob NOT NULL,
|
|
||||||
PRIMARY KEY (`a`),
|
|
||||||
KEY kbc (`b`, `c`)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values ('a', NULL, 'bc', $timegen, 'd');
|
|
||||||
eval INSERT INTO t1 values ('d', 'efghijk', NULL, $timegen, 'l');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# TTL implicitly generated (no ttl column)
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
PRIMARY KEY (a),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
INSERT INTO t1 values (1, 3, 5);
|
|
||||||
INSERT INTO t1 values (2, 4, 6);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# TTL field as the PK
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a int,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
PRIMARY KEY (a, ts),
|
|
||||||
KEY kt (ts)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=5;ttl_col=ts;';
|
|
||||||
|
|
||||||
eval INSERT INTO t1 values (1, $timegen);
|
|
||||||
eval INSERT INTO t1 values (2, $timegen);
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX(kt);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = -10;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
# should all still be there..
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX(kt);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 10;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX(kt);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# TTL field inside multi-part pk
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
PRIMARY KEY (a, ts),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values (1, 3, $timegen, 5);
|
|
||||||
eval INSERT INTO t1 values (2, 4, $timegen, 6);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# TTL field inside key with variable length things..
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
`a` binary(8) NOT NULL,
|
|
||||||
`b` varbinary(64),
|
|
||||||
`c` varbinary(256),
|
|
||||||
`ts` $coltype NOT NULL,
|
|
||||||
`value` mediumblob NOT NULL,
|
|
||||||
PRIMARY KEY (`a`, `ts`),
|
|
||||||
KEY kb (`b`)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values ('a', NULL, 'bc', $timegen, 'd');
|
|
||||||
eval INSERT INTO t1 values ('de', 'fghijk', NULL, $timegen, 'l');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# TTL test where you compact (values still exist), real_sleep, then compact again,
|
|
||||||
# values should now be gone.
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a INT NOT NULL,
|
|
||||||
b varbinary(64) NOT NULL,
|
|
||||||
c varbinary(256) NOT NULL,
|
|
||||||
ts $coltype NOT NULL,
|
|
||||||
value mediumblob NOT NULL,
|
|
||||||
PRIMARY KEY (b,a,c),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
|
||||||
COMMENT='ttl_duration=10;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
eval INSERT INTO t1 values (1, 'b', 'c', $timegen, 'd');
|
|
||||||
eval INSERT INTO t1 values (2, 'e', 'f', $timegen, 'g');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 300;
|
|
||||||
eval INSERT INTO t1 values (3, 'i', 'j', $timegen, 'k');
|
|
||||||
eval INSERT INTO t1 values (4, 'm', 'n', $timegen, 'o');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
# Nothing should get removed here.
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = -3600;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
# 1 and 2 should get removed here.
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
# 3 and 4 should get removed here.
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# TTL field with nullable ttl column (should fail)
|
|
||||||
--error ER_RDB_TTL_COL_FORMAT
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) UNSIGNED NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
ts $coltype,
|
|
||||||
PRIMARY KEY (a,c),
|
|
||||||
KEY (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
# TTL field with non 8-bit integer column (should fail)
|
|
||||||
--error ER_RDB_TTL_COL_FORMAT
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) UNSIGNED NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
ts int,
|
|
||||||
PRIMARY KEY (a,c),
|
|
||||||
KEY (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
# TTL duration as some random garbage value
|
|
||||||
--error ER_RDB_TTL_DURATION_FORMAT
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) UNSIGNED NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
PRIMARY KEY (a,c),
|
|
||||||
KEY (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=abc;';
|
|
||||||
|
|
||||||
# TTL col is some column outside of the table
|
|
||||||
--error ER_RDB_TTL_COL_FORMAT
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) UNSIGNED NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
PRIMARY KEY (a,c),
|
|
||||||
KEY (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=abc;';
|
|
||||||
|
|
||||||
# TTL col must have accompanying duration
|
|
||||||
--error ER_RDB_TTL_COL_FORMAT
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a bigint(20) UNSIGNED NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
c int NOT NULL,
|
|
||||||
PRIMARY KEY (a,c),
|
|
||||||
KEY (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_col=abc;';
|
|
||||||
|
|
||||||
# Make sure it doesn't filter out things early
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
PRIMARY KEY (a),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=500;';
|
|
||||||
|
|
||||||
INSERT INTO t1 values (1, 1);
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Testing altering table comment with updated TTL duration
|
|
||||||
# This should trigger a rebuild of the table
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a INT PRIMARY KEY,
|
|
||||||
b INT NOT NULL,
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=100;';
|
|
||||||
|
|
||||||
INSERT INTO t1 values (1, 1);
|
|
||||||
SELECT * FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
ALTER TABLE t1 COMMENT = 'ttl_duration=1';
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SHOW CREATE TABLE t1;
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Tables with hidden PK disabled
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a INT PRIMARY KEY,
|
|
||||||
b INT,
|
|
||||||
KEY (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=100;';
|
|
||||||
|
|
||||||
--error ER_RDB_TTL_UNSUPPORTED
|
|
||||||
ALTER TABLE t1 DROP PRIMARY KEY;
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Test replacing PK, ttl should still work after
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a INT PRIMARY KEY,
|
|
||||||
b INT,
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=5;';
|
|
||||||
|
|
||||||
INSERT INTO t1 VALUES (1,1);
|
|
||||||
INSERT INTO t1 VALUES (2,2);
|
|
||||||
|
|
||||||
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(b);
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = -3600;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
|
|
||||||
--sorted_result
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
--sorted_result
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Make sure table comment filled with other text before/after will work
|
|
||||||
# (basically, it needs semicolon before and after)
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a $coltype NOT NULL,
|
|
||||||
b int,
|
|
||||||
PRIMARY KEY (a,b),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='asdadfasdfsadfadf ;ttl_duration=1; asfasdfasdfadfa';
|
|
||||||
eval INSERT INTO t1 values ($timegen, 1);
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
ALTER TABLE t1 COMMENT = 'adsf;;ttl_duration=5;asfasdfa;ttl_col=a;asdfasdf;';
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 300;
|
|
||||||
eval INSERT INTO t1 values ($timegen, 2);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
|
|
||||||
# nothing removed here
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
# all removed here
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Test to make sure that TTL retains original timestamp during update
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
PRIMARY KEY (a),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=5;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
INSERT INTO t1 values (1, 0);
|
|
||||||
INSERT INTO t1 values (3, 0);
|
|
||||||
INSERT INTO t1 values (5, 0);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 300;
|
|
||||||
INSERT INTO t1 values (7, 0);
|
|
||||||
INSERT INTO t1 values (9, 0);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
UPDATE t1 SET a=a+1;
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
# 1,3,5 should be dropped
|
|
||||||
--sorted_result
|
|
||||||
SELECT * FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# test behaviour on update with TTL column, TTL time can be updated here.
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a INT,
|
|
||||||
b $coltype NOT NULL,
|
|
||||||
PRIMARY KEY (a),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=5;ttl_col=b;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
eval INSERT INTO t1 values (1, $timegen);
|
|
||||||
eval INSERT INTO t1 values (3, $timegen);
|
|
||||||
eval INSERT INTO t1 values (5, $timegen);
|
|
||||||
eval INSERT INTO t1 values (7, $timegen);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 300;
|
|
||||||
eval UPDATE t1 SET b=($timegen_1s) WHERE a < 4;
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
# 5 and 7 should be gone here
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Test rows expired stat variable and disable ttl variable
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
PRIMARY KEY (a),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
INSERT INTO t1 values (1, 1);
|
|
||||||
INSERT INTO t1 values (2, 1);
|
|
||||||
INSERT INTO t1 values (3, 1);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
set global rocksdb_enable_ttl=0;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
|
||||||
set global rocksdb_enable_ttl=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
select variable_value-@c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Table with TTL won't increment rows expired when no records have been
|
|
||||||
# compacted
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a bigint(20) NOT NULL,
|
|
||||||
b int NOT NULL,
|
|
||||||
PRIMARY KEY (a),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=100;';
|
|
||||||
|
|
||||||
INSERT INTO t1 values (1, 1);
|
|
||||||
INSERT INTO t1 values (2, 2);
|
|
||||||
INSERT INTO t1 values (3, 3);
|
|
||||||
|
|
||||||
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
select variable_value-@c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Test update on TTL column in pk
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a INT,
|
|
||||||
b $coltype NOT NULL,
|
|
||||||
PRIMARY KEY (a, b),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=5;ttl_col=b;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
eval INSERT INTO t1 values (1, $timegen);
|
|
||||||
eval INSERT INTO t1 values (3, $timegen);
|
|
||||||
eval INSERT INTO t1 values (5, $timegen);
|
|
||||||
eval INSERT INTO t1 values (7, $timegen);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 300;
|
|
||||||
eval UPDATE t1 SET b=($timegen_1s) WHERE a < 4;
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk=0;
|
|
||||||
|
|
||||||
# 5 and 7 should be gone here
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# test behaviour on update with TTL column, TTL time can be updated here.
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
a INT,
|
|
||||||
b $coltype NOT NULL,
|
|
||||||
PRIMARY KEY (a, b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=5;ttl_col=b;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
eval INSERT INTO t1 values (1, $timegen);
|
|
||||||
eval INSERT INTO t1 values (3, $timegen);
|
|
||||||
eval INSERT INTO t1 values (5, $timegen);
|
|
||||||
eval INSERT INTO t1 values (7, $timegen);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 300;
|
|
||||||
eval UPDATE t1 SET b=($timegen_1s) WHERE a < 4;
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
# 7 should be gone here
|
|
||||||
--sorted_result
|
|
||||||
SELECT a FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Add index inplace
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
`a` binary(8) NOT NULL,
|
|
||||||
`b` varbinary(64) NOT NULL,
|
|
||||||
`c` varbinary(256) NOT NULL,
|
|
||||||
`ts` $coltype NOT NULL,
|
|
||||||
`value` mediumblob NOT NULL,
|
|
||||||
PRIMARY KEY (`b`,`a`,`c`)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values ('a', 'b', 'c', $timegen, 'd');
|
|
||||||
eval INSERT INTO t1 values ('d', 'e', 'f', $timegen, 'g');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 0;
|
|
||||||
|
|
||||||
# nothing filtered out
|
|
||||||
SELECT COUNT(*);
|
|
||||||
|
|
||||||
CREATE INDEX kb on t1 (b);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 0;
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Add index inplace, implicit TTL
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
`a` binary(8) NOT NULL,
|
|
||||||
`b` varbinary(64) NOT NULL,
|
|
||||||
`c` varbinary(256) NOT NULL,
|
|
||||||
`value` mediumblob NOT NULL,
|
|
||||||
PRIMARY KEY (`b`,`a`,`c`)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
|
||||||
COMMENT='ttl_duration=1';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
INSERT INTO t1 values ('a', 'b', 'c', 'd');
|
|
||||||
INSERT INTO t1 values ('d', 'e', 'f', 'g');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 0;
|
|
||||||
|
|
||||||
# nothing filtered out
|
|
||||||
SELECT COUNT(*);
|
|
||||||
|
|
||||||
CREATE INDEX kb on t1 (b);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 0;
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Add index inplace, TTL column in PK
|
|
||||||
eval CREATE TABLE t1 (
|
|
||||||
`a` binary(8) NOT NULL,
|
|
||||||
`b` varbinary(64) NOT NULL,
|
|
||||||
`c` varbinary(256) NOT NULL,
|
|
||||||
`ts` $coltype NOT NULL,
|
|
||||||
`value` mediumblob NOT NULL,
|
|
||||||
PRIMARY KEY (`b`,`a`,`c`, `ts`)
|
|
||||||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
eval INSERT INTO t1 values ('a', 'b', 'c', $timegen, 'd');
|
|
||||||
eval INSERT INTO t1 values ('d', 'e', 'f', $timegen, 'g');
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
SELECT COUNT(*);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 0;
|
|
||||||
|
|
||||||
# nothing filtered out
|
|
||||||
SELECT COUNT(*);
|
|
||||||
|
|
||||||
CREATE INDEX kb on t1 (b);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 1;
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
set global rocksdb_debug_ttl_ignore_pk = 0;
|
|
||||||
|
|
||||||
# should have filtered the rows out since ttl is passed in compaction filter
|
|
||||||
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
|
||||||
DROP TABLE t1;
|
|
@@ -1,22 +1,780 @@
|
|||||||
--source include/have_debug.inc
|
--source include/have_debug.inc
|
||||||
--source include/have_rocksdb.inc
|
--source include/have_rocksdb.inc
|
||||||
|
|
||||||
--let $coltype=bigint(20) UNSIGNED
|
# Basic TTL test, pk ignored, no sk
|
||||||
--let $timegen=UNIX_TIMESTAMP()
|
CREATE TABLE t1 (
|
||||||
--let $timegen_1s=UNIX_TIMESTAMP()+1
|
`a` binary(8) NOT NULL,
|
||||||
--source ttl_secondary.inc
|
`b` varbinary(64) NOT NULL,
|
||||||
|
`c` varbinary(256) NOT NULL,
|
||||||
|
`ts` bigint(20) UNSIGNED NOT NULL,
|
||||||
|
`value` mediumblob NOT NULL,
|
||||||
|
PRIMARY KEY (`b`,`a`,`c`)
|
||||||
|
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
--let $coltype=TIMESTAMP
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
--let $timegen=NOW()
|
INSERT INTO t1 values ('a', 'b', 'c', UNIX_TIMESTAMP(), 'd');
|
||||||
--let $timegen_1s=ADDTIME(NOW(), '00:00:01')
|
INSERT INTO t1 values ('d', 'e', 'f', UNIX_TIMESTAMP(), 'g');
|
||||||
--source ttl_secondary.inc
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
--let $coltype=TIMESTAMP DEFAULT NOW()
|
set global rocksdb_debug_ttl_ignore_pk = 1;
|
||||||
--let $timegen=NOW()
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
--let $timegen_1s=ADDTIME(NOW(), '00:00:01')
|
set global rocksdb_compact_cf='default';
|
||||||
--source ttl_secondary.inc
|
set global rocksdb_debug_ttl_ignore_pk = 0;
|
||||||
|
|
||||||
--let $coltype=TIMESTAMP(6)
|
# no rows should be filtered
|
||||||
--let $timegen=NOW()
|
SELECT COUNT(*) FROM t1;
|
||||||
--let $timegen_1s=ADDTIME(NOW(), '00:00:01')
|
DROP TABLE t1;
|
||||||
--source ttl_secondary.inc
|
|
||||||
|
# Basic TTL test
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` binary(8) NOT NULL,
|
||||||
|
`b` varbinary(64) NOT NULL,
|
||||||
|
`c` varbinary(256) NOT NULL,
|
||||||
|
`ts` bigint(20) UNSIGNED NOT NULL,
|
||||||
|
`value` mediumblob NOT NULL,
|
||||||
|
PRIMARY KEY (`b`,`a`,`c`),
|
||||||
|
KEY kb (`b`)
|
||||||
|
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values ('a', 'b', 'c', UNIX_TIMESTAMP(), 'd');
|
||||||
|
INSERT INTO t1 values ('d', 'e', 'f', UNIX_TIMESTAMP(), 'g');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 0;
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# column before TTL in value
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
PRIMARY KEY (a),
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1, 3, UNIX_TIMESTAMP(), 5);
|
||||||
|
INSERT INTO t1 values (2, 4, UNIX_TIMESTAMP(), 6);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 0;
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# multi-part PK w/ TTL
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
PRIMARY KEY (a,c),
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1, 3, 5, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (2, 4, 6, UNIX_TIMESTAMP());
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# nullable column(s) before TTL
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int,
|
||||||
|
c int,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
PRIMARY KEY (a),
|
||||||
|
KEY kbc (b, c)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1, NULL, NULL, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (2, NULL, NULL, UNIX_TIMESTAMP());
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# variable len columns + null column(s) before TTL
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` binary(8) NOT NULL,
|
||||||
|
`b` varbinary(64),
|
||||||
|
`c` varbinary(256),
|
||||||
|
`ts` bigint(20) UNSIGNED NOT NULL,
|
||||||
|
`value` mediumblob NOT NULL,
|
||||||
|
PRIMARY KEY (`a`),
|
||||||
|
KEY kbc (`b`, `c`)
|
||||||
|
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values ('a', NULL, 'bc', UNIX_TIMESTAMP(), 'd');
|
||||||
|
INSERT INTO t1 values ('d', 'efghijk', NULL, UNIX_TIMESTAMP(), 'l');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# TTL implicitly generated (no ttl column)
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
PRIMARY KEY (a),
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1, 3, 5);
|
||||||
|
INSERT INTO t1 values (2, 4, 6);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# TTL field as the PK
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a int,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
PRIMARY KEY (a, ts),
|
||||||
|
KEY kt (ts)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=5;ttl_col=ts;';
|
||||||
|
|
||||||
|
INSERT INTO t1 values (1, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (2, UNIX_TIMESTAMP());
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX(kt);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = -10;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
# should all still be there..
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX(kt);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 10;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX(kt);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# TTL field inside multi-part pk
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
PRIMARY KEY (a, ts),
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1, 3, UNIX_TIMESTAMP(), 5);
|
||||||
|
INSERT INTO t1 values (2, 4, UNIX_TIMESTAMP(), 6);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# TTL field inside key with variable length things..
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` binary(8) NOT NULL,
|
||||||
|
`b` varbinary(64),
|
||||||
|
`c` varbinary(256),
|
||||||
|
`ts` bigint(20) UNSIGNED NOT NULL,
|
||||||
|
`value` mediumblob NOT NULL,
|
||||||
|
PRIMARY KEY (`a`, `ts`),
|
||||||
|
KEY kb (`b`)
|
||||||
|
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values ('a', NULL, 'bc', UNIX_TIMESTAMP(), 'd');
|
||||||
|
INSERT INTO t1 values ('de', 'fghijk', NULL, UNIX_TIMESTAMP(), 'l');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# TTL test where you compact (values still exist), real_sleep, then compact again,
|
||||||
|
# values should now be gone.
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT NOT NULL,
|
||||||
|
b varbinary(64) NOT NULL,
|
||||||
|
c varbinary(256) NOT NULL,
|
||||||
|
ts bigint(20) UNSIGNED NOT NULL,
|
||||||
|
value mediumblob NOT NULL,
|
||||||
|
PRIMARY KEY (b,a,c),
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
||||||
|
COMMENT='ttl_duration=10;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -300;
|
||||||
|
INSERT INTO t1 values (1, 'b', 'c', UNIX_TIMESTAMP(), 'd');
|
||||||
|
INSERT INTO t1 values (2, 'e', 'f', UNIX_TIMESTAMP(), 'g');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 300;
|
||||||
|
INSERT INTO t1 values (3, 'i', 'j', UNIX_TIMESTAMP(), 'k');
|
||||||
|
INSERT INTO t1 values (4, 'm', 'n', UNIX_TIMESTAMP(), 'o');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
|
# Nothing should get removed here.
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = -3600;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
# 1 and 2 should get removed here.
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
# 3 and 4 should get removed here.
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# TTL field with nullable ttl column (should fail)
|
||||||
|
--error ER_RDB_TTL_COL_FORMAT
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) UNSIGNED NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
ts bigint(20),
|
||||||
|
PRIMARY KEY (a,c),
|
||||||
|
KEY (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
# TTL field with non 8-bit integer column (should fail)
|
||||||
|
--error ER_RDB_TTL_COL_FORMAT
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) UNSIGNED NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
ts int,
|
||||||
|
PRIMARY KEY (a,c),
|
||||||
|
KEY (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
# TTL duration as some random garbage value
|
||||||
|
--error ER_RDB_TTL_DURATION_FORMAT
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) UNSIGNED NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
PRIMARY KEY (a,c),
|
||||||
|
KEY (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=abc;';
|
||||||
|
|
||||||
|
# TTL col is some column outside of the table
|
||||||
|
--error ER_RDB_TTL_COL_FORMAT
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) UNSIGNED NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
PRIMARY KEY (a,c),
|
||||||
|
KEY (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=abc;';
|
||||||
|
|
||||||
|
# TTL col must have accompanying duration
|
||||||
|
--error ER_RDB_TTL_COL_FORMAT
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) UNSIGNED NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
c int NOT NULL,
|
||||||
|
PRIMARY KEY (a,c),
|
||||||
|
KEY (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_col=abc;';
|
||||||
|
|
||||||
|
# Make sure it doesn't filter out things early
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
PRIMARY KEY (a),
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=500;';
|
||||||
|
|
||||||
|
INSERT INTO t1 values (1, 1);
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Testing altering table comment with updated TTL duration
|
||||||
|
# This should trigger a rebuild of the table
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT PRIMARY KEY,
|
||||||
|
b INT NOT NULL,
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=100;';
|
||||||
|
|
||||||
|
INSERT INTO t1 values (1, 1);
|
||||||
|
SELECT * FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -300;
|
||||||
|
ALTER TABLE t1 COMMENT = 'ttl_duration=1';
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Tables with hidden PK disabled
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT PRIMARY KEY,
|
||||||
|
b INT,
|
||||||
|
KEY (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=100;';
|
||||||
|
|
||||||
|
--error ER_RDB_TTL_UNSUPPORTED
|
||||||
|
ALTER TABLE t1 DROP PRIMARY KEY;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Test replacing PK, ttl should still work after
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT PRIMARY KEY,
|
||||||
|
b INT,
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=5;';
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES (1,1);
|
||||||
|
INSERT INTO t1 VALUES (2,2);
|
||||||
|
|
||||||
|
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(b);
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = -3600;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set @@global.rocksdb_compact_cf = 'default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
||||||
|
set @@global.rocksdb_compact_cf = 'default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Make sure table comment filled with other text before/after will work
|
||||||
|
# (basically, it needs semicolon before and after)
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) UNSIGNED NOT NULL,
|
||||||
|
b int,
|
||||||
|
PRIMARY KEY (a,b),
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='asdadfasdfsadfadf ;ttl_duration=1; asfasdfasdfadfa';
|
||||||
|
INSERT INTO t1 values (UNIX_TIMESTAMP(), 1);
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
ALTER TABLE t1 COMMENT = 'adsf;;ttl_duration=5;asfasdfa;ttl_col=a;asdfasdf;';
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 300;
|
||||||
|
INSERT INTO t1 values (UNIX_TIMESTAMP(), 2);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
|
||||||
|
# nothing removed here
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
# all removed here
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 3600;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Test to make sure that TTL retains original timestamp during update
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
PRIMARY KEY (a),
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=5;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -300;
|
||||||
|
INSERT INTO t1 values (1, 0);
|
||||||
|
INSERT INTO t1 values (3, 0);
|
||||||
|
INSERT INTO t1 values (5, 0);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 300;
|
||||||
|
INSERT INTO t1 values (7, 0);
|
||||||
|
INSERT INTO t1 values (9, 0);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
|
UPDATE t1 SET a=a+1;
|
||||||
|
--sorted_result
|
||||||
|
SELECT * FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
# 1,3,5 should be dropped
|
||||||
|
--sorted_result
|
||||||
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# test behaviour on update with TTL column, TTL time can be updated here.
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT,
|
||||||
|
b bigint(20) UNSIGNED NOT NULL,
|
||||||
|
PRIMARY KEY (a),
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=5;ttl_col=b;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -300;
|
||||||
|
INSERT INTO t1 values (1, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (3, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (5, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (7, UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 300;
|
||||||
|
UPDATE t1 SET b=(UNIX_TIMESTAMP()+1) WHERE a < 4;
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
# 5 and 7 should be gone here
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Test rows expired stat variable and disable ttl variable
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
PRIMARY KEY (a),
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=1;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values (1, 1);
|
||||||
|
INSERT INTO t1 values (2, 1);
|
||||||
|
INSERT INTO t1 values (3, 1);
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
|
set global rocksdb_enable_ttl=0;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
||||||
|
set global rocksdb_enable_ttl=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
select variable_value-@c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Table with TTL won't increment rows expired when no records have been
|
||||||
|
# compacted
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a bigint(20) NOT NULL,
|
||||||
|
b int NOT NULL,
|
||||||
|
PRIMARY KEY (a),
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=100;';
|
||||||
|
|
||||||
|
INSERT INTO t1 values (1, 1);
|
||||||
|
INSERT INTO t1 values (2, 2);
|
||||||
|
INSERT INTO t1 values (3, 3);
|
||||||
|
|
||||||
|
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
select variable_value-@c from information_schema.global_status where variable_name='rocksdb_rows_expired';
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Test update on TTL column in pk
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT,
|
||||||
|
b bigint(20) UNSIGNED NOT NULL,
|
||||||
|
PRIMARY KEY (a, b),
|
||||||
|
KEY kb (b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=5;ttl_col=b;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -300;
|
||||||
|
INSERT INTO t1 values (1, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (3, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (5, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (7, UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 300;
|
||||||
|
UPDATE t1 SET b=(UNIX_TIMESTAMP()+1) WHERE a < 4;
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1 FORCE INDEX (kb);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk=0;
|
||||||
|
|
||||||
|
# 5 and 7 should be gone here
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# test behaviour on update with TTL column, TTL time can be updated here.
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT,
|
||||||
|
b bigint(20) UNSIGNED NOT NULL,
|
||||||
|
PRIMARY KEY (a, b)
|
||||||
|
) ENGINE=rocksdb
|
||||||
|
COMMENT='ttl_duration=5;ttl_col=b;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -300;
|
||||||
|
INSERT INTO t1 values (1, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (3, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (5, UNIX_TIMESTAMP());
|
||||||
|
INSERT INTO t1 values (7, UNIX_TIMESTAMP());
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 300;
|
||||||
|
UPDATE t1 SET b=(UNIX_TIMESTAMP()+1) WHERE a < 4;
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1;
|
||||||
|
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
|
||||||
|
# 7 should be gone here
|
||||||
|
--sorted_result
|
||||||
|
SELECT a FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Add index inplace
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` binary(8) NOT NULL,
|
||||||
|
`b` varbinary(64) NOT NULL,
|
||||||
|
`c` varbinary(256) NOT NULL,
|
||||||
|
`ts` bigint(20) UNSIGNED NOT NULL,
|
||||||
|
`value` mediumblob NOT NULL,
|
||||||
|
PRIMARY KEY (`b`,`a`,`c`)
|
||||||
|
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values ('a', 'b', 'c', UNIX_TIMESTAMP(), 'd');
|
||||||
|
INSERT INTO t1 values ('d', 'e', 'f', UNIX_TIMESTAMP(), 'g');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 0;
|
||||||
|
|
||||||
|
# nothing filtered out
|
||||||
|
SELECT COUNT(*);
|
||||||
|
|
||||||
|
CREATE INDEX kb on t1 (b);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 0;
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Add index inplace, implicit TTL
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` binary(8) NOT NULL,
|
||||||
|
`b` varbinary(64) NOT NULL,
|
||||||
|
`c` varbinary(256) NOT NULL,
|
||||||
|
`value` mediumblob NOT NULL,
|
||||||
|
PRIMARY KEY (`b`,`a`,`c`)
|
||||||
|
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
||||||
|
COMMENT='ttl_duration=1';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values ('a', 'b', 'c', 'd');
|
||||||
|
INSERT INTO t1 values ('d', 'e', 'f', 'g');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 0;
|
||||||
|
|
||||||
|
# nothing filtered out
|
||||||
|
SELECT COUNT(*);
|
||||||
|
|
||||||
|
CREATE INDEX kb on t1 (b);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 0;
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# Add index inplace, TTL column in PK
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`a` binary(8) NOT NULL,
|
||||||
|
`b` varbinary(64) NOT NULL,
|
||||||
|
`c` varbinary(256) NOT NULL,
|
||||||
|
`ts` bigint(20) UNSIGNED NOT NULL,
|
||||||
|
`value` mediumblob NOT NULL,
|
||||||
|
PRIMARY KEY (`b`,`a`,`c`, `ts`)
|
||||||
|
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
|
||||||
|
COMMENT='ttl_duration=1;ttl_col=ts;';
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = -100;
|
||||||
|
INSERT INTO t1 values ('a', 'b', 'c', UNIX_TIMESTAMP(), 'd');
|
||||||
|
INSERT INTO t1 values ('d', 'e', 'f', UNIX_TIMESTAMP(), 'g');
|
||||||
|
set global rocksdb_debug_ttl_rec_ts = 0;
|
||||||
|
SELECT COUNT(*);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 0;
|
||||||
|
|
||||||
|
# nothing filtered out
|
||||||
|
SELECT COUNT(*);
|
||||||
|
|
||||||
|
CREATE INDEX kb on t1 (b);
|
||||||
|
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 1;
|
||||||
|
set global rocksdb_force_flush_memtable_now=1;
|
||||||
|
set global rocksdb_compact_cf='default';
|
||||||
|
set global rocksdb_debug_ttl_ignore_pk = 0;
|
||||||
|
|
||||||
|
# should have filtered the rows out since ttl is passed in compaction filter
|
||||||
|
SELECT COUNT(*) FROM t1 FORCE INDEX (kb);
|
||||||
|
DROP TABLE t1;
|
||||||
|
@@ -409,45 +409,6 @@ SELECT a, b FROM t1 FORCE INDEX (kb);
|
|||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
# Test that index_next_with_direction skips records properly for timestamps
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
a int,
|
|
||||||
b int,
|
|
||||||
ts TIMESTAMP NOT NULL,
|
|
||||||
PRIMARY KEY (a),
|
|
||||||
KEY kb (b)
|
|
||||||
) ENGINE=rocksdb
|
|
||||||
COMMENT='ttl_duration=1;ttl_col=ts;';
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 100;
|
|
||||||
INSERT INTO t1 VALUES (1, 1, NOW());
|
|
||||||
INSERT INTO t1 VALUES (2, 2, NOW());
|
|
||||||
INSERT INTO t1 VALUES (3, 3, NOW());
|
|
||||||
INSERT INTO t1 VALUES (4, 4, NOW());
|
|
||||||
INSERT INTO t1 VALUES (5, 5, NOW());
|
|
||||||
INSERT INTO t1 VALUES (6, 6, NOW());
|
|
||||||
INSERT INTO t1 VALUES (7, 7, NOW());
|
|
||||||
INSERT INTO t1 VALUES (8, 8, NOW());
|
|
||||||
INSERT INTO t1 VALUES (9, 9, NOW());
|
|
||||||
INSERT INTO t1 VALUES (10, 10, NOW());
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
--echo # None are expired
|
|
||||||
SELECT a, b FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -100;
|
|
||||||
UPDATE t1 SET ts=(ADDTIME(NOW(), 1)) WHERE a IN (4, 7);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set global rocksdb_compact_cf='default';
|
|
||||||
|
|
||||||
--echo # 4 and 7 should be gone
|
|
||||||
SELECT a, b FROM t1 FORCE INDEX (kb);
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# Test range scans with various conditionals
|
# Test range scans with various conditionals
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
c1 INT,
|
c1 INT,
|
||||||
|
@@ -255,62 +255,6 @@ SELECT c1 FROM t1 FORCE INDEX (kc2);
|
|||||||
# at this point only 7,8,9 should be left..
|
# at this point only 7,8,9 should be left..
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
c1 BIGINT,
|
|
||||||
c2 TIMESTAMP DEFAULT NOW() NOT NULL,
|
|
||||||
name VARCHAR(25) NOT NULL,
|
|
||||||
event DATE,
|
|
||||||
PRIMARY KEY (`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;',
|
|
||||||
KEY kc2 (`c2`)
|
|
||||||
) ENGINE=ROCKSDB
|
|
||||||
COMMENT="ttl_duration=1;custom_p1_ttl_duration=100;custom_p1_ttl_col=c2;custom_p2_ttl_duration=5000;"
|
|
||||||
PARTITION BY LIST(c1) (
|
|
||||||
PARTITION custom_p0 VALUES IN (1, 2, 3),
|
|
||||||
PARTITION custom_p1 VALUES IN (4, 5, 6),
|
|
||||||
PARTITION custom_p2 VALUES IN (7, 8, 9)
|
|
||||||
);
|
|
||||||
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = -300;
|
|
||||||
INSERT INTO t1 VALUES (1, NOW(), "one", null);
|
|
||||||
INSERT INTO t1 VALUES (2, NOW(), "two", null);
|
|
||||||
INSERT INTO t1 VALUES (3, NOW(), "three", null);
|
|
||||||
set global rocksdb_debug_ttl_rec_ts = 0;
|
|
||||||
|
|
||||||
INSERT INTO t1 VALUES (4, NOW(), "four", null);
|
|
||||||
INSERT INTO t1 VALUES (5, NOW(), "five", null);
|
|
||||||
INSERT INTO t1 VALUES (6, NOW(), "six", null);
|
|
||||||
|
|
||||||
INSERT INTO t1 VALUES (7, NOW(), "seven", null);
|
|
||||||
INSERT INTO t1 VALUES (8, NOW(), "eight", null);
|
|
||||||
INSERT INTO t1 VALUES (9, NOW(), "nine", null);
|
|
||||||
|
|
||||||
set global rocksdb_force_flush_memtable_now=1;
|
|
||||||
set @@global.rocksdb_compact_cf = 'foo';
|
|
||||||
set @@global.rocksdb_compact_cf = 'baz';
|
|
||||||
set @@global.rocksdb_compact_cf = 'bar';
|
|
||||||
# Filter out expired secondary keys too
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
|
|
||||||
# here we expect only 1,2,3 to be gone, ttl implicit.
|
|
||||||
--sorted_result
|
|
||||||
SELECT c1 FROM t1 FORCE INDEX (PRIMARY);
|
|
||||||
--sorted_result
|
|
||||||
SELECT c1 FROM t1 FORCE INDEX (kc2);
|
|
||||||
|
|
||||||
# here we expect only 4,5,6 to be gone, ttl based on column c2.
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 600;
|
|
||||||
set @@global.rocksdb_compact_cf = 'bar';
|
|
||||||
# Filter out expired secondary keys too
|
|
||||||
set @@global.rocksdb_compact_cf = 'default';
|
|
||||||
set global rocksdb_debug_ttl_snapshot_ts = 0;
|
|
||||||
--sorted_result
|
|
||||||
SELECT c1 FROM t1 FORCE INDEX (PRIMARY);
|
|
||||||
--sorted_result
|
|
||||||
SELECT c1 FROM t1 FORCE INDEX (kc2);
|
|
||||||
|
|
||||||
# at this point only 7,8,9 should be left..
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Add index inplace
|
# Add index inplace
|
||||||
#
|
#
|
||||||
|
@@ -49,36 +49,3 @@ CREATE TABLE t (a VARCHAR(255), PRIMARY KEY(a(2)), UNIQUE KEY (a(1))) engine=roc
|
|||||||
INSERT INTO t VALUES('a');
|
INSERT INTO t VALUES('a');
|
||||||
CHECK TABLE t EXTENDED;
|
CHECK TABLE t EXTENDED;
|
||||||
DROP TABLE t;
|
DROP TABLE t;
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # Validate lock acquired on SK during delete
|
|
||||||
--echo #
|
|
||||||
CREATE TABLE t3 (pk INT PRIMARY KEY, sk INT, UNIQUE KEY (sk)) ENGINE=ROCKSDB;
|
|
||||||
INSERT INTO t3 VALUES (1, 100);
|
|
||||||
|
|
||||||
BEGIN;
|
|
||||||
--echo # This should acquire a lock on sk = 100
|
|
||||||
DELETE FROM t3 WHERE pk = 1;
|
|
||||||
|
|
||||||
connect (con1, localhost, root,,);
|
|
||||||
connection con1;
|
|
||||||
set session rocksdb_lock_wait_timeout=1;
|
|
||||||
set session transaction_isolation='REPEATABLE-READ';
|
|
||||||
SELECT * FROM t3;
|
|
||||||
--echo # RR: This should fail with lock wait timeout due to sk = 100
|
|
||||||
--error ER_LOCK_WAIT_TIMEOUT
|
|
||||||
INSERT INTO t3 VALUES (2, 100);
|
|
||||||
|
|
||||||
set session transaction_isolation='READ-COMMITTED';
|
|
||||||
--echo # RC: This should fail with lock wait timeout due to sk = 100
|
|
||||||
--error ER_LOCK_WAIT_TIMEOUT
|
|
||||||
INSERT INTO t3 VALUES (2, 100);
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
--echo # The original transaction should be able to perform an insert
|
|
||||||
INSERT INTO t3 VALUES (3, 100);
|
|
||||||
COMMIT;
|
|
||||||
SELECT * FROM t3;
|
|
||||||
|
|
||||||
disconnect con1;
|
|
||||||
DROP TABLE t3;
|
|
||||||
|
@@ -5,8 +5,3 @@ rocksdb_write_policy=write_committed
|
|||||||
[row-write-prepared]
|
[row-write-prepared]
|
||||||
binlog-format=row
|
binlog-format=row
|
||||||
rocksdb_write_policy=write_prepared
|
rocksdb_write_policy=write_prepared
|
||||||
|
|
||||||
[row-write-unprepared]
|
|
||||||
binlog-format=row
|
|
||||||
rocksdb_write_policy=write_unprepared
|
|
||||||
rocksdb_write_batch_flush_threshold=1
|
|
||||||
|
@@ -1,37 +0,0 @@
|
|||||||
include/master-slave.inc
|
|
||||||
[connection master]
|
|
||||||
connection master;
|
|
||||||
create table t1 (a int primary key, b int) engine = rocksdb;
|
|
||||||
set @@unique_checks = 0;
|
|
||||||
insert into t1 values(1, 1);
|
|
||||||
insert into t1 values(2, 2);
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection slave;
|
|
||||||
begin;
|
|
||||||
update t1 set b = 20 where a = 2;
|
|
||||||
connection master;
|
|
||||||
set @@unique_checks = 0;
|
|
||||||
insert into t1 values(2, 200);
|
|
||||||
connection slave;
|
|
||||||
rollback;
|
|
||||||
connection slave;
|
|
||||||
set @@global.rocksdb_skip_locks_if_skip_unique_check = 1;
|
|
||||||
stop slave;
|
|
||||||
start slave;
|
|
||||||
begin;
|
|
||||||
update t1 set b = 10 where a = 1;
|
|
||||||
connection master;
|
|
||||||
set @@unique_checks = 0;
|
|
||||||
insert into t1 values(1, 100);
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection slave;
|
|
||||||
rollback;
|
|
||||||
select * from t1;
|
|
||||||
a b
|
|
||||||
1 100
|
|
||||||
2 200
|
|
||||||
set @@global.rocksdb_skip_locks_if_skip_unique_check = 0;
|
|
||||||
connection master;
|
|
||||||
drop table t1;
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
include/rpl_end.inc
|
|
@@ -1,240 +0,0 @@
|
|||||||
include/master-slave.inc
|
|
||||||
[connection master]
|
|
||||||
call mtr.add_suppression("Attempting backtrace");
|
|
||||||
call mtr.add_suppression("failed to write to WAL");
|
|
||||||
call mtr.add_suppression("aborting on WAL write error");
|
|
||||||
create table t1 (id int primary key, value int) engine = rocksdb;
|
|
||||||
insert into t1 values (1,1),(2,2),(3,3);
|
|
||||||
set session debug= "+d,myrocks_prepare_io_error";
|
|
||||||
insert into t1 values (4,4);
|
|
||||||
ERROR HY000: Internal error: RocksDB error on COMMIT (Prepare/merge): IO error:
|
|
||||||
begin;
|
|
||||||
insert into t1 values (5,5);
|
|
||||||
insert into t1 values (6,6);
|
|
||||||
commit;
|
|
||||||
ERROR HY000: Internal error: RocksDB error on COMMIT (Prepare/merge): IO error:
|
|
||||||
set session debug= "-d,myrocks_prepare_io_error";
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
drop table t1;
|
|
||||||
create table t1 (id int primary key, value int) engine = rocksdb;
|
|
||||||
insert into t1 values (1,1),(2,2),(3,3);
|
|
||||||
set session debug= "+d,myrocks_prepare_incomplete";
|
|
||||||
insert into t1 values (4,4);
|
|
||||||
ERROR HY000: Internal error: RocksDB error on COMMIT (Prepare/merge): Result incomplete:
|
|
||||||
begin;
|
|
||||||
insert into t1 values (5,5);
|
|
||||||
insert into t1 values (6,6);
|
|
||||||
commit;
|
|
||||||
ERROR HY000: Internal error: RocksDB error on COMMIT (Prepare/merge): Result incomplete:
|
|
||||||
set session debug= "-d,myrocks_prepare_incomplete";
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
drop table t1;
|
|
||||||
connection master;
|
|
||||||
create table t1 (id int primary key, value int) engine = rocksdb;
|
|
||||||
insert into t1 values (1,1),(2,2),(3,3);
|
|
||||||
set session debug= "+d,myrocks_commit_io_error";
|
|
||||||
insert into t1 values (4,4);
|
|
||||||
ERROR HY000: Lost connection to server during query
|
|
||||||
include/rpl_reconnect.inc
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection slave;
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
connection master;
|
|
||||||
set session debug= "+d,myrocks_commit_io_error";
|
|
||||||
begin;
|
|
||||||
insert into t1 values (5,5);
|
|
||||||
insert into t1 values (6,6);
|
|
||||||
commit;
|
|
||||||
ERROR HY000: Lost connection to server during query
|
|
||||||
include/rpl_reconnect.inc
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
5 5
|
|
||||||
6 6
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection slave;
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
5 5
|
|
||||||
6 6
|
|
||||||
connection master;
|
|
||||||
drop table t1;
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection master;
|
|
||||||
create table t1 (id int primary key, value int) engine = rocksdb;
|
|
||||||
insert into t1 values (1,1),(2,2),(3,3);
|
|
||||||
set session debug= "+d,myrocks_commit_incomplete";
|
|
||||||
insert into t1 values (4,4);
|
|
||||||
ERROR HY000: Lost connection to server during query
|
|
||||||
include/rpl_reconnect.inc
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection slave;
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
connection master;
|
|
||||||
set session debug= "+d,myrocks_commit_incomplete";
|
|
||||||
begin;
|
|
||||||
insert into t1 values (5,5);
|
|
||||||
insert into t1 values (6,6);
|
|
||||||
commit;
|
|
||||||
ERROR HY000: Lost connection to server during query
|
|
||||||
include/rpl_reconnect.inc
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
5 5
|
|
||||||
6 6
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection slave;
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
5 5
|
|
||||||
6 6
|
|
||||||
connection master;
|
|
||||||
drop table t1;
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection master;
|
|
||||||
create table t1 (id int primary key, value int) engine = rocksdb;
|
|
||||||
insert into t1 values (1,1),(2,2),(3,3);
|
|
||||||
set session debug= "+d,myrocks_commit_merge_io_error";
|
|
||||||
insert into t1 values (4,4);
|
|
||||||
ERROR HY000: Lost connection to server during query
|
|
||||||
include/rpl_reconnect.inc
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection slave;
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
connection master;
|
|
||||||
set session debug= "+d,myrocks_commit_merge_io_error";
|
|
||||||
begin;
|
|
||||||
insert into t1 values (5,5);
|
|
||||||
insert into t1 values (6,6);
|
|
||||||
commit;
|
|
||||||
ERROR HY000: Lost connection to server during query
|
|
||||||
include/rpl_reconnect.inc
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
5 5
|
|
||||||
6 6
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection slave;
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
5 5
|
|
||||||
6 6
|
|
||||||
connection master;
|
|
||||||
drop table t1;
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection master;
|
|
||||||
create table t1 (id int primary key, value int) engine = rocksdb;
|
|
||||||
insert into t1 values (1,1),(2,2),(3,3);
|
|
||||||
set session debug= "+d,myrocks_commit_merge_incomplete";
|
|
||||||
insert into t1 values (4,4);
|
|
||||||
ERROR HY000: Lost connection to server during query
|
|
||||||
include/rpl_reconnect.inc
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection slave;
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
connection master;
|
|
||||||
set session debug= "+d,myrocks_commit_merge_incomplete";
|
|
||||||
begin;
|
|
||||||
insert into t1 values (5,5);
|
|
||||||
insert into t1 values (6,6);
|
|
||||||
commit;
|
|
||||||
ERROR HY000: Lost connection to server during query
|
|
||||||
include/rpl_reconnect.inc
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
5 5
|
|
||||||
6 6
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
connection slave;
|
|
||||||
select * from t1 order by id;
|
|
||||||
id value
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 3
|
|
||||||
4 4
|
|
||||||
5 5
|
|
||||||
6 6
|
|
||||||
connection master;
|
|
||||||
drop table t1;
|
|
||||||
include/sync_slave_sql_with_master.inc
|
|
||||||
include/rpl_end.inc
|
|
@@ -13,8 +13,8 @@ use strict;
|
|||||||
|
|
||||||
my $sst_dump=
|
my $sst_dump=
|
||||||
::mtr_exe_maybe_exists(
|
::mtr_exe_maybe_exists(
|
||||||
"$::bindir/storage/rocksdb$::multiconfig/mariadb-sst-dump",
|
"$::bindir/storage/rocksdb$::multiconfig/sst_dump",
|
||||||
"$::path_client_bindir/mariadb-sst-dump");
|
"$::path_client_bindir/sst_dump");
|
||||||
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
|
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
|
||||||
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
|
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
|
||||||
|
|
||||||
|
@@ -1,48 +0,0 @@
|
|||||||
source include/master-slave.inc;
|
|
||||||
source include/have_rocksdb.inc;
|
|
||||||
|
|
||||||
connection master;
|
|
||||||
create table t1 (a int primary key, b int) engine = rocksdb;
|
|
||||||
set @@unique_checks = 0;
|
|
||||||
insert into t1 values(1, 1);
|
|
||||||
insert into t1 values(2, 2);
|
|
||||||
source include/sync_slave_sql_with_master.inc;
|
|
||||||
|
|
||||||
connection slave;
|
|
||||||
begin;
|
|
||||||
update t1 set b = 20 where a = 2;
|
|
||||||
|
|
||||||
connection master;
|
|
||||||
set @@unique_checks = 0;
|
|
||||||
insert into t1 values(2, 200);
|
|
||||||
|
|
||||||
connection slave;
|
|
||||||
let $wait_condition=
|
|
||||||
select count(*)= 1 from information_schema.processlist
|
|
||||||
where state = 'Waiting for row lock';
|
|
||||||
source include/wait_condition.inc;
|
|
||||||
rollback;
|
|
||||||
|
|
||||||
|
|
||||||
# Now let's check if locks are not taken when # rocksdb_skip_locks_if_skip_unique_check is enabled
|
|
||||||
connection slave;
|
|
||||||
set @@global.rocksdb_skip_locks_if_skip_unique_check = 1;
|
|
||||||
stop slave; start slave;
|
|
||||||
begin;
|
|
||||||
update t1 set b = 10 where a = 1;
|
|
||||||
|
|
||||||
connection master;
|
|
||||||
set @@unique_checks = 0;
|
|
||||||
insert into t1 values(1, 100);
|
|
||||||
source include/sync_slave_sql_with_master.inc;
|
|
||||||
|
|
||||||
connection slave;
|
|
||||||
rollback;
|
|
||||||
select * from t1;
|
|
||||||
set @@global.rocksdb_skip_locks_if_skip_unique_check = 0;
|
|
||||||
|
|
||||||
connection master;
|
|
||||||
drop table t1;
|
|
||||||
source include/sync_slave_sql_with_master.inc;
|
|
||||||
|
|
||||||
source include/rpl_end.inc;
|
|
@@ -3,7 +3,6 @@ source include/master-slave.inc;
|
|||||||
-- let $uuid = `select @@server_uuid;`
|
-- let $uuid = `select @@server_uuid;`
|
||||||
|
|
||||||
--exec echo > $MYSQLTEST_VARDIR/log/mysqld.1.err
|
--exec echo > $MYSQLTEST_VARDIR/log/mysqld.1.err
|
||||||
--exec echo > $MYSQLTEST_VARDIR/log/mysqld.2.err
|
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
@@ -27,7 +26,6 @@ sync_slave_with_master;
|
|||||||
connection slave;
|
connection slave;
|
||||||
--let slave_data_dir= query_get_value(SELECT @@DATADIR, @@DATADIR, 1)
|
--let slave_data_dir= query_get_value(SELECT @@DATADIR, @@DATADIR, 1)
|
||||||
--let slave_pid_file= query_get_value(SELECT @@pid_file, @@pid_file, 1)
|
--let slave_pid_file= query_get_value(SELECT @@pid_file, @@pid_file, 1)
|
||||||
--let write_policy= query_get_value(SELECT @@rocksdb_write_policy, @@rocksdb_write_policy, 1)
|
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
select "--- slave state before crash ---" as "";
|
select "--- slave state before crash ---" as "";
|
||||||
--enable_query_log
|
--enable_query_log
|
||||||
@@ -44,19 +42,7 @@ select * from mysql.slave_gtid_info;
|
|||||||
|
|
||||||
F=`ls -t $slave_data_dir/\#rocksdb/*.log | head -n 1`
|
F=`ls -t $slave_data_dir/\#rocksdb/*.log | head -n 1`
|
||||||
SIZE=`stat -c %s $F`
|
SIZE=`stat -c %s $F`
|
||||||
|
NEW_SIZE=`expr $SIZE - 30`
|
||||||
case $1 in
|
|
||||||
write_committed)
|
|
||||||
NEW_SIZE=`expr $SIZE - 30`
|
|
||||||
;;
|
|
||||||
write_prepared)
|
|
||||||
NEW_SIZE=`expr $SIZE - 30`
|
|
||||||
;;
|
|
||||||
write_unprepared)
|
|
||||||
NEW_SIZE=`expr $SIZE - 200`
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
truncate -s $NEW_SIZE $F
|
truncate -s $NEW_SIZE $F
|
||||||
rc=$?
|
rc=$?
|
||||||
if [[ $rc != 0 ]]; then
|
if [[ $rc != 0 ]]; then
|
||||||
@@ -68,7 +54,7 @@ kill -9 `head -1 $slave_pid_file`
|
|||||||
exit 0
|
exit 0
|
||||||
EOF
|
EOF
|
||||||
--chmod 0755 $MYSQL_TMP_DIR/truncate_tail_wal.sh
|
--chmod 0755 $MYSQL_TMP_DIR/truncate_tail_wal.sh
|
||||||
--exec $MYSQL_TMP_DIR/truncate_tail_wal.sh $write_policy
|
--exec $MYSQL_TMP_DIR/truncate_tail_wal.sh
|
||||||
|
|
||||||
--let $rpl_skip_start_slave= 1
|
--let $rpl_skip_start_slave= 1
|
||||||
--source include/rpl_start_server.inc
|
--source include/rpl_start_server.inc
|
||||||
@@ -132,18 +118,7 @@ connection slave;
|
|||||||
# expected to be around 950 bytes
|
# expected to be around 950 bytes
|
||||||
F=`ls -t $slave_data_dir/\#rocksdb/*.log | head -n 1`
|
F=`ls -t $slave_data_dir/\#rocksdb/*.log | head -n 1`
|
||||||
SIZE=`stat -c %s $F`
|
SIZE=`stat -c %s $F`
|
||||||
case $1 in
|
OFFSET=$(( $SIZE-500 ))
|
||||||
write_committed)
|
|
||||||
OFFSET=$(( $SIZE-500 ))
|
|
||||||
;;
|
|
||||||
write_prepared)
|
|
||||||
OFFSET=$(( $SIZE-500 ))
|
|
||||||
;;
|
|
||||||
write_unprepared)
|
|
||||||
OFFSET=$(( $SIZE-1000 ))
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
dd bs=1 if=/dev/zero of=$F count=100 seek=$OFFSET conv=notrunc
|
dd bs=1 if=/dev/zero of=$F count=100 seek=$OFFSET conv=notrunc
|
||||||
|
|
||||||
kill -9 `head -1 $slave_pid_file`
|
kill -9 `head -1 $slave_pid_file`
|
||||||
@@ -151,7 +126,7 @@ kill -9 `head -1 $slave_pid_file`
|
|||||||
exit 0
|
exit 0
|
||||||
EOF
|
EOF
|
||||||
--chmod 0755 $MYSQL_TMP_DIR/corrupt_wal.sh
|
--chmod 0755 $MYSQL_TMP_DIR/corrupt_wal.sh
|
||||||
--exec $MYSQL_TMP_DIR/corrupt_wal.sh $write_policy
|
--exec $MYSQL_TMP_DIR/corrupt_wal.sh
|
||||||
|
|
||||||
--let $rpl_skip_start_slave= 1
|
--let $rpl_skip_start_slave= 1
|
||||||
--source include/rpl_start_server.inc
|
--source include/rpl_start_server.inc
|
||||||
|
@@ -1,38 +0,0 @@
|
|||||||
--disable_warnings
|
|
||||||
--source include/have_rocksdb.inc
|
|
||||||
--source include/have_binlog_format_row.inc
|
|
||||||
--source include/master-slave.inc
|
|
||||||
--source include/not_asan.inc
|
|
||||||
--source include/have_debug.inc
|
|
||||||
--source include/not_valgrind.inc
|
|
||||||
--source include/not_windows.inc
|
|
||||||
|
|
||||||
|
|
||||||
call mtr.add_suppression("Attempting backtrace");
|
|
||||||
call mtr.add_suppression("failed to write to WAL");
|
|
||||||
call mtr.add_suppression("aborting on WAL write error");
|
|
||||||
|
|
||||||
# systems errors on prepare should just roll back
|
|
||||||
let $myrocks_debug_set_code = "+d,myrocks_prepare_io_error";
|
|
||||||
let $myrocks_debug_unset_code = "-d,myrocks_prepare_io_error";
|
|
||||||
--source tx_system_failure_prepare.inc
|
|
||||||
|
|
||||||
let $myrocks_debug_set_code = "+d,myrocks_prepare_incomplete";
|
|
||||||
let $myrocks_debug_unset_code = "-d,myrocks_prepare_incomplete";
|
|
||||||
--source tx_system_failure_prepare.inc
|
|
||||||
|
|
||||||
# systems errors on commit should abort, then roll forward,
|
|
||||||
# replication should consistent
|
|
||||||
let $myrocks_debug_set_code = "+d,myrocks_commit_io_error";
|
|
||||||
--source tx_system_failure_commit.inc
|
|
||||||
|
|
||||||
let $myrocks_debug_set_code = "+d,myrocks_commit_incomplete";
|
|
||||||
--source tx_system_failure_commit.inc
|
|
||||||
|
|
||||||
let $myrocks_debug_set_code = "+d,myrocks_commit_merge_io_error";
|
|
||||||
--source tx_system_failure_commit.inc
|
|
||||||
|
|
||||||
let $myrocks_debug_set_code = "+d,myrocks_commit_merge_incomplete";
|
|
||||||
--source tx_system_failure_commit.inc
|
|
||||||
|
|
||||||
--source include/rpl_end.inc
|
|
@@ -1,52 +0,0 @@
|
|||||||
connection master;
|
|
||||||
create table t1 (id int primary key, value int) engine = rocksdb;
|
|
||||||
|
|
||||||
insert into t1 values (1,1),(2,2),(3,3);
|
|
||||||
|
|
||||||
# auto commit failure at engine commit, crash and restart (roll forward with binlog)
|
|
||||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
|
||||||
eval set session debug= $myrocks_debug_set_code;
|
|
||||||
--error 2013
|
|
||||||
insert into t1 values (4,4);
|
|
||||||
|
|
||||||
--enable_reconnect
|
|
||||||
--source include/wait_until_connected_again.inc
|
|
||||||
|
|
||||||
# Primary instance restart needs this, otherwise rpl_end fails.
|
|
||||||
--let $rpl_server_number = 1
|
|
||||||
--source include/rpl_reconnect.inc
|
|
||||||
|
|
||||||
select * from t1 order by id;
|
|
||||||
source include/sync_slave_sql_with_master.inc;
|
|
||||||
|
|
||||||
connection slave;
|
|
||||||
select * from t1 order by id;
|
|
||||||
|
|
||||||
|
|
||||||
connection master;
|
|
||||||
# tx failure at engine commit, crash and restart (roll forward with binlog)
|
|
||||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
|
||||||
eval set session debug= $myrocks_debug_set_code;
|
|
||||||
begin;
|
|
||||||
insert into t1 values (5,5);
|
|
||||||
insert into t1 values (6,6);
|
|
||||||
--error 2013
|
|
||||||
commit;
|
|
||||||
|
|
||||||
--enable_reconnect
|
|
||||||
--source include/wait_until_connected_again.inc
|
|
||||||
|
|
||||||
# Primary instance restart needs this, otherwise rpl_end fails.
|
|
||||||
--let $rpl_server_number = 1
|
|
||||||
--source include/rpl_reconnect.inc
|
|
||||||
|
|
||||||
select * from t1 order by id;
|
|
||||||
source include/sync_slave_sql_with_master.inc;
|
|
||||||
|
|
||||||
connection slave;
|
|
||||||
select * from t1 order by id;
|
|
||||||
|
|
||||||
|
|
||||||
connection master;
|
|
||||||
drop table t1;
|
|
||||||
source include/sync_slave_sql_with_master.inc;
|
|
@@ -1,17 +0,0 @@
|
|||||||
create table t1 (id int primary key, value int) engine = rocksdb;
|
|
||||||
|
|
||||||
insert into t1 values (1,1),(2,2),(3,3);
|
|
||||||
|
|
||||||
eval set session debug= $myrocks_debug_set_code;
|
|
||||||
--error ER_INTERNAL_ERROR
|
|
||||||
insert into t1 values (4,4);
|
|
||||||
|
|
||||||
begin;
|
|
||||||
insert into t1 values (5,5);
|
|
||||||
insert into t1 values (6,6);
|
|
||||||
--error ER_INTERNAL_ERROR
|
|
||||||
commit;
|
|
||||||
eval set session debug= $myrocks_debug_unset_code;
|
|
||||||
select * from t1 order by id;
|
|
||||||
|
|
||||||
drop table t1;
|
|
@@ -15,8 +15,8 @@ use strict;
|
|||||||
|
|
||||||
my $sst_dump=
|
my $sst_dump=
|
||||||
::mtr_exe_maybe_exists(
|
::mtr_exe_maybe_exists(
|
||||||
"$::bindir/storage/rocksdb$::multiconfig/mariadb-sst-dump",
|
"$::bindir/storage/rocksdb$::multiconfig/sst_dump",
|
||||||
"$::path_client_bindir/mariadb-sst-dump");
|
"$::path_client_bindir/sst_dump");
|
||||||
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
|
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
|
||||||
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
|
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
|
||||||
|
|
||||||
|
@@ -1,50 +0,0 @@
|
|||||||
CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO valid_values VALUES(1);
|
|
||||||
INSERT INTO valid_values VALUES(0);
|
|
||||||
INSERT INTO valid_values VALUES('on');
|
|
||||||
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
SET @start_global_value = @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS;
|
|
||||||
SELECT @start_global_value;
|
|
||||||
@start_global_value
|
|
||||||
0
|
|
||||||
'# Setting to valid values in global scope#'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS to 1"
|
|
||||||
SET @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS = 1;
|
|
||||||
SELECT @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS
|
|
||||||
0
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS
|
|
||||||
0
|
|
||||||
"Trying to set variable @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS to 0"
|
|
||||||
SET @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS = 0;
|
|
||||||
SELECT @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS
|
|
||||||
0
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS
|
|
||||||
0
|
|
||||||
"Trying to set variable @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS to on"
|
|
||||||
SET @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS = on;
|
|
||||||
SELECT @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS
|
|
||||||
0
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS
|
|
||||||
0
|
|
||||||
"Trying to set variable @@session.ROCKSDB_CANCEL_MANUAL_COMPACTIONS to 444. It should fail because it is not session."
|
|
||||||
SET @@session.ROCKSDB_CANCEL_MANUAL_COMPACTIONS = 444;
|
|
||||||
ERROR HY000: Variable 'rocksdb_cancel_manual_compactions' is a GLOBAL variable and should be set with SET GLOBAL
|
|
||||||
'# Testing with invalid values in global scope #'
|
|
||||||
SET @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS = @start_global_value;
|
|
||||||
SELECT @@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_CANCEL_MANUAL_COMPACTIONS
|
|
||||||
0
|
|
||||||
DROP TABLE valid_values;
|
|
||||||
DROP TABLE invalid_values;
|
|
@@ -1,32 +1,6 @@
|
|||||||
SET @@global.ROCKSDB_DELETE_CF = 'nonexistent_cf';
|
SET @@global.ROCKSDB_DELETE_CF = 'nonexistent_cf';
|
||||||
ERROR HY000: Cannot drop Column family ('nonexistent_cf') because it is in use or does not exist.
|
ERROR 42000: Variable 'rocksdb_delete_cf' can't be set to the value of 'nonexistent_cf'
|
||||||
SET @@global.ROCKSDB_DELETE_CF = '__system__';
|
SET @@global.ROCKSDB_DELETE_CF = '__system__';
|
||||||
ERROR HY000: Cannot drop Column family ('__system__') because it is in use or does not exist.
|
ERROR 42000: Variable 'rocksdb_delete_cf' can't be set to the value of '__system__'
|
||||||
select count(*) from information_schema.rocksdb_ddl where cf = 'default';
|
|
||||||
count(*)
|
|
||||||
0
|
|
||||||
SET @@global.ROCKSDB_DELETE_CF = 'default';
|
SET @@global.ROCKSDB_DELETE_CF = 'default';
|
||||||
ERROR HY000: Cannot drop Column family ('default') because it is in use or does not exist.
|
ERROR 42000: Variable 'rocksdb_delete_cf' can't be set to the value of 'default'
|
||||||
SET @@global.ROCKSDB_DELETE_CF = '';
|
|
||||||
ERROR HY000: Cannot drop Column family ('') because it is in use or does not exist.
|
|
||||||
SET @@global.ROCKSDB_DELETE_CF = NULL;
|
|
||||||
CREATE TABLE cf_deletion_test_table1 (
|
|
||||||
id1 int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
id2 int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
PRIMARY KEY (id1) COMMENT 'cf_primary_key',
|
|
||||||
KEY `sec_key` (id2) COMMENT 'cf_secondary_key'
|
|
||||||
) ENGINE=ROCKSDB;
|
|
||||||
SET @@global.ROCKSDB_DELETE_CF = 'cf_primary_key';
|
|
||||||
ERROR HY000: Cannot drop Column family ('cf_primary_key') because it is in use or does not exist.
|
|
||||||
SET @@global.ROCKSDB_DELETE_CF = 'cf_secondary_key';
|
|
||||||
ERROR HY000: Cannot drop Column family ('cf_secondary_key') because it is in use or does not exist.
|
|
||||||
CREATE TABLE cf_deletion_test_table2 (
|
|
||||||
id1 int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
PRIMARY KEY (id1) COMMENT 'cf_primary_key'
|
|
||||||
) ENGINE=ROCKSDB;
|
|
||||||
DROP TABLE cf_deletion_test_table1;
|
|
||||||
SET @@global.ROCKSDB_DELETE_CF = 'cf_primary_key';
|
|
||||||
ERROR HY000: Cannot drop Column family ('cf_primary_key') because it is in use or does not exist.
|
|
||||||
SET @@global.ROCKSDB_DELETE_CF = 'cf_secondary_key';
|
|
||||||
DROP TABLE cf_deletion_test_table2;
|
|
||||||
SET @@global.ROCKSDB_DELETE_CF = 'cf_primary_key';
|
|
||||||
|
@@ -1,35 +0,0 @@
|
|||||||
connect con1, localhost, root,,;
|
|
||||||
connect con2, localhost, root,,;
|
|
||||||
connection con2;
|
|
||||||
SET SESSION rocksdb_enable_iterate_bounds=1;
|
|
||||||
connection con1;
|
|
||||||
SET SESSION rocksdb_enable_iterate_bounds=0;
|
|
||||||
SELECT @@rocksdb_enable_iterate_bounds;
|
|
||||||
@@rocksdb_enable_iterate_bounds
|
|
||||||
0
|
|
||||||
DROP TABLE IF EXISTS t;
|
|
||||||
Warnings:
|
|
||||||
Note 1051 Unknown table 'test.t'
|
|
||||||
SELECT COUNT(*) FROM t WHERE a = 1;
|
|
||||||
COUNT(*)
|
|
||||||
1
|
|
||||||
SELECT COUNT(*) FROM t WHERE a >= 1 AND a <= 32;
|
|
||||||
COUNT(*)
|
|
||||||
32
|
|
||||||
SELECT COUNT(*) FROM t;
|
|
||||||
COUNT(*)
|
|
||||||
64
|
|
||||||
connection con2;
|
|
||||||
SELECT @@rocksdb_enable_iterate_bounds;
|
|
||||||
@@rocksdb_enable_iterate_bounds
|
|
||||||
1
|
|
||||||
SELECT COUNT(*) FROM t WHERE a = 1;
|
|
||||||
COUNT(*)
|
|
||||||
1
|
|
||||||
SELECT COUNT(*) FROM t WHERE a >= 1 AND a <= 32;
|
|
||||||
COUNT(*)
|
|
||||||
32
|
|
||||||
SELECT COUNT(*) FROM t;
|
|
||||||
COUNT(*)
|
|
||||||
64
|
|
||||||
DROP TABLE t;
|
|
@@ -1,7 +0,0 @@
|
|||||||
SET @start_global_value = @@global.ROCKSDB_ENABLE_PIPELINED_WRITE;
|
|
||||||
SELECT @start_global_value;
|
|
||||||
@start_global_value
|
|
||||||
0
|
|
||||||
"Trying to set variable @@global.ROCKSDB_ENABLE_PIPELINED_WRITE to 444. It should fail because it is readonly."
|
|
||||||
SET @@global.ROCKSDB_ENABLE_PIPELINED_WRITE = 444;
|
|
||||||
ERROR HY000: Variable 'rocksdb_enable_pipelined_write' is a read only variable
|
|
@@ -1,97 +0,0 @@
|
|||||||
CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO valid_values VALUES(1);
|
|
||||||
INSERT INTO valid_values VALUES(0);
|
|
||||||
INSERT INTO valid_values VALUES('on');
|
|
||||||
INSERT INTO valid_values VALUES('off');
|
|
||||||
INSERT INTO valid_values VALUES('true');
|
|
||||||
INSERT INTO valid_values VALUES('false');
|
|
||||||
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO invalid_values VALUES('\'aaa\'');
|
|
||||||
INSERT INTO invalid_values VALUES('\'bbb\'');
|
|
||||||
SET @start_global_value = @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
SELECT @start_global_value;
|
|
||||||
@start_global_value
|
|
||||||
1
|
|
||||||
'# Setting to valid values in global scope#'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS to 1"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = 1;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
1
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
1
|
|
||||||
"Trying to set variable @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS to 0"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = 0;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
0
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
1
|
|
||||||
"Trying to set variable @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS to on"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = on;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
1
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
1
|
|
||||||
"Trying to set variable @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS to off"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = off;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
0
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
1
|
|
||||||
"Trying to set variable @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS to true"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = true;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
1
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
1
|
|
||||||
"Trying to set variable @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS to false"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = false;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
0
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
1
|
|
||||||
"Trying to set variable @@session.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS to 444. It should fail because it is not session."
|
|
||||||
SET @@session.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = 444;
|
|
||||||
ERROR HY000: Variable 'rocksdb_enable_remove_orphaned_dropped_cfs' is a GLOBAL variable and should be set with SET GLOBAL
|
|
||||||
'# Testing with invalid values in global scope #'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS to 'aaa'"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = 'aaa';
|
|
||||||
Got one of the listed errors
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
1
|
|
||||||
"Trying to set variable @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS to 'bbb'"
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = 'bbb';
|
|
||||||
Got one of the listed errors
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
1
|
|
||||||
SET @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS = @start_global_value;
|
|
||||||
SELECT @@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS;
|
|
||||||
@@global.ROCKSDB_ENABLE_REMOVE_ORPHANED_DROPPED_CFS
|
|
||||||
1
|
|
||||||
DROP TABLE valid_values;
|
|
||||||
DROP TABLE invalid_values;
|
|
@@ -1,114 +0,0 @@
|
|||||||
CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO valid_values VALUES('kSkip');
|
|
||||||
INSERT INTO valid_values VALUES('kIfHaveCompactionFilter');
|
|
||||||
INSERT INTO valid_values VALUES('kForce');
|
|
||||||
INSERT INTO valid_values VALUES('kForceOptimized');
|
|
||||||
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO invalid_values VALUES('\'aaa\'');
|
|
||||||
SET @start_global_value = @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
SELECT @start_global_value;
|
|
||||||
@start_global_value
|
|
||||||
kForceOptimized
|
|
||||||
SET @start_session_value = @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
SELECT @start_session_value;
|
|
||||||
@start_session_value
|
|
||||||
kForceOptimized
|
|
||||||
'# Setting to valid values in global scope#'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kSkip"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kSkip;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kSkip
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kIfHaveCompactionFilter"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kIfHaveCompactionFilter;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kIfHaveCompactionFilter
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kForce"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kForce;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForce
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kForceOptimized"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kForceOptimized;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
'# Setting to valid values in session scope#'
|
|
||||||
"Trying to set variable @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kSkip"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kSkip;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kSkip
|
|
||||||
"Setting the session scope variable back to default"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Trying to set variable @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kIfHaveCompactionFilter"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kIfHaveCompactionFilter;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kIfHaveCompactionFilter
|
|
||||||
"Setting the session scope variable back to default"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Trying to set variable @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kForce"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kForce;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForce
|
|
||||||
"Setting the session scope variable back to default"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Trying to set variable @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to kForceOptimized"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = kForceOptimized;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
"Setting the session scope variable back to default"
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = DEFAULT;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
'# Testing with invalid values in global scope #'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL to 'aaa'"
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = 'aaa';
|
|
||||||
Got one of the listed errors
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
SET @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = @start_global_value;
|
|
||||||
SELECT @@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@global.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
SET @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL = @start_session_value;
|
|
||||||
SELECT @@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL;
|
|
||||||
@@session.ROCKSDB_MANUAL_COMPACTION_BOTTOMMOST_LEVEL
|
|
||||||
kForceOptimized
|
|
||||||
DROP TABLE valid_values;
|
|
||||||
DROP TABLE invalid_values;
|
|
@@ -1,46 +0,0 @@
|
|||||||
CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO valid_values VALUES(1);
|
|
||||||
INSERT INTO valid_values VALUES(64);
|
|
||||||
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO invalid_values VALUES('\'abc\'');
|
|
||||||
SET @start_global_value = @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS;
|
|
||||||
SELECT @start_global_value;
|
|
||||||
@start_global_value
|
|
||||||
-1
|
|
||||||
'# Setting to valid values in global scope#'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS to 1"
|
|
||||||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = 1;
|
|
||||||
SELECT @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS
|
|
||||||
1
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS
|
|
||||||
-1
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS to 64"
|
|
||||||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = 64;
|
|
||||||
SELECT @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS
|
|
||||||
64
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS
|
|
||||||
-1
|
|
||||||
"Trying to set variable @@session.ROCKSDB_MAX_BACKGROUND_COMPACTIONS to 444. It should fail because it is not session."
|
|
||||||
SET @@session.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = 444;
|
|
||||||
ERROR HY000: Variable 'rocksdb_max_background_compactions' is a GLOBAL variable and should be set with SET GLOBAL
|
|
||||||
'# Testing with invalid values in global scope #'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS to 'abc'"
|
|
||||||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = 'abc';
|
|
||||||
Got one of the listed errors
|
|
||||||
SELECT @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS
|
|
||||||
-1
|
|
||||||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = @start_global_value;
|
|
||||||
SELECT @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS
|
|
||||||
-1
|
|
||||||
DROP TABLE valid_values;
|
|
||||||
DROP TABLE invalid_values;
|
|
@@ -1,14 +0,0 @@
|
|||||||
CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO valid_values VALUES(1);
|
|
||||||
INSERT INTO valid_values VALUES(64);
|
|
||||||
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO invalid_values VALUES('\'abc\'');
|
|
||||||
SET @start_global_value = @@global.ROCKSDB_MAX_BACKGROUND_FLUSHES;
|
|
||||||
SELECT @start_global_value;
|
|
||||||
@start_global_value
|
|
||||||
-1
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MAX_BACKGROUND_FLUSHES to 444. It should fail because it is readonly."
|
|
||||||
SET @@global.ROCKSDB_MAX_BACKGROUND_FLUSHES = 444;
|
|
||||||
ERROR HY000: Variable 'rocksdb_max_background_flushes' is a read only variable
|
|
||||||
DROP TABLE valid_values;
|
|
||||||
DROP TABLE invalid_values;
|
|
@@ -1,46 +0,0 @@
|
|||||||
CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO valid_values VALUES(1);
|
|
||||||
INSERT INTO valid_values VALUES(64);
|
|
||||||
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO invalid_values VALUES('\'abc\'');
|
|
||||||
SET @start_global_value = @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS;
|
|
||||||
SELECT @start_global_value;
|
|
||||||
@start_global_value
|
|
||||||
0
|
|
||||||
'# Setting to valid values in global scope#'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS to 1"
|
|
||||||
SET @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS = 1;
|
|
||||||
SELECT @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS
|
|
||||||
1
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS
|
|
||||||
0
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS to 64"
|
|
||||||
SET @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS = 64;
|
|
||||||
SELECT @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS
|
|
||||||
64
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS
|
|
||||||
0
|
|
||||||
"Trying to set variable @@session.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS to 444. It should fail because it is not session."
|
|
||||||
SET @@session.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS = 444;
|
|
||||||
ERROR HY000: Variable 'rocksdb_max_bottom_pri_background_compactions' is a GLOBAL variable and should be set with SET GLOBAL
|
|
||||||
'# Testing with invalid values in global scope #'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS to 'abc'"
|
|
||||||
SET @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS = 'abc';
|
|
||||||
Got one of the listed errors
|
|
||||||
SELECT @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS
|
|
||||||
0
|
|
||||||
SET @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS = @start_global_value;
|
|
||||||
SELECT @@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS;
|
|
||||||
@@global.ROCKSDB_MAX_BOTTOM_PRI_BACKGROUND_COMPACTIONS
|
|
||||||
0
|
|
||||||
DROP TABLE valid_values;
|
|
||||||
DROP TABLE invalid_values;
|
|
@@ -8,6 +8,10 @@ SET @start_global_value = @@global.ROCKSDB_MAX_ROW_LOCKS;
|
|||||||
SELECT @start_global_value;
|
SELECT @start_global_value;
|
||||||
@start_global_value
|
@start_global_value
|
||||||
1048576
|
1048576
|
||||||
|
SET @start_session_value = @@session.ROCKSDB_MAX_ROW_LOCKS;
|
||||||
|
SELECT @start_session_value;
|
||||||
|
@start_session_value
|
||||||
|
1048576
|
||||||
'# Setting to valid values in global scope#'
|
'# Setting to valid values in global scope#'
|
||||||
"Trying to set variable @@global.ROCKSDB_MAX_ROW_LOCKS to 1"
|
"Trying to set variable @@global.ROCKSDB_MAX_ROW_LOCKS to 1"
|
||||||
SET @@global.ROCKSDB_MAX_ROW_LOCKS = 1;
|
SET @@global.ROCKSDB_MAX_ROW_LOCKS = 1;
|
||||||
@@ -39,9 +43,37 @@ SET @@global.ROCKSDB_MAX_ROW_LOCKS = DEFAULT;
|
|||||||
SELECT @@global.ROCKSDB_MAX_ROW_LOCKS;
|
SELECT @@global.ROCKSDB_MAX_ROW_LOCKS;
|
||||||
@@global.ROCKSDB_MAX_ROW_LOCKS
|
@@global.ROCKSDB_MAX_ROW_LOCKS
|
||||||
1048576
|
1048576
|
||||||
"Trying to set variable @@session.ROCKSDB_MAX_ROW_LOCKS to 444. It should fail because it is not session."
|
'# Setting to valid values in session scope#'
|
||||||
SET @@session.ROCKSDB_MAX_ROW_LOCKS = 444;
|
"Trying to set variable @@session.ROCKSDB_MAX_ROW_LOCKS to 1"
|
||||||
ERROR HY000: Variable 'rocksdb_max_row_locks' is a GLOBAL variable and should be set with SET GLOBAL
|
SET @@session.ROCKSDB_MAX_ROW_LOCKS = 1;
|
||||||
|
SELECT @@session.ROCKSDB_MAX_ROW_LOCKS;
|
||||||
|
@@session.ROCKSDB_MAX_ROW_LOCKS
|
||||||
|
1
|
||||||
|
"Setting the session scope variable back to default"
|
||||||
|
SET @@session.ROCKSDB_MAX_ROW_LOCKS = DEFAULT;
|
||||||
|
SELECT @@session.ROCKSDB_MAX_ROW_LOCKS;
|
||||||
|
@@session.ROCKSDB_MAX_ROW_LOCKS
|
||||||
|
1048576
|
||||||
|
"Trying to set variable @@session.ROCKSDB_MAX_ROW_LOCKS to 1024"
|
||||||
|
SET @@session.ROCKSDB_MAX_ROW_LOCKS = 1024;
|
||||||
|
SELECT @@session.ROCKSDB_MAX_ROW_LOCKS;
|
||||||
|
@@session.ROCKSDB_MAX_ROW_LOCKS
|
||||||
|
1024
|
||||||
|
"Setting the session scope variable back to default"
|
||||||
|
SET @@session.ROCKSDB_MAX_ROW_LOCKS = DEFAULT;
|
||||||
|
SELECT @@session.ROCKSDB_MAX_ROW_LOCKS;
|
||||||
|
@@session.ROCKSDB_MAX_ROW_LOCKS
|
||||||
|
1048576
|
||||||
|
"Trying to set variable @@session.ROCKSDB_MAX_ROW_LOCKS to 536870912"
|
||||||
|
SET @@session.ROCKSDB_MAX_ROW_LOCKS = 536870912;
|
||||||
|
SELECT @@session.ROCKSDB_MAX_ROW_LOCKS;
|
||||||
|
@@session.ROCKSDB_MAX_ROW_LOCKS
|
||||||
|
536870912
|
||||||
|
"Setting the session scope variable back to default"
|
||||||
|
SET @@session.ROCKSDB_MAX_ROW_LOCKS = DEFAULT;
|
||||||
|
SELECT @@session.ROCKSDB_MAX_ROW_LOCKS;
|
||||||
|
@@session.ROCKSDB_MAX_ROW_LOCKS
|
||||||
|
1048576
|
||||||
'# Testing with invalid values in global scope #'
|
'# Testing with invalid values in global scope #'
|
||||||
"Trying to set variable @@global.ROCKSDB_MAX_ROW_LOCKS to 'aaa'"
|
"Trying to set variable @@global.ROCKSDB_MAX_ROW_LOCKS to 'aaa'"
|
||||||
SET @@global.ROCKSDB_MAX_ROW_LOCKS = 'aaa';
|
SET @@global.ROCKSDB_MAX_ROW_LOCKS = 'aaa';
|
||||||
@@ -53,5 +85,9 @@ SET @@global.ROCKSDB_MAX_ROW_LOCKS = @start_global_value;
|
|||||||
SELECT @@global.ROCKSDB_MAX_ROW_LOCKS;
|
SELECT @@global.ROCKSDB_MAX_ROW_LOCKS;
|
||||||
@@global.ROCKSDB_MAX_ROW_LOCKS
|
@@global.ROCKSDB_MAX_ROW_LOCKS
|
||||||
1048576
|
1048576
|
||||||
|
SET @@session.ROCKSDB_MAX_ROW_LOCKS = @start_session_value;
|
||||||
|
SELECT @@session.ROCKSDB_MAX_ROW_LOCKS;
|
||||||
|
@@session.ROCKSDB_MAX_ROW_LOCKS
|
||||||
|
1048576
|
||||||
DROP TABLE valid_values;
|
DROP TABLE valid_values;
|
||||||
DROP TABLE invalid_values;
|
DROP TABLE invalid_values;
|
||||||
|
@@ -1,100 +0,0 @@
|
|||||||
CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO valid_values VALUES(1);
|
|
||||||
INSERT INTO valid_values VALUES(0);
|
|
||||||
INSERT INTO valid_values VALUES('on');
|
|
||||||
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam;
|
|
||||||
INSERT INTO invalid_values VALUES('\'aaa\'');
|
|
||||||
INSERT INTO invalid_values VALUES('\'bbb\'');
|
|
||||||
SET @start_global_value = @@global.ROCKSDB_BULK_LOAD;
|
|
||||||
SELECT @start_global_value;
|
|
||||||
@start_global_value
|
|
||||||
0
|
|
||||||
SET @start_session_value = @@session.ROCKSDB_BULK_LOAD;
|
|
||||||
SELECT @start_session_value;
|
|
||||||
@start_session_value
|
|
||||||
0
|
|
||||||
'# Setting to valid values in global scope#'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_BULK_LOAD to 1"
|
|
||||||
SET @@global.ROCKSDB_BULK_LOAD = 1;
|
|
||||||
SELECT @@global.ROCKSDB_BULK_LOAD;
|
|
||||||
@@global.ROCKSDB_BULK_LOAD
|
|
||||||
1
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_BULK_LOAD = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_BULK_LOAD;
|
|
||||||
@@global.ROCKSDB_BULK_LOAD
|
|
||||||
0
|
|
||||||
"Trying to set variable @@global.ROCKSDB_BULK_LOAD to 0"
|
|
||||||
SET @@global.ROCKSDB_BULK_LOAD = 0;
|
|
||||||
SELECT @@global.ROCKSDB_BULK_LOAD;
|
|
||||||
@@global.ROCKSDB_BULK_LOAD
|
|
||||||
0
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_BULK_LOAD = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_BULK_LOAD;
|
|
||||||
@@global.ROCKSDB_BULK_LOAD
|
|
||||||
0
|
|
||||||
"Trying to set variable @@global.ROCKSDB_BULK_LOAD to on"
|
|
||||||
SET @@global.ROCKSDB_BULK_LOAD = on;
|
|
||||||
SELECT @@global.ROCKSDB_BULK_LOAD;
|
|
||||||
@@global.ROCKSDB_BULK_LOAD
|
|
||||||
1
|
|
||||||
"Setting the global scope variable back to default"
|
|
||||||
SET @@global.ROCKSDB_BULK_LOAD = DEFAULT;
|
|
||||||
SELECT @@global.ROCKSDB_BULK_LOAD;
|
|
||||||
@@global.ROCKSDB_BULK_LOAD
|
|
||||||
0
|
|
||||||
'# Setting to valid values in session scope#'
|
|
||||||
"Trying to set variable @@session.ROCKSDB_BULK_LOAD to 1"
|
|
||||||
SET @@session.ROCKSDB_BULK_LOAD = 1;
|
|
||||||
SELECT @@session.ROCKSDB_BULK_LOAD;
|
|
||||||
@@session.ROCKSDB_BULK_LOAD
|
|
||||||
1
|
|
||||||
"Setting the session scope variable back to default"
|
|
||||||
SET @@session.ROCKSDB_BULK_LOAD = DEFAULT;
|
|
||||||
SELECT @@session.ROCKSDB_BULK_LOAD;
|
|
||||||
@@session.ROCKSDB_BULK_LOAD
|
|
||||||
0
|
|
||||||
"Trying to set variable @@session.ROCKSDB_BULK_LOAD to 0"
|
|
||||||
SET @@session.ROCKSDB_BULK_LOAD = 0;
|
|
||||||
SELECT @@session.ROCKSDB_BULK_LOAD;
|
|
||||||
@@session.ROCKSDB_BULK_LOAD
|
|
||||||
0
|
|
||||||
"Setting the session scope variable back to default"
|
|
||||||
SET @@session.ROCKSDB_BULK_LOAD = DEFAULT;
|
|
||||||
SELECT @@session.ROCKSDB_BULK_LOAD;
|
|
||||||
@@session.ROCKSDB_BULK_LOAD
|
|
||||||
0
|
|
||||||
"Trying to set variable @@session.ROCKSDB_BULK_LOAD to on"
|
|
||||||
SET @@session.ROCKSDB_BULK_LOAD = on;
|
|
||||||
SELECT @@session.ROCKSDB_BULK_LOAD;
|
|
||||||
@@session.ROCKSDB_BULK_LOAD
|
|
||||||
1
|
|
||||||
"Setting the session scope variable back to default"
|
|
||||||
SET @@session.ROCKSDB_BULK_LOAD = DEFAULT;
|
|
||||||
SELECT @@session.ROCKSDB_BULK_LOAD;
|
|
||||||
@@session.ROCKSDB_BULK_LOAD
|
|
||||||
0
|
|
||||||
'# Testing with invalid values in global scope #'
|
|
||||||
"Trying to set variable @@global.ROCKSDB_BULK_LOAD to 'aaa'"
|
|
||||||
SET @@global.ROCKSDB_BULK_LOAD = 'aaa';
|
|
||||||
Got one of the listed errors
|
|
||||||
SELECT @@global.ROCKSDB_BULK_LOAD;
|
|
||||||
@@global.ROCKSDB_BULK_LOAD
|
|
||||||
0
|
|
||||||
"Trying to set variable @@global.ROCKSDB_BULK_LOAD to 'bbb'"
|
|
||||||
SET @@global.ROCKSDB_BULK_LOAD = 'bbb';
|
|
||||||
Got one of the listed errors
|
|
||||||
SELECT @@global.ROCKSDB_BULK_LOAD;
|
|
||||||
@@global.ROCKSDB_BULK_LOAD
|
|
||||||
0
|
|
||||||
SET @@global.ROCKSDB_BULK_LOAD = @start_global_value;
|
|
||||||
SELECT @@global.ROCKSDB_BULK_LOAD;
|
|
||||||
@@global.ROCKSDB_BULK_LOAD
|
|
||||||
0
|
|
||||||
SET @@session.ROCKSDB_BULK_LOAD = @start_session_value;
|
|
||||||
SELECT @@session.ROCKSDB_BULK_LOAD;
|
|
||||||
@@session.ROCKSDB_BULK_LOAD
|
|
||||||
0
|
|
||||||
DROP TABLE valid_values;
|
|
||||||
DROP TABLE invalid_values;
|
|
@@ -11,7 +11,7 @@ INSERT INTO invalid_values VALUES('\'484436\'');
|
|||||||
SET @start_global_value = @@global.ROCKSDB_STATS_LEVEL;
|
SET @start_global_value = @@global.ROCKSDB_STATS_LEVEL;
|
||||||
SELECT @start_global_value;
|
SELECT @start_global_value;
|
||||||
@start_global_value
|
@start_global_value
|
||||||
1
|
0
|
||||||
'# Setting to valid values in global scope#'
|
'# Setting to valid values in global scope#'
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 0"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 0"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = 0;
|
SET @@global.ROCKSDB_STATS_LEVEL = 0;
|
||||||
@@ -22,7 +22,7 @@ SELECT @@global.ROCKSDB_STATS_LEVEL;
|
|||||||
SET @@global.ROCKSDB_STATS_LEVEL = DEFAULT;
|
SET @@global.ROCKSDB_STATS_LEVEL = DEFAULT;
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
1
|
0
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 4"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 4"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = 4;
|
SET @@global.ROCKSDB_STATS_LEVEL = 4;
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@ -32,7 +32,7 @@ SELECT @@global.ROCKSDB_STATS_LEVEL;
|
|||||||
SET @@global.ROCKSDB_STATS_LEVEL = DEFAULT;
|
SET @@global.ROCKSDB_STATS_LEVEL = DEFAULT;
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
1
|
0
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 2"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 2"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = 2;
|
SET @@global.ROCKSDB_STATS_LEVEL = 2;
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@ -42,7 +42,7 @@ SELECT @@global.ROCKSDB_STATS_LEVEL;
|
|||||||
SET @@global.ROCKSDB_STATS_LEVEL = DEFAULT;
|
SET @@global.ROCKSDB_STATS_LEVEL = DEFAULT;
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
1
|
0
|
||||||
"Trying to set variable @@session.ROCKSDB_STATS_LEVEL to 444. It should fail because it is not session."
|
"Trying to set variable @@session.ROCKSDB_STATS_LEVEL to 444. It should fail because it is not session."
|
||||||
SET @@session.ROCKSDB_STATS_LEVEL = 444;
|
SET @@session.ROCKSDB_STATS_LEVEL = 444;
|
||||||
ERROR HY000: Variable 'rocksdb_stats_level' is a GLOBAL variable and should be set with SET GLOBAL
|
ERROR HY000: Variable 'rocksdb_stats_level' is a GLOBAL variable and should be set with SET GLOBAL
|
||||||
@@ -52,34 +52,34 @@ SET @@global.ROCKSDB_STATS_LEVEL = 'aaa';
|
|||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
1
|
0
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 'bbb'"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 'bbb'"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = 'bbb';
|
SET @@global.ROCKSDB_STATS_LEVEL = 'bbb';
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
1
|
0
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to '-1'"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to '-1'"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = '-1';
|
SET @@global.ROCKSDB_STATS_LEVEL = '-1';
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
1
|
0
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to '101'"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to '101'"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = '101';
|
SET @@global.ROCKSDB_STATS_LEVEL = '101';
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
1
|
0
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to '484436'"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to '484436'"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = '484436';
|
SET @@global.ROCKSDB_STATS_LEVEL = '484436';
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
1
|
0
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = @start_global_value;
|
SET @@global.ROCKSDB_STATS_LEVEL = @start_global_value;
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
1
|
0
|
||||||
DROP TABLE valid_values;
|
DROP TABLE valid_values;
|
||||||
DROP TABLE invalid_values;
|
DROP TABLE invalid_values;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user