Commit 3fae64b1 authored by Sergei Petrunia's avatar Sergei Petrunia

Copy of

commit 184a4a2d82f4f6f3cbcb1015bcdb32bebe73315c
Author: Abhinav Sharma <abhinavsharma@fb.com>
Date:   Thu Sep 14 11:40:08 2017 -0700

    Bump rocksdb submodule

    Summary:
    Bump rocksdb to include the fix for rocksdb.trx_info_rpl

    The bug was introduced in: https://github.com/facebook/rocksdb/pull/2850
    Fixed in: https://github.com/facebook/rocksdb/pull/2881

    update-submodule: rocksdb

    Reviewed By: lth

    Differential Revision: D5834658

    fbshipit-source-id: d1551bf
parent 43d5edf9
...@@ -106,6 +106,12 @@ IF (NOT "$ENV{WITH_ZSTD}" STREQUAL "") ...@@ -106,6 +106,12 @@ IF (NOT "$ENV{WITH_ZSTD}" STREQUAL "")
ADD_DEFINITIONS(-DZSTD) ADD_DEFINITIONS(-DZSTD)
ENDIF() ENDIF()
IF (NOT "$ENV{WITH_TBB}" STREQUAL "")
SET(rocksdb_static_libs ${rocksdb_static_libs}
$ENV{WITH_TBB}/libtbb${PIC_EXT}.a)
ADD_DEFINITIONS(-DTBB)
ENDIF()
CHECK_INCLUDE_FILES(zlib.h HAVE_ZLIB_H) CHECK_INCLUDE_FILES(zlib.h HAVE_ZLIB_H)
IF (HAVE_ZLIB_H) IF (HAVE_ZLIB_H)
......
This diff is collapsed.
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
/* C++ standard header files */ /* C++ standard header files */
#include <set> #include <set>
#include <string> #include <string>
#include <unordered_map>
#include <unordered_set> #include <unordered_set>
#include <vector> #include <vector>
...@@ -235,6 +236,12 @@ const char *const RDB_TTL_COL_QUALIFIER = "ttl_col"; ...@@ -235,6 +236,12 @@ const char *const RDB_TTL_COL_QUALIFIER = "ttl_col";
*/ */
#define ROCKSDB_SIZEOF_TTL_RECORD sizeof(longlong) #define ROCKSDB_SIZEOF_TTL_RECORD sizeof(longlong)
/*
Maximum index prefix length in bytes.
*/
#define MAX_INDEX_COL_LEN_LARGE 3072
#define MAX_INDEX_COL_LEN_SMALL 767
/* /*
MyRocks specific error codes. NB! Please make sure that you will update MyRocks specific error codes. NB! Please make sure that you will update
HA_ERR_ROCKSDB_LAST when adding new ones. Also update the strings in HA_ERR_ROCKSDB_LAST when adding new ones. Also update the strings in
...@@ -293,7 +300,14 @@ struct Rdb_table_handler { ...@@ -293,7 +300,14 @@ struct Rdb_table_handler {
/* Stores cumulative table statistics */ /* Stores cumulative table statistics */
my_io_perf_atomic_t m_io_perf_read; my_io_perf_atomic_t m_io_perf_read;
my_io_perf_atomic_t m_io_perf_write;
Rdb_atomic_perf_counters m_table_perf_context; Rdb_atomic_perf_counters m_table_perf_context;
/* Stores cached memtable estimate statistics */
std::atomic_uint m_mtcache_lock;
uint64_t m_mtcache_count;
uint64_t m_mtcache_size;
uint64_t m_mtcache_last_update;
}; };
class Rdb_key_def; class Rdb_key_def;
...@@ -360,6 +374,8 @@ struct st_global_stats { ...@@ -360,6 +374,8 @@ struct st_global_stats {
ib_counter_t<ulonglong, 64, RDB_INDEXER> system_rows[ROWS_MAX]; ib_counter_t<ulonglong, 64, RDB_INDEXER> system_rows[ROWS_MAX];
ib_counter_t<ulonglong, 64, RDB_INDEXER> queries[QUERIES_MAX]; ib_counter_t<ulonglong, 64, RDB_INDEXER> queries[QUERIES_MAX];
ib_counter_t<ulonglong, 64, RDB_INDEXER> covered_secondary_key_lookups;
}; };
/* Struct used for exporting status to MySQL */ /* Struct used for exporting status to MySQL */
...@@ -379,6 +395,8 @@ struct st_export_stats { ...@@ -379,6 +395,8 @@ struct st_export_stats {
ulonglong queries_point; ulonglong queries_point;
ulonglong queries_range; ulonglong queries_range;
ulonglong covered_secondary_key_lookups;
}; };
/* Struct used for exporting RocksDB memory status */ /* Struct used for exporting RocksDB memory status */
...@@ -387,6 +405,27 @@ struct st_memory_stats { ...@@ -387,6 +405,27 @@ struct st_memory_stats {
ulonglong memtable_unflushed; ulonglong memtable_unflushed;
}; };
/* Struct used for exporting RocksDB IO stalls stats */
struct st_io_stall_stats {
ulonglong level0_slowdown;
ulonglong level0_slowdown_with_compaction;
ulonglong level0_numfiles;
ulonglong level0_numfiles_with_compaction;
ulonglong stop_for_pending_compaction_bytes;
ulonglong slowdown_for_pending_compaction_bytes;
ulonglong memtable_compaction;
ulonglong memtable_slowdown;
ulonglong total_stop;
ulonglong total_slowdown;
st_io_stall_stats()
: level0_slowdown(0), level0_slowdown_with_compaction(0),
level0_numfiles(0), level0_numfiles_with_compaction(0),
stop_for_pending_compaction_bytes(0),
slowdown_for_pending_compaction_bytes(0), memtable_compaction(0),
memtable_slowdown(0), total_stop(0), total_slowdown(0) {}
};
} // namespace myrocks } // namespace myrocks
#include "./rdb_buff.h" #include "./rdb_buff.h"
...@@ -495,6 +534,12 @@ class ha_rocksdb : public my_core::handler { ...@@ -495,6 +534,12 @@ class ha_rocksdb : public my_core::handler {
Pointer to the original TTL timestamp value (8 bytes) during UPDATE. Pointer to the original TTL timestamp value (8 bytes) during UPDATE.
*/ */
char m_ttl_bytes[ROCKSDB_SIZEOF_TTL_RECORD]; char m_ttl_bytes[ROCKSDB_SIZEOF_TTL_RECORD];
/*
The TTL timestamp value can change if the explicit TTL column is
updated. If we detect this when updating the PK, we indicate it here so
we know we must always update any SK's.
*/
bool m_ttl_bytes_updated;
/* rowkey of the last record we've read, in StorageFormat. */ /* rowkey of the last record we've read, in StorageFormat. */
String m_last_rowkey; String m_last_rowkey;
...@@ -541,7 +586,9 @@ class ha_rocksdb : public my_core::handler { ...@@ -541,7 +586,9 @@ class ha_rocksdb : public my_core::handler {
bool m_update_scope_is_valid; bool m_update_scope_is_valid;
/* SST information used for bulk loading the primary key */ /* SST information used for bulk loading the primary key */
std::shared_ptr<Rdb_sst_info> m_sst_info; std::unique_ptr<Rdb_sst_info> m_sst_info;
/* External merge sorts for bulk load: key ID -> merge sort instance */
std::unordered_map<GL_INDEX_ID, Rdb_index_merge> m_key_merge;
Rdb_transaction *m_bulk_load_tx; Rdb_transaction *m_bulk_load_tx;
/* Mutex to protect finalizing bulk load */ /* Mutex to protect finalizing bulk load */
mysql_mutex_t m_bulk_load_mutex; mysql_mutex_t m_bulk_load_mutex;
...@@ -636,6 +683,13 @@ class ha_rocksdb : public my_core::handler { ...@@ -636,6 +683,13 @@ class ha_rocksdb : public my_core::handler {
/* Setup field_decoders based on type of scan and table->read_set */ /* Setup field_decoders based on type of scan and table->read_set */
void setup_read_decoders(); void setup_read_decoders();
/*
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, 0, 0, nullptr, nullptr};
/* /*
Number of bytes in on-disk (storage) record format that are used for Number of bytes in on-disk (storage) record format that are used for
storing SQL NULL flags. storing SQL NULL flags.
...@@ -854,11 +908,7 @@ class ha_rocksdb : public my_core::handler { ...@@ -854,11 +908,7 @@ class ha_rocksdb : public my_core::handler {
DBUG_RETURN(MAX_REF_PARTS); DBUG_RETURN(MAX_REF_PARTS);
} }
uint max_supported_key_part_length() const override { uint max_supported_key_part_length() const override;
DBUG_ENTER_FUNC();
DBUG_RETURN(2048);
}
/** @brief /** @brief
unireg.cc will call this to make sure that the storage engine can handle unireg.cc will call this to make sure that the storage engine can handle
...@@ -1040,9 +1090,13 @@ class ha_rocksdb : public my_core::handler { ...@@ -1040,9 +1090,13 @@ class ha_rocksdb : public my_core::handler {
rocksdb::Slice *const packed_rec) rocksdb::Slice *const packed_rec)
MY_ATTRIBUTE((__nonnull__)); MY_ATTRIBUTE((__nonnull__));
bool should_hide_ttl_rec(const rocksdb::Slice &ttl_rec_val, bool should_hide_ttl_rec(const Rdb_key_def &kd,
const rocksdb::Slice &ttl_rec_val,
const int64_t curr_ts) const int64_t curr_ts)
MY_ATTRIBUTE((__warn_unused_result__)); MY_ATTRIBUTE((__warn_unused_result__));
void rocksdb_skip_expired_records(const Rdb_key_def &kd,
rocksdb::Iterator *const iter,
bool seek_backward);
int index_first_intern(uchar *buf) int index_first_intern(uchar *buf)
MY_ATTRIBUTE((__nonnull__, __warn_unused_result__)); MY_ATTRIBUTE((__nonnull__, __warn_unused_result__));
...@@ -1076,8 +1130,10 @@ class ha_rocksdb : public my_core::handler { ...@@ -1076,8 +1130,10 @@ class ha_rocksdb : public my_core::handler {
struct unique_sk_buf_info *sk_info) struct unique_sk_buf_info *sk_info)
MY_ATTRIBUTE((__nonnull__, __warn_unused_result__)); MY_ATTRIBUTE((__nonnull__, __warn_unused_result__));
int bulk_load_key(Rdb_transaction *const tx, const Rdb_key_def &kd, int bulk_load_key(Rdb_transaction *const tx, const Rdb_key_def &kd,
const rocksdb::Slice &key, const rocksdb::Slice &value) const rocksdb::Slice &key, const rocksdb::Slice &value,
bool sort)
MY_ATTRIBUTE((__nonnull__, __warn_unused_result__)); MY_ATTRIBUTE((__nonnull__, __warn_unused_result__));
void update_bytes_written(ulonglong bytes_written);
int update_pk(const Rdb_key_def &kd, const struct update_row_info &row_info, int update_pk(const Rdb_key_def &kd, const struct update_row_info &row_info,
const bool &pk_changed) MY_ATTRIBUTE((__warn_unused_result__)); const bool &pk_changed) MY_ATTRIBUTE((__warn_unused_result__));
int update_sk(const TABLE *const table_arg, const Rdb_key_def &kd, int update_sk(const TABLE *const table_arg, const Rdb_key_def &kd,
......
...@@ -76,6 +76,7 @@ bool rdb_is_ttl_read_filtering_enabled(); ...@@ -76,6 +76,7 @@ bool rdb_is_ttl_read_filtering_enabled();
int rdb_dbug_set_ttl_rec_ts(); int rdb_dbug_set_ttl_rec_ts();
int rdb_dbug_set_ttl_snapshot_ts(); int rdb_dbug_set_ttl_snapshot_ts();
int rdb_dbug_set_ttl_read_filter_ts(); int rdb_dbug_set_ttl_read_filter_ts();
bool rdb_dbug_set_ttl_ignore_pk();
#endif #endif
enum operation_type : int; enum operation_type : int;
......
#
# A helper include file for prefix index index-only query tests
#
# Parameters:
# $prefix_index_check_title - title of the test
# $prefix_index_check_query - test query
# $prefix_index_check_read_avoided_delta - expected change of
# 'rocksdb_covered_secondary_key_lookups' status variable
# value after running the query
--let $show_count_statement = show status like 'rocksdb_covered_secondary_key_lookups'
--echo # $prefix_index_check_title
--let $base_count = query_get_value($show_count_statement, Value, 1)
--eval $prefix_index_check_query
--let $count = query_get_value($show_count_statement, Value, 1)
--let $assert_text= $prefix_index_check_title: $prefix_index_check_read_avoided_delta rocksdb_covered_secondary_key_lookups
--let $assert_cond= $count - $base_count = $prefix_index_check_read_avoided_delta
--source include/assert.inc
...@@ -5,3 +5,4 @@ sql-mode=NO_ENGINE_SUBSTITUTION ...@@ -5,3 +5,4 @@ sql-mode=NO_ENGINE_SUBSTITUTION
explicit-defaults-for-timestamp=1 explicit-defaults-for-timestamp=1
rocksdb_lock_wait_timeout=1 rocksdb_lock_wait_timeout=1
rocksdb_strict_collation_check=0 rocksdb_strict_collation_check=0
rocksdb_force_compute_memtable_stats_cachetime=0
...@@ -4,20 +4,20 @@ CREATE DATABASE mysqlslap; ...@@ -4,20 +4,20 @@ CREATE DATABASE mysqlslap;
USE mysqlslap; USE mysqlslap;
CREATE TABLE t1(id BIGINT AUTO_INCREMENT, value BIGINT, PRIMARY KEY(id)) ENGINE=rocksdb; CREATE TABLE t1(id BIGINT AUTO_INCREMENT, value BIGINT, PRIMARY KEY(id)) ENGINE=rocksdb;
# 2PC enabled, MyRocks durability enabled # 2PC enabled, MyRocks durability enabled
SET GLOBAL rocksdb_enable_2pc=0; SET GLOBAL rocksdb_enable_2pc=1;
SET GLOBAL rocksdb_flush_log_at_trx_commit=1; SET GLOBAL rocksdb_flush_log_at_trx_commit=1;
## 2PC + durability + single thread ## 2PC + durability + single thread
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_wal_group_syncs'; select variable_value into @c from information_schema.global_status where variable_name='rocksdb_wal_group_syncs';
select case when variable_value-@c = 1000 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_wal_group_syncs'; select case when variable_value-@c = 1000 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_wal_group_syncs';
case when variable_value-@c = 1000 then 'true' else 'false' end case when variable_value-@c = 1000 then 'true' else 'false' end
false true
## 2PC + durability + group commit ## 2PC + durability + group commit
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_wal_group_syncs'; select variable_value into @c from information_schema.global_status where variable_name='rocksdb_wal_group_syncs';
select case when variable_value-@c > 0 and variable_value-@c < 10000 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_wal_group_syncs'; select case when variable_value-@c > 0 and variable_value-@c < 10000 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_wal_group_syncs';
case when variable_value-@c > 0 and variable_value-@c < 10000 then 'true' else 'false' end case when variable_value-@c > 0 and variable_value-@c < 10000 then 'true' else 'false' end
false true
# 2PC enabled, MyRocks durability disabled # 2PC enabled, MyRocks durability disabled
SET GLOBAL rocksdb_enable_2pc=0; SET GLOBAL rocksdb_enable_2pc=1;
SET GLOBAL rocksdb_flush_log_at_trx_commit=0; SET GLOBAL rocksdb_flush_log_at_trx_commit=0;
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_wal_group_syncs'; select variable_value into @c from information_schema.global_status where variable_name='rocksdb_wal_group_syncs';
select case when variable_value-@c = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_wal_group_syncs'; select case when variable_value-@c = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_wal_group_syncs';
...@@ -28,16 +28,16 @@ select case when variable_value-@c = 0 then 'true' else 'false' end from informa ...@@ -28,16 +28,16 @@ select case when variable_value-@c = 0 then 'true' else 'false' end from informa
case when variable_value-@c = 0 then 'true' else 'false' end case when variable_value-@c = 0 then 'true' else 'false' end
true true
# 2PC disabled, MyRocks durability enabled # 2PC disabled, MyRocks durability enabled
SET GLOBAL rocksdb_enable_2pc=1; SET GLOBAL rocksdb_enable_2pc=0;
SET GLOBAL rocksdb_flush_log_at_trx_commit=1; SET GLOBAL rocksdb_flush_log_at_trx_commit=1;
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_wal_group_syncs'; select variable_value into @c from information_schema.global_status where variable_name='rocksdb_wal_group_syncs';
select case when variable_value-@c = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_wal_group_syncs'; select case when variable_value-@c = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_wal_group_syncs';
case when variable_value-@c = 0 then 'true' else 'false' end case when variable_value-@c = 0 then 'true' else 'false' end
false true
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_wal_group_syncs'; select variable_value into @c from information_schema.global_status where variable_name='rocksdb_wal_group_syncs';
select case when variable_value-@c = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_wal_group_syncs'; select case when variable_value-@c = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_wal_group_syncs';
case when variable_value-@c = 0 then 'true' else 'false' end case when variable_value-@c = 0 then 'true' else 'false' end
false true
SET GLOBAL rocksdb_enable_2pc=1; SET GLOBAL rocksdb_enable_2pc=1;
SET GLOBAL rocksdb_flush_log_at_trx_commit=1; SET GLOBAL rocksdb_flush_log_at_trx_commit=1;
DROP TABLE t1; DROP TABLE t1;
......
...@@ -284,12 +284,16 @@ DROP TABLE t1; ...@@ -284,12 +284,16 @@ DROP TABLE t1;
set global rocksdb_bulk_load=1; set global rocksdb_bulk_load=1;
# Establish connection con1 (user=root) # Establish connection con1 (user=root)
# Switch to connection con1 # Switch to connection con1
show global variables like 'rocksdb_bulk_load'; show global variables like 'rocksdb_bulk_load%';
Variable_name Value Variable_name Value
rocksdb_bulk_load ON rocksdb_bulk_load ON
show session variables like 'rocksdb_bulk_load'; rocksdb_bulk_load_allow_unsorted OFF
rocksdb_bulk_load_size 1000
show session variables like 'rocksdb_bulk_load%';
Variable_name Value Variable_name Value
rocksdb_bulk_load ON rocksdb_bulk_load ON
rocksdb_bulk_load_allow_unsorted OFF
rocksdb_bulk_load_size 1000
CREATE TABLE t1 (i INT, j INT, PRIMARY KEY (i)) ENGINE = ROCKSDB; CREATE TABLE t1 (i INT, j INT, PRIMARY KEY (i)) ENGINE = ROCKSDB;
INSERT INTO t1 VALUES (1,1); INSERT INTO t1 VALUES (1,1);
# Disconnecting on con1 # Disconnecting on con1
...@@ -327,10 +331,11 @@ SET @prior_rocksdb_strict_collation_check= @@rocksdb_strict_collation_check; ...@@ -327,10 +331,11 @@ SET @prior_rocksdb_strict_collation_check= @@rocksdb_strict_collation_check;
SET @prior_rocksdb_merge_buf_size = @@rocksdb_merge_buf_size; SET @prior_rocksdb_merge_buf_size = @@rocksdb_merge_buf_size;
SET global rocksdb_strict_collation_check = off; SET global rocksdb_strict_collation_check = off;
SET session rocksdb_merge_combine_read_size = 566; SET session rocksdb_merge_combine_read_size = 566;
SET session rocksdb_merge_buf_size = 336; SET session rocksdb_merge_buf_size = 340;
show variables like '%rocksdb_bulk_load%'; show variables like 'rocksdb_bulk_load%';
Variable_name Value Variable_name Value
rocksdb_bulk_load OFF rocksdb_bulk_load OFF
rocksdb_bulk_load_allow_unsorted OFF
rocksdb_bulk_load_size 1000 rocksdb_bulk_load_size 1000
CREATE TABLE t1 (a VARCHAR(80)) ENGINE=RocksDB; CREATE TABLE t1 (a VARCHAR(80)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (REPEAT("a", 80)); INSERT INTO t1 (a) VALUES (REPEAT("a", 80));
......
...@@ -16,4 +16,30 @@ INSERT INTO t1 VALUES(20); ...@@ -16,4 +16,30 @@ INSERT INTO t1 VALUES(20);
INSERT INTO t1 VALUES(21); INSERT INTO t1 VALUES(21);
SET rocksdb_bulk_load=0; SET rocksdb_bulk_load=0;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
TRUNCATE TABLE t1;
SET rocksdb_bulk_load_allow_unsorted=1;
SET rocksdb_bulk_load=1;
INSERT INTO t1 VALUES(100);
INSERT INTO t1 VALUES(101);
INSERT INTO t1 VALUES(99);
SET rocksdb_bulk_load=0;
SELECT * FROM t1;
pk
99
100
101
TRUNCATE TABLE t1;
SET rocksdb_bulk_load=1;
INSERT INTO t1 VALUES(201);
INSERT INTO t1 VALUES(200);
INSERT INTO t1 VALUES(202);
INSERT INTO t1 VALUES(201);
ERROR 23000: Failed to insert the record: the key already exists
SET rocksdb_bulk_load=0;
SELECT * FROM t1;
pk
200
201
202
SET rocksdb_bulk_load_allow_unsorted=DEFAULT;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE IF EXISTS t1;
SET rocksdb_bulk_load_size=3;
SET rocksdb_bulk_load_allow_unsorted=1;
CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a) COMMENT "cf1");
SET rocksdb_bulk_load=1;
SELECT * FROM t1;
a b
SET rocksdb_bulk_load=0;
SELECT * FROM t1;
a b
-3 5
-1 3
2 0
4 -2
6 -4
DROP TABLE t1;
CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a) COMMENT "cf1", KEY(b));
SET rocksdb_bulk_load=1;
SELECT * FROM t1;
a b
6 -4
4 -2
2 0
-1 3
-3 5
SET rocksdb_bulk_load=0;
DROP TABLE t1;
CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a) COMMENT "cf1");
CREATE TABLE t2(a INT, b INT, PRIMARY KEY(a) COMMENT "cf1");
SET rocksdb_bulk_load=1;
INSERT INTO t1 VALUES (1,1);
INSERT INTO t2 VALUES (1,1);
SELECT * FROM t1;
a b
1 1
INSERT INTO t1 VALUES (2,2);
SELECT * FROM t2;
a b
1 1
SELECT * FROM t1;
a b
1 1
SET rocksdb_bulk_load=0;
SELECT * FROM t1;
a b
1 1
2 2
DROP TABLE t1, t2;
CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a) COMMENT "cf1");
CREATE TABLE t2(a INT, b INT, PRIMARY KEY(b) COMMENT "cf1");
CREATE TABLE t3(a INT, b INT, PRIMARY KEY(a) COMMENT "cf1")
PARTITION BY KEY() PARTITIONS 4;
set session transaction isolation level repeatable read;
select * from information_schema.rocksdb_dbstats where stat_type='DB_NUM_SNAPSHOTS';
STAT_TYPE VALUE
DB_NUM_SNAPSHOTS 0
start transaction with consistent snapshot;
select * from information_schema.rocksdb_dbstats where stat_type='DB_NUM_SNAPSHOTS';
STAT_TYPE VALUE
DB_NUM_SNAPSHOTS 1
set rocksdb_bulk_load=1;
set rocksdb_bulk_load_size=100000;
LOAD DATA INFILE <input_file> INTO TABLE t1;
LOAD DATA INFILE <input_file> INTO TABLE t2;
LOAD DATA INFILE <input_file> INTO TABLE t3;
set rocksdb_bulk_load=0;
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 ROCKSDB 10 Fixed 5000000 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t2 ROCKSDB 10 Fixed 5000000 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t3 ROCKSDB 10 Fixed 5000000 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
ANALYZE TABLE t1, t2, t3;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t2 analyze status OK
test.t3 analyze status OK
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 ROCKSDB 10 Fixed 5000000 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t2 ROCKSDB 10 Fixed 5000000 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t3 ROCKSDB 10 Fixed 5000000 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
select count(a) from t1;
count(a)
5000000
select count(b) from t1;
count(b)
5000000
select count(a) from t2;
count(a)
5000000
select count(b) from t2;
count(b)
5000000
select count(a) from t3;
count(a)
5000000
select count(b) from t3;
count(b)
5000000
DROP TABLE t1, t2, t3;
SET rocksdb_bulk_load_allow_unsorted=0;
SET rocksdb_bulk_load=1;
SET rocksdb_bulk_load_allow_unsorted=1;
ERROR HY000: Error when executing command SET: Cannot change this setting while bulk load is enabled
SET rocksdb_bulk_load=0;
DROP TABLE IF EXISTS stats_test_table;
CREATE TABLE stats_test_table (a INT, b INT, PRIMARY KEY (a)) ENGINE=ROCKSDB;
SET GLOBAL rocksdb_perf_context_level=3;
INSERT INTO stats_test_table VALUES (7,1);
INSERT INTO stats_test_table VALUES (2,2);
SELECT io_write_bytes > 0 FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME = "stats_test_table";
io_write_bytes > 0
1
DROP TABLE stats_test_table;
SET GLOBAL rocksdb_perf_context_level=DEFAULT;
...@@ -5,7 +5,7 @@ connection con1; ...@@ -5,7 +5,7 @@ connection con1;
CREATE TABLE t1 (a INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=ROCKSDB; CREATE TABLE t1 (a INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=ROCKSDB;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
START TRANSACTION WITH CONSISTENT SNAPSHOT; START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 1938 ERROR: 12048
connection con2; connection con2;
select * from information_schema.rocksdb_dbstats where stat_type='DB_NUM_SNAPSHOTS'; select * from information_schema.rocksdb_dbstats where stat_type='DB_NUM_SNAPSHOTS';
STAT_TYPE VALUE STAT_TYPE VALUE
...@@ -18,7 +18,7 @@ STAT_TYPE VALUE ...@@ -18,7 +18,7 @@ STAT_TYPE VALUE
DB_NUM_SNAPSHOTS 0 DB_NUM_SNAPSHOTS 0
connection con1; connection con1;
START TRANSACTION WITH CONSISTENT SNAPSHOT; START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 1938 ERROR: 12048
connection con2; connection con2;
INSERT INTO t1 (a) VALUES (1); INSERT INTO t1 (a) VALUES (1);
connection con1; connection con1;
...@@ -69,7 +69,7 @@ id value value2 ...@@ -69,7 +69,7 @@ id value value2
5 5 5 5 5 5
6 6 6 6 6 6
START TRANSACTION WITH CONSISTENT SNAPSHOT; START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 1938 ERROR: 12048
connection con2; connection con2;
INSERT INTO r1 values (7,7,7); INSERT INTO r1 values (7,7,7);
connection con1; connection con1;
...@@ -107,12 +107,12 @@ id value value2 ...@@ -107,12 +107,12 @@ id value value2
7 7 7 7 7 7
8 8 8 8 8 8
START TRANSACTION WITH CONSISTENT SNAPSHOT; START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 1938 ERROR: 12048
connection con2; connection con2;
INSERT INTO r1 values (9,9,9); INSERT INTO r1 values (9,9,9);
connection con1; connection con1;
START TRANSACTION WITH CONSISTENT SNAPSHOT; START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 1938 ERROR: 12048
connection con2; connection con2;
INSERT INTO r1 values (10,10,10); INSERT INTO r1 values (10,10,10);
connection con1; connection con1;
...@@ -129,7 +129,7 @@ id value value2 ...@@ -129,7 +129,7 @@ id value value2
9 9 9 9 9 9
10 10 10 10 10 10
START TRANSACTION WITH CONSISTENT SNAPSHOT; START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 1938 ERROR: 12048
INSERT INTO r1 values (11,11,11); INSERT INTO r1 values (11,11,11);
ERROR: 0 ERROR: 0
SELECT * FROM r1; SELECT * FROM r1;
......
...@@ -125,7 +125,7 @@ id value value2 ...@@ -125,7 +125,7 @@ id value value2
START TRANSACTION WITH CONSISTENT SNAPSHOT; START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 0 ERROR: 0
INSERT INTO r1 values (11,11,11); INSERT INTO r1 values (11,11,11);
ERROR: 1935 ERROR: 12045
SELECT * FROM r1; SELECT * FROM r1;
id value value2 id value value2
1 1 1 1 1 1
......
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id INT,
fake_id INT,
bigfield VARCHAR(4096),
PRIMARY KEY (id),
KEY bf (bigfield(32)),
KEY fid (fake_id, bigfield(32))
) ENGINE=rocksdb;
INSERT INTO t1 VALUES (1, 1001, REPEAT('a', 1)),
(8, 1008, REPEAT('b', 8)),
(24, 1024, REPEAT('c', 24)),
(31, 1031, REPEAT('d', 31)),
(32, 1032, REPEAT('x', 32)),
(33, 1033, REPEAT('y', 33)),
(128, 1128, REPEAT('z', 128));
SELECT * FROM t1;
id fake_id bigfield
1 1001 a
8 1008 bbbbbbbb
24 1024 cccccccccccccccccccccccc
31 1031 ddddddddddddddddddddddddddddddd
32 1032 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
33 1033 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
128 1128 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
# Eligible for optimization, access via fake_id only
SELECT id, bigfield FROM t1 FORCE INDEX(fid) WHERE fake_id = 1031;
id bigfield
31 ddddddddddddddddddddddddddddddd
include/assert.inc [Eligible for optimization, access via fake_id only: 2 rocksdb_covered_secondary_key_lookups]
# Not eligible for optimization, access via fake_id of big row.
SELECT id, bigfield FROM t1 FORCE INDEX(fid) WHERE fake_id = 1033;
id bigfield
33 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
include/assert.inc [Not eligible for optimization, access via fake_id of big row.: 0 rocksdb_covered_secondary_key_lookups]
DROP TABLE t1;
set session debug= '+d,MYROCKS_NO_COVERED_BITMAP_FORMAT';
CREATE TABLE t1 (
id INT,
fake_id INT,
bigfield VARCHAR(4096),
PRIMARY KEY (id),
KEY bf (bigfield(32)),
KEY fid (fake_id, bigfield(32))
) ENGINE=rocksdb;
set session debug= '-d,MYROCKS_NO_COVERED_BITMAP_FORMAT';
INSERT INTO t1 VALUES (1, 1001, REPEAT('a', 1)),
(8, 1008, REPEAT('b', 8)),
(24, 1024, REPEAT('c', 24)),
(31, 1031, REPEAT('d', 31)),
(32, 1032, REPEAT('x', 32)),
(33, 1033, REPEAT('y', 33)),
(128, 1128, REPEAT('z', 128));
SELECT * FROM t1;
id fake_id bigfield
1 1001 a
8 1008 bbbbbbbb
24 1024 cccccccccccccccccccccccc
31 1031 ddddddddddddddddddddddddddddddd
32 1032 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
33 1033 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
128 1128 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
# No longer eligible for optimization since no covered bitmap was stored.
SELECT id, bigfield FROM t1 FORCE INDEX(fid) WHERE fake_id = 1031;
id bigfield
31 ddddddddddddddddddddddddddddddd
include/assert.inc [No longer eligible for optimization since no covered bitmap was stored.: 0 rocksdb_covered_secondary_key_lookups]
# Not eligible for optimization.
SELECT id, bigfield FROM t1 FORCE INDEX(fid) WHERE fake_id = 1033;
id bigfield
33 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
include/assert.inc [Not eligible for optimization.: 0 rocksdb_covered_secondary_key_lookups]
DROP TABLE t1;
This diff is collapsed.
This diff is collapsed.
...@@ -3,6 +3,9 @@ DROP TABLE IF EXISTS t2; ...@@ -3,6 +3,9 @@ DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3; DROP TABLE IF EXISTS t3;
DROP TABLE IF EXISTS t4; DROP TABLE IF EXISTS t4;
DROP TABLE IF EXISTS t5; DROP TABLE IF EXISTS t5;
call mtr.add_suppression("Column family 'cf1' not found");
call mtr.add_suppression("Column family 'rev:cf2' not found");
call mtr.add_suppression("LibRocksDB");
set global rocksdb_compact_cf = 'cf1'; set global rocksdb_compact_cf = 'cf1';
set global rocksdb_compact_cf = 'rev:cf2'; set global rocksdb_compact_cf = 'rev:cf2';
set global rocksdb_signal_drop_index_thread = 1; set global rocksdb_signal_drop_index_thread = 1;
......
...@@ -3,6 +3,8 @@ DROP TABLE IF EXISTS t2; ...@@ -3,6 +3,8 @@ DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3; DROP TABLE IF EXISTS t3;
DROP TABLE IF EXISTS t4; DROP TABLE IF EXISTS t4;
DROP TABLE IF EXISTS t5; DROP TABLE IF EXISTS t5;
call mtr.add_suppression("Column family 'cf1' not found");
call mtr.add_suppression("Column family 'rev:cf2' not found");
set global rocksdb_compact_cf = 'cf1'; set global rocksdb_compact_cf = 'cf1';
set global rocksdb_compact_cf = 'rev:cf2'; set global rocksdb_compact_cf = 'rev:cf2';
set global rocksdb_signal_drop_index_thread = 1; set global rocksdb_signal_drop_index_thread = 1;
......
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 'rev:cf2' not found");
set global rocksdb_compact_cf = 'cf1'; set global rocksdb_compact_cf = 'cf1';
set global rocksdb_compact_cf = 'rev:cf2'; set global rocksdb_compact_cf = 'rev:cf2';
set global rocksdb_signal_drop_index_thread = 1; set global rocksdb_signal_drop_index_thread = 1;
......
...@@ -178,16 +178,20 @@ id1 id2 id3 ...@@ -178,16 +178,20 @@ id1 id2 id3
9 17 9 9 17 9
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
set global rocksdb_large_prefix=1;
CREATE TABLE t1 (id1 varchar(128) CHARACTER SET latin1 COLLATE latin1_bin, CREATE TABLE t1 (id1 varchar(128) CHARACTER SET latin1 COLLATE latin1_bin,
id2 varchar(256) CHARACTER SET utf8 COLLATE utf8_bin, id2 varchar(256) CHARACTER SET utf8 COLLATE utf8_bin,
id3 varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci, id3 varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci,
PRIMARY KEY (id1, id2, id3), PRIMARY KEY (id1, id2, id3),
UNIQUE KEY (id3, id1)) ENGINE=ROCKSDB; UNIQUE KEY (id3, id1)) ENGINE=ROCKSDB;
set global rocksdb_large_prefix=DEFAULT;
set global rocksdb_large_prefix=1;
CREATE TABLE t2 (id1 varchar(128) CHARACTER SET latin1 COLLATE latin1_bin, CREATE TABLE t2 (id1 varchar(128) CHARACTER SET latin1 COLLATE latin1_bin,
id2 varchar(256) CHARACTER SET utf8 COLLATE utf8_bin, id2 varchar(256) CHARACTER SET utf8 COLLATE utf8_bin,
id3 varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci, id3 varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci,
PRIMARY KEY (id1, id2, id3), PRIMARY KEY (id1, id2, id3),
UNIQUE KEY (id3, id1) COMMENT 'rev:cf') ENGINE=ROCKSDB; UNIQUE KEY (id3, id1) COMMENT 'rev:cf') ENGINE=ROCKSDB;
set global rocksdb_large_prefix=DEFAULT;
INSERT INTO t1 VALUES (1, 1, 1) ON DUPLICATE KEY UPDATE id2 = 9; INSERT INTO t1 VALUES (1, 1, 1) ON DUPLICATE KEY UPDATE id2 = 9;
SELECT * FROM t1 WHERE id1 = 1; SELECT * FROM t1 WHERE id1 = 1;
id1 id2 id3 id1 id2 id3
......
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id INT,
fake_id INT,
bigfield VARCHAR(4096),
PRIMARY KEY (id),
KEY bf (bigfield(32)),
KEY fid (fake_id, bigfield(32))
) ENGINE=rocksdb;
INSERT INTO t1 VALUES (1, 1001, REPEAT('a', 1)),
(8, 1008, REPEAT('b', 8)),
(24, 1024, REPEAT('c', 24)),
(31, 1031, REPEAT('d', 31)),
(32, 1032, REPEAT('x', 32)),
(33, 1033, REPEAT('y', 33)),
(128, 1128, REPEAT('z', 128));
SELECT * FROM t1;
id fake_id bigfield
1 1001 a
8 1008 bbbbbbbb
24 1024 cccccccccccccccccccccccc
31 1031 ddddddddddddddddddddddddddddddd
32 1032 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
33 1033 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
128 1128 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
# Baseline sanity check
no-op query
no-op query
include/assert.inc [Baseline sanity check: 0 rocksdb_covered_secondary_key_lookups]
# Eligible for optimization.
id bigfield
31 ddddddddddddddddddddddddddddddd
include/assert.inc [Eligible for optimization.: 2 rocksdb_covered_secondary_key_lookups]
# Eligible for optimization, access via fake_id only
id bigfield
31 ddddddddddddddddddddddddddddddd
include/assert.inc [Eligible for optimization, access via fake_id only: 2 rocksdb_covered_secondary_key_lookups]
# Not eligible for optimization, access via fake_id of big row.
id bigfield
33 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
include/assert.inc [Not eligible for optimization, access via fake_id of big row.: 0 rocksdb_covered_secondary_key_lookups]
# Eligible for optimization.
id bigfield
32 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
include/assert.inc [Eligible for optimization.: 1 rocksdb_covered_secondary_key_lookups]
# Not eligible for optimization.
id bigfield
33 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
include/assert.inc [Not eligible for optimization.: 0 rocksdb_covered_secondary_key_lookups]
# Eligible for optimization.
id bigfield
8 bbbbbbbb
include/assert.inc [Eligible for optimization.: 2 rocksdb_covered_secondary_key_lookups]
# Eligible for optimization.
id bigfield
24 cccccccccccccccccccccccc
include/assert.inc [Eligible for optimization.: 2 rocksdb_covered_secondary_key_lookups]
# Not eligible for optimization.
id bigfield
128 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
include/assert.inc [Not eligible for optimization.: 0 rocksdb_covered_secondary_key_lookups]
#
# Test that multi-byte charsets are handled correctly
#
# Charset record obviously shorter than the prefix
a b
1 a
include/assert.inc [Charset record obviously shorter than the prefix: 2 rocksdb_covered_secondary_key_lookups]
# Charset record shorter than prefix
a b
2 cc
include/assert.inc [Charset record shorter than prefix: 2 rocksdb_covered_secondary_key_lookups]
# Charset record with glyphs shorter than prefix
a b
3 ŽŽ
include/assert.inc [Charset record with glyphs shorter than prefix: 1 rocksdb_covered_secondary_key_lookups]
# Charset record longer than prefix
a b
4 žžžž
include/assert.inc [Charset record longer than prefix: 0 rocksdb_covered_secondary_key_lookups]
...@@ -9,9 +9,9 @@ KEY (x)) ENGINE = ROCKSDB; ...@@ -9,9 +9,9 @@ KEY (x)) ENGINE = ROCKSDB;
SELECT TABLE_SCHEMA,TABLE_NAME,PARTITION_NAME,INDEX_NAME,INDEX_TYPE,KV_FORMAT_VERSION,CF FROM INFORMATION_SCHEMA.ROCKSDB_DDL WHERE TABLE_NAME like 'is_ddl_t%'; SELECT TABLE_SCHEMA,TABLE_NAME,PARTITION_NAME,INDEX_NAME,INDEX_TYPE,KV_FORMAT_VERSION,CF FROM INFORMATION_SCHEMA.ROCKSDB_DDL WHERE TABLE_NAME like 'is_ddl_t%';
TABLE_SCHEMA TABLE_NAME PARTITION_NAME INDEX_NAME INDEX_TYPE KV_FORMAT_VERSION CF TABLE_SCHEMA TABLE_NAME PARTITION_NAME INDEX_NAME INDEX_TYPE KV_FORMAT_VERSION CF
test is_ddl_t2 NULL PRIMARY 1 13 zy_cf test is_ddl_t2 NULL PRIMARY 1 13 zy_cf
test is_ddl_t2 NULL x 2 12 default test is_ddl_t2 NULL x 2 13 default
test is_ddl_t1 NULL PRIMARY 1 13 default test is_ddl_t1 NULL PRIMARY 1 13 default
test is_ddl_t1 NULL j 2 12 default test is_ddl_t1 NULL j 2 13 default
test is_ddl_t1 NULL k 2 12 kl_cf test is_ddl_t1 NULL k 2 13 kl_cf
DROP TABLE is_ddl_t1; DROP TABLE is_ddl_t1;
DROP TABLE is_ddl_t2; DROP TABLE is_ddl_t2;
...@@ -40,6 +40,33 @@ t1 0 PRIMARY 1 pk A # NULL NULL LSMTREE ...@@ -40,6 +40,33 @@ t1 0 PRIMARY 1 pk A # NULL NULL LSMTREE
t1 1 a 1 a A # NULL NULL YES LSMTREE simple index on a t1 1 a 1 a A # NULL NULL YES LSMTREE simple index on a
ALTER TABLE t1 DROP KEY a; ALTER TABLE t1 DROP KEY a;
DROP TABLE t1; DROP TABLE t1;
set global rocksdb_large_prefix=0;
CREATE TABLE t1 (
a BLOB(1024),
KEY (a(767))
) ENGINE=rocksdb;
DROP TABLE t1;
CREATE TABLE t1 (
a BLOB(1024),
KEY (a(768))
) ENGINE=rocksdb;
Warnings:
Warning 1071 Specified key was too long; max key length is 767 bytes
DROP TABLE t1;
set global rocksdb_large_prefix=1;
CREATE TABLE t1 (
a BLOB(4096),
KEY (a(3072))
) ENGINE=rocksdb;
DROP TABLE t1;
CREATE TABLE t1 (
a BLOB(4096),
KEY (a(3073))
) ENGINE=rocksdb;
Warnings:
Warning 1071 Specified key was too long; max key length is 3072 bytes
DROP TABLE t1;
set global rocksdb_large_prefix=DEFAULT;
# #
# Issue #376: MyRocks: ORDER BY optimizer is unable to use the index extension # Issue #376: MyRocks: ORDER BY optimizer is unable to use the index extension
# #
......
...@@ -46,3 +46,26 @@ SHOW KEYS IN t1; ...@@ -46,3 +46,26 @@ SHOW KEYS IN t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 b A # NULL NULL LSMTREE t1 0 PRIMARY 1 b A # NULL NULL LSMTREE
DROP TABLE t1; DROP TABLE t1;
set global rocksdb_large_prefix=0;
CREATE TABLE t1 (
a BLOB(1024),
PRIMARY KEY (a(767))
) ENGINE=rocksdb;
DROP TABLE t1;
CREATE TABLE t1 (
a BLOB(1024),
PRIMARY KEY (a(768))
) ENGINE=rocksdb;
ERROR 42000: Specified key was too long; max key length is 767 bytes
set global rocksdb_large_prefix=1;
CREATE TABLE t1 (
a BLOB(4096),
PRIMARY KEY (a(3072))
) ENGINE=rocksdb;
DROP TABLE t1;
CREATE TABLE t1 (
a BLOB(4096),
PRIMARY KEY (a(3073))
) ENGINE=rocksdb;
ERROR 42000: Specified key was too long; max key length is 3072 bytes
set global rocksdb_large_prefix=DEFAULT;
...@@ -40,3 +40,30 @@ t1 0 PRIMARY 1 pk A # NULL NULL LSMTREE ...@@ -40,3 +40,30 @@ t1 0 PRIMARY 1 pk A # NULL NULL LSMTREE
t1 1 a 1 a A # NULL NULL YES LSMTREE simple index on a t1 1 a 1 a A # NULL NULL YES LSMTREE simple index on a
ALTER TABLE t1 DROP KEY a; ALTER TABLE t1 DROP KEY a;
DROP TABLE t1; DROP TABLE t1;
set global rocksdb_large_prefix=0;
CREATE TABLE t1 (
a BLOB(1024),
KEY (a(767))
) ENGINE=rocksdb;
DROP TABLE t1;
CREATE TABLE t1 (
a BLOB(1024),
KEY (a(768))
) ENGINE=rocksdb;
Warnings:
Warning 1071 Specified key was too long; max key length is 767 bytes
DROP TABLE t1;
set global rocksdb_large_prefix=1;
CREATE TABLE t1 (
a BLOB(4096),
KEY (a(3072))
) ENGINE=rocksdb;
DROP TABLE t1;
CREATE TABLE t1 (
a BLOB(4096),
KEY (a(3073))
) ENGINE=rocksdb;
Warnings:
Warning 1071 Specified key was too long; max key length is 3072 bytes
DROP TABLE t1;
set global rocksdb_large_prefix=DEFAULT;
...@@ -40,3 +40,30 @@ t1 0 PRIMARY 1 pk A # NULL NULL LSMTREE ...@@ -40,3 +40,30 @@ t1 0 PRIMARY 1 pk A # NULL NULL LSMTREE
t1 1 a 1 a A # NULL NULL YES LSMTREE simple index on a t1 1 a 1 a A # NULL NULL YES LSMTREE simple index on a
ALTER TABLE t1 DROP KEY a; ALTER TABLE t1 DROP KEY a;
DROP TABLE t1; DROP TABLE t1;
set global rocksdb_large_prefix=0;
CREATE TABLE t1 (
a BLOB(1024),
KEY (a(767))
) ENGINE=rocksdb;
DROP TABLE t1;
CREATE TABLE t1 (
a BLOB(1024),
KEY (a(768))
) ENGINE=rocksdb;
Warnings:
Warning 1071 Specified key was too long; max key length is 767 bytes
DROP TABLE t1;
set global rocksdb_large_prefix=1;
CREATE TABLE t1 (
a BLOB(4096),
KEY (a(3072))
) ENGINE=rocksdb;
DROP TABLE t1;
CREATE TABLE t1 (
a BLOB(4096),
KEY (a(3073))
) ENGINE=rocksdb;
Warnings:
Warning 1071 Specified key was too long; max key length is 3072 bytes
DROP TABLE t1;
set global rocksdb_large_prefix=DEFAULT;
...@@ -17,7 +17,7 @@ id val1 val2 ...@@ -17,7 +17,7 @@ id val1 val2
2 2 2 2 2 2
SHOW ENGINE rocksdb TRANSACTION STATUS; SHOW ENGINE rocksdb TRANSACTION STATUS;
Type Name Status Type Name Status
SNAPSHOTS rocksdb rocksdb
============================================================ ============================================================
TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
============================================================ ============================================================
...@@ -25,6 +25,7 @@ TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT ...@@ -25,6 +25,7 @@ TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
SNAPSHOTS SNAPSHOTS
--------- ---------
LIST OF SNAPSHOTS FOR EACH SESSION: LIST OF SNAPSHOTS FOR EACH SESSION:
----------LATEST DETECTED DEADLOCKS----------
----------------------------------------- -----------------------------------------
END OF ROCKSDB TRANSACTION MONITOR OUTPUT END OF ROCKSDB TRANSACTION MONITOR OUTPUT
========================================= =========================================
...@@ -48,7 +49,7 @@ id val1 val2 ...@@ -48,7 +49,7 @@ id val1 val2
DELETE FROM t1 WHERE id=30; DELETE FROM t1 WHERE id=30;
SHOW ENGINE rocksdb TRANSACTION STATUS; SHOW ENGINE rocksdb TRANSACTION STATUS;
Type Name Status Type Name Status
SNAPSHOTS rocksdb rocksdb
============================================================ ============================================================
TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
============================================================ ============================================================
...@@ -61,6 +62,7 @@ MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION ...@@ -61,6 +62,7 @@ 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 8, 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----------
----------------------------------------- -----------------------------------------
END OF ROCKSDB TRANSACTION MONITOR OUTPUT END OF ROCKSDB TRANSACTION MONITOR OUTPUT
========================================= =========================================
...@@ -68,7 +70,7 @@ END OF ROCKSDB TRANSACTION MONITOR OUTPUT ...@@ -68,7 +70,7 @@ END OF ROCKSDB TRANSACTION MONITOR OUTPUT
ROLLBACK; ROLLBACK;
SHOW ENGINE rocksdb TRANSACTION STATUS; SHOW ENGINE rocksdb TRANSACTION STATUS;
Type Name Status Type Name Status
SNAPSHOTS rocksdb rocksdb
============================================================ ============================================================
TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
============================================================ ============================================================
...@@ -76,6 +78,7 @@ TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT ...@@ -76,6 +78,7 @@ TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
SNAPSHOTS SNAPSHOTS
--------- ---------
LIST OF SNAPSHOTS FOR EACH SESSION: LIST OF SNAPSHOTS FOR EACH SESSION:
----------LATEST DETECTED DEADLOCKS----------
----------------------------------------- -----------------------------------------
END OF ROCKSDB TRANSACTION MONITOR OUTPUT END OF ROCKSDB TRANSACTION MONITOR OUTPUT
========================================= =========================================
...@@ -84,7 +87,7 @@ START TRANSACTION; ...@@ -84,7 +87,7 @@ START TRANSACTION;
INSERT INTO t1 VALUES(40,40,40); INSERT INTO t1 VALUES(40,40,40);
SHOW ENGINE rocksdb TRANSACTION STATUS; SHOW ENGINE rocksdb TRANSACTION STATUS;
Type Name Status Type Name Status
SNAPSHOTS rocksdb rocksdb
============================================================ ============================================================
TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
============================================================ ============================================================
...@@ -97,6 +100,7 @@ MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION ...@@ -97,6 +100,7 @@ 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 2, 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----------
----------------------------------------- -----------------------------------------
END OF ROCKSDB TRANSACTION MONITOR OUTPUT END OF ROCKSDB TRANSACTION MONITOR OUTPUT
========================================= =========================================
...@@ -104,7 +108,7 @@ END OF ROCKSDB TRANSACTION MONITOR OUTPUT ...@@ -104,7 +108,7 @@ END OF ROCKSDB TRANSACTION MONITOR OUTPUT
COMMIT; COMMIT;
SHOW ENGINE rocksdb TRANSACTION STATUS; SHOW ENGINE rocksdb TRANSACTION STATUS;
Type Name Status Type Name Status
SNAPSHOTS rocksdb rocksdb
============================================================ ============================================================
TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
============================================================ ============================================================
...@@ -112,6 +116,7 @@ TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT ...@@ -112,6 +116,7 @@ TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
SNAPSHOTS SNAPSHOTS
--------- ---------
LIST OF SNAPSHOTS FOR EACH SESSION: LIST OF SNAPSHOTS FOR EACH SESSION:
----------LATEST DETECTED DEADLOCKS----------
----------------------------------------- -----------------------------------------
END OF ROCKSDB TRANSACTION MONITOR OUTPUT END OF ROCKSDB TRANSACTION MONITOR OUTPUT
========================================= =========================================
...@@ -133,7 +138,7 @@ UPDATE t2 SET value=3 WHERE id2=2; ...@@ -133,7 +138,7 @@ UPDATE t2 SET value=3 WHERE id2=2;
DELETE FROM t2 WHERE id1=10; DELETE FROM t2 WHERE id1=10;
SHOW ENGINE rocksdb TRANSACTION STATUS; SHOW ENGINE rocksdb TRANSACTION STATUS;
Type Name Status Type Name Status
SNAPSHOTS rocksdb rocksdb
============================================================ ============================================================
TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
============================================================ ============================================================
...@@ -146,6 +151,7 @@ MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION ...@@ -146,6 +151,7 @@ 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 9, write count 7 lock count 9, write count 7
insert count 2, update count 1, delete count 1 insert count 2, update count 1, delete count 1
----------LATEST DETECTED DEADLOCKS----------
----------------------------------------- -----------------------------------------
END OF ROCKSDB TRANSACTION MONITOR OUTPUT END OF ROCKSDB TRANSACTION MONITOR OUTPUT
========================================= =========================================
......
DROP TABLE IF EXISTS T1;
CREATE TABLE T1 (
P1 VARCHAR(64), P2 VARCHAR(64), P3 VARCHAR(64), P4 VARCHAR(64),
S1 VARCHAR(64), S2 VARCHAR(64), S3 VARCHAR(64), S4 VARCHAR(64),
S5 VARCHAR(64), S6 VARCHAR(64), S7 VARCHAR(64), S8 VARCHAR(64),
S9 VARCHAR(64), S10 VARCHAR(64), S11 VARCHAR(64), S12 VARCHAR(64),
S13 VARCHAR(64), S14 VARCHAR(64), S15 VARCHAR(64), S16 VARCHAR(64),
PRIMARY KEY (P1(8), P2(8), P3(8), P4(8)),
KEY SK (S1(8), S2(8), S3(8), S4(8),
S5(8), S6(8), S7(8), S8(8),
S9(8), S10(8), S11(8), S12(8),
S13(8), S14(8), S15(8), S16(8))
) ENGINE=rocksdb;
INSERT INTO T1 VALUES ('1', '2', '3', '4',
'5', '6', '7', '8',
'9', '10', '11', '12',
'13', '14', '15', '16',
'17', '18', '19', '20');
SELECT * FROM T1;
P1 P2 P3 P4 S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 S15 S16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# Not eligible for optimization, shorter than prefix length.
SELECT P4, S2 FROM T1 FORCE INDEX(SK) WHERE S1='5';
P4 S2
4 6
include/assert.inc [Not eligible for optimization, shorter than prefix length.: 0 rocksdb_covered_secondary_key_lookups]
DELETE FROM T1;
INSERT INTO T1 VALUES ('100000000', '200000000', '300000000', '400000000',
'500000000', '600000000', '700000000', '800000000',
'900000000', '100000000', '110000000', '120000000',
'130000000', '140000000', '150000000', '160000000',
'170000000', '180000000', '190000000', '200000000');
# Not eligible for optimization, longer than prefix length.
SELECT P4, S2 FROM T1 FORCE INDEX(SK) WHERE S1='5';
P4 S2
include/assert.inc [Not eligible for optimization, longer than prefix length.: 0 rocksdb_covered_secondary_key_lookups]
DROP TABLE T1;
...@@ -868,6 +868,7 @@ rocksdb_block_restart_interval 16 ...@@ -868,6 +868,7 @@ rocksdb_block_restart_interval 16
rocksdb_block_size 4096 rocksdb_block_size 4096
rocksdb_block_size_deviation 10 rocksdb_block_size_deviation 10
rocksdb_bulk_load OFF rocksdb_bulk_load OFF
rocksdb_bulk_load_allow_unsorted OFF
rocksdb_bulk_load_size 1000 rocksdb_bulk_load_size 1000
rocksdb_bytes_per_sync 0 rocksdb_bytes_per_sync 0
rocksdb_cache_index_and_filter_blocks ON rocksdb_cache_index_and_filter_blocks ON
...@@ -880,13 +881,16 @@ rocksdb_compaction_sequential_deletes 0 ...@@ -880,13 +881,16 @@ rocksdb_compaction_sequential_deletes 0
rocksdb_compaction_sequential_deletes_count_sd OFF rocksdb_compaction_sequential_deletes_count_sd OFF
rocksdb_compaction_sequential_deletes_file_size 0 rocksdb_compaction_sequential_deletes_file_size 0
rocksdb_compaction_sequential_deletes_window 0 rocksdb_compaction_sequential_deletes_window 0
rocksdb_concurrent_prepare ON
rocksdb_create_checkpoint rocksdb_create_checkpoint
rocksdb_create_if_missing ON rocksdb_create_if_missing ON
rocksdb_create_missing_column_families OFF rocksdb_create_missing_column_families OFF
rocksdb_datadir ./.rocksdb rocksdb_datadir ./.rocksdb
rocksdb_db_write_buffer_size 0 rocksdb_db_write_buffer_size 0
rocksdb_deadlock_detect OFF rocksdb_deadlock_detect OFF
rocksdb_deadlock_detect_depth 50
rocksdb_debug_optimizer_no_zero_cardinality ON rocksdb_debug_optimizer_no_zero_cardinality ON
rocksdb_debug_ttl_ignore_pk OFF
rocksdb_debug_ttl_read_filter_ts 0 rocksdb_debug_ttl_read_filter_ts 0
rocksdb_debug_ttl_rec_ts 0 rocksdb_debug_ttl_rec_ts 0
rocksdb_debug_ttl_snapshot_ts 0 rocksdb_debug_ttl_snapshot_ts 0
...@@ -903,6 +907,7 @@ rocksdb_error_if_exists OFF ...@@ -903,6 +907,7 @@ rocksdb_error_if_exists OFF
rocksdb_flush_log_at_trx_commit 1 rocksdb_flush_log_at_trx_commit 1
rocksdb_flush_memtable_on_analyze ON rocksdb_flush_memtable_on_analyze ON
rocksdb_force_compute_memtable_stats ON rocksdb_force_compute_memtable_stats ON
rocksdb_force_compute_memtable_stats_cachetime 0
rocksdb_force_flush_memtable_and_lzero_now OFF rocksdb_force_flush_memtable_and_lzero_now OFF
rocksdb_force_flush_memtable_now OFF rocksdb_force_flush_memtable_now OFF
rocksdb_force_index_records_in_range 0 rocksdb_force_index_records_in_range 0
...@@ -912,12 +917,15 @@ rocksdb_info_log_level error_level ...@@ -912,12 +917,15 @@ rocksdb_info_log_level error_level
rocksdb_io_write_timeout 0 rocksdb_io_write_timeout 0
rocksdb_is_fd_close_on_exec ON rocksdb_is_fd_close_on_exec ON
rocksdb_keep_log_file_num 1000 rocksdb_keep_log_file_num 1000
rocksdb_large_prefix OFF
rocksdb_lock_scanned_rows OFF rocksdb_lock_scanned_rows OFF
rocksdb_lock_wait_timeout 1 rocksdb_lock_wait_timeout 1
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_wal_flush ON
rocksdb_master_skip_tx_api OFF rocksdb_master_skip_tx_api OFF
rocksdb_max_background_jobs 2 rocksdb_max_background_jobs 2
rocksdb_max_latest_deadlocks 5
rocksdb_max_log_file_size 0 rocksdb_max_log_file_size 0
rocksdb_max_manifest_file_size 18446744073709551615 rocksdb_max_manifest_file_size 18446744073709551615
rocksdb_max_open_files -1 rocksdb_max_open_files -1
...@@ -926,6 +934,7 @@ rocksdb_max_subcompactions 1 ...@@ -926,6 +934,7 @@ rocksdb_max_subcompactions 1
rocksdb_max_total_wal_size 0 rocksdb_max_total_wal_size 0
rocksdb_merge_buf_size 67108864 rocksdb_merge_buf_size 67108864
rocksdb_merge_combine_read_size 1073741824 rocksdb_merge_combine_read_size 1073741824
rocksdb_merge_tmp_file_removal_delay_ms 0
rocksdb_new_table_reader_for_compaction_inputs OFF rocksdb_new_table_reader_for_compaction_inputs OFF
rocksdb_no_block_cache OFF rocksdb_no_block_cache OFF
rocksdb_override_cf_options rocksdb_override_cf_options
...@@ -942,6 +951,7 @@ rocksdb_records_in_range 50 ...@@ -942,6 +951,7 @@ rocksdb_records_in_range 50
rocksdb_reset_stats OFF rocksdb_reset_stats OFF
rocksdb_seconds_between_stat_computes 3600 rocksdb_seconds_between_stat_computes 3600
rocksdb_signal_drop_index_thread OFF rocksdb_signal_drop_index_thread OFF
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_unique_check_tables .* rocksdb_skip_unique_check_tables .*
...@@ -957,6 +967,7 @@ rocksdb_trace_sst_api OFF ...@@ -957,6 +967,7 @@ rocksdb_trace_sst_api OFF
rocksdb_unsafe_for_binlog OFF rocksdb_unsafe_for_binlog OFF
rocksdb_update_cf_options rocksdb_update_cf_options
rocksdb_use_adaptive_mutex OFF rocksdb_use_adaptive_mutex OFF
rocksdb_use_clock_cache OFF
rocksdb_use_direct_io_for_flush_and_compaction OFF rocksdb_use_direct_io_for_flush_and_compaction OFF
rocksdb_use_direct_reads OFF rocksdb_use_direct_reads OFF
rocksdb_use_fsync OFF rocksdb_use_fsync OFF
...@@ -1444,6 +1455,7 @@ rocksdb_memtable_total # ...@@ -1444,6 +1455,7 @@ rocksdb_memtable_total #
rocksdb_memtable_unflushed # rocksdb_memtable_unflushed #
rocksdb_queries_point # rocksdb_queries_point #
rocksdb_queries_range # rocksdb_queries_range #
rocksdb_covered_secondary_key_lookups #
rocksdb_block_cache_add # rocksdb_block_cache_add #
rocksdb_block_cache_data_hit # rocksdb_block_cache_data_hit #
rocksdb_block_cache_data_miss # rocksdb_block_cache_data_miss #
...@@ -1496,6 +1508,16 @@ rocksdb_number_superversion_cleanups # ...@@ -1496,6 +1508,16 @@ rocksdb_number_superversion_cleanups #
rocksdb_number_superversion_releases # rocksdb_number_superversion_releases #
rocksdb_rate_limit_delay_millis # rocksdb_rate_limit_delay_millis #
rocksdb_snapshot_conflict_errors # rocksdb_snapshot_conflict_errors #
rocksdb_stall_l0_file_count_limit_slowdowns #
rocksdb_stall_locked_l0_file_count_limit_slowdowns #
rocksdb_stall_l0_file_count_limit_stops #
rocksdb_stall_locked_l0_file_count_limit_stops #
rocksdb_stall_pending_compaction_limit_stops #
rocksdb_stall_pending_compaction_limit_slowdowns #
rocksdb_stall_memtable_limit_stops #
rocksdb_stall_memtable_limit_slowdowns #
rocksdb_stall_total_stops #
rocksdb_stall_total_slowdowns #
rocksdb_stall_micros # rocksdb_stall_micros #
rocksdb_wal_bytes # rocksdb_wal_bytes #
rocksdb_wal_group_syncs # rocksdb_wal_group_syncs #
...@@ -1520,6 +1542,7 @@ ROCKSDB_MEMTABLE_TOTAL ...@@ -1520,6 +1542,7 @@ ROCKSDB_MEMTABLE_TOTAL
ROCKSDB_MEMTABLE_UNFLUSHED ROCKSDB_MEMTABLE_UNFLUSHED
ROCKSDB_QUERIES_POINT ROCKSDB_QUERIES_POINT
ROCKSDB_QUERIES_RANGE ROCKSDB_QUERIES_RANGE
ROCKSDB_COVERED_SECONDARY_KEY_LOOKUPS
ROCKSDB_BLOCK_CACHE_ADD ROCKSDB_BLOCK_CACHE_ADD
ROCKSDB_BLOCK_CACHE_DATA_HIT ROCKSDB_BLOCK_CACHE_DATA_HIT
ROCKSDB_BLOCK_CACHE_DATA_MISS ROCKSDB_BLOCK_CACHE_DATA_MISS
...@@ -1572,6 +1595,16 @@ ROCKSDB_NUMBER_SUPERVERSION_CLEANUPS ...@@ -1572,6 +1595,16 @@ ROCKSDB_NUMBER_SUPERVERSION_CLEANUPS
ROCKSDB_NUMBER_SUPERVERSION_RELEASES ROCKSDB_NUMBER_SUPERVERSION_RELEASES
ROCKSDB_RATE_LIMIT_DELAY_MILLIS ROCKSDB_RATE_LIMIT_DELAY_MILLIS
ROCKSDB_SNAPSHOT_CONFLICT_ERRORS ROCKSDB_SNAPSHOT_CONFLICT_ERRORS
ROCKSDB_STALL_L0_FILE_COUNT_LIMIT_SLOWDOWNS
ROCKSDB_STALL_LOCKED_L0_FILE_COUNT_LIMIT_SLOWDOWNS
ROCKSDB_STALL_L0_FILE_COUNT_LIMIT_STOPS
ROCKSDB_STALL_LOCKED_L0_FILE_COUNT_LIMIT_STOPS
ROCKSDB_STALL_PENDING_COMPACTION_LIMIT_STOPS
ROCKSDB_STALL_PENDING_COMPACTION_LIMIT_SLOWDOWNS
ROCKSDB_STALL_MEMTABLE_LIMIT_STOPS
ROCKSDB_STALL_MEMTABLE_LIMIT_SLOWDOWNS
ROCKSDB_STALL_TOTAL_STOPS
ROCKSDB_STALL_TOTAL_SLOWDOWNS
ROCKSDB_STALL_MICROS ROCKSDB_STALL_MICROS
ROCKSDB_WAL_BYTES ROCKSDB_WAL_BYTES
ROCKSDB_WAL_GROUP_SYNCS ROCKSDB_WAL_GROUP_SYNCS
...@@ -1598,6 +1631,7 @@ ROCKSDB_MEMTABLE_TOTAL ...@@ -1598,6 +1631,7 @@ ROCKSDB_MEMTABLE_TOTAL
ROCKSDB_MEMTABLE_UNFLUSHED ROCKSDB_MEMTABLE_UNFLUSHED
ROCKSDB_QUERIES_POINT ROCKSDB_QUERIES_POINT
ROCKSDB_QUERIES_RANGE ROCKSDB_QUERIES_RANGE
ROCKSDB_COVERED_SECONDARY_KEY_LOOKUPS
ROCKSDB_BLOCK_CACHE_ADD ROCKSDB_BLOCK_CACHE_ADD
ROCKSDB_BLOCK_CACHE_DATA_HIT ROCKSDB_BLOCK_CACHE_DATA_HIT
ROCKSDB_BLOCK_CACHE_DATA_MISS ROCKSDB_BLOCK_CACHE_DATA_MISS
...@@ -1650,6 +1684,16 @@ ROCKSDB_NUMBER_SUPERVERSION_CLEANUPS ...@@ -1650,6 +1684,16 @@ ROCKSDB_NUMBER_SUPERVERSION_CLEANUPS
ROCKSDB_NUMBER_SUPERVERSION_RELEASES ROCKSDB_NUMBER_SUPERVERSION_RELEASES
ROCKSDB_RATE_LIMIT_DELAY_MILLIS ROCKSDB_RATE_LIMIT_DELAY_MILLIS
ROCKSDB_SNAPSHOT_CONFLICT_ERRORS ROCKSDB_SNAPSHOT_CONFLICT_ERRORS
ROCKSDB_STALL_L0_FILE_COUNT_LIMIT_SLOWDOWNS
ROCKSDB_STALL_LOCKED_L0_FILE_COUNT_LIMIT_SLOWDOWNS
ROCKSDB_STALL_L0_FILE_COUNT_LIMIT_STOPS
ROCKSDB_STALL_LOCKED_L0_FILE_COUNT_LIMIT_STOPS
ROCKSDB_STALL_PENDING_COMPACTION_LIMIT_STOPS
ROCKSDB_STALL_PENDING_COMPACTION_LIMIT_SLOWDOWNS
ROCKSDB_STALL_MEMTABLE_LIMIT_STOPS
ROCKSDB_STALL_MEMTABLE_LIMIT_SLOWDOWNS
ROCKSDB_STALL_TOTAL_STOPS
ROCKSDB_STALL_TOTAL_SLOWDOWNS
ROCKSDB_STALL_MICROS ROCKSDB_STALL_MICROS
ROCKSDB_WAL_BYTES ROCKSDB_WAL_BYTES
ROCKSDB_WAL_GROUP_SYNCS ROCKSDB_WAL_GROUP_SYNCS
...@@ -2149,7 +2193,9 @@ SET @old_mode = @@sql_mode; ...@@ -2149,7 +2193,9 @@ SET @old_mode = @@sql_mode;
SET sql_mode = 'strict_all_tables'; SET sql_mode = 'strict_all_tables';
create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(c, b(255))) engine=rocksdb; create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(c, b(255))) engine=rocksdb;
drop table t1; drop table t1;
set global rocksdb_large_prefix=1;
create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(1255))) engine=rocksdb; create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(1255))) engine=rocksdb;
set global rocksdb_large_prefix=0;
insert into t1 values (1, '1abcde', '1abcde'), (2, '2abcde', '2abcde'), (3, '3abcde', '3abcde'); insert into t1 values (1, '1abcde', '1abcde'), (2, '2abcde', '2abcde'), (3, '3abcde', '3abcde');
select * from t1; select * from t1;
a b c a b c
...@@ -2170,7 +2216,7 @@ a b c ...@@ -2170,7 +2216,7 @@ a b c
3 3abcde 3abcde 3 3abcde 3abcde
drop table t1; drop table t1;
create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(2255))) engine=rocksdb; create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(2255))) engine=rocksdb;
ERROR 42000: Specified key was too long; max key length is 2048 bytes ERROR 42000: Specified key was too long; max key length is 767 bytes
SET sql_mode = @old_mode; SET sql_mode = @old_mode;
drop table t0; drop table t0;
# #
......
...@@ -7,17 +7,8 @@ CREATE TABLE t2 (j INT, PRIMARY KEY (j) COMMENT 'rev:cf_t2') ENGINE = ROCKSDB; ...@@ -7,17 +7,8 @@ CREATE TABLE t2 (j INT, PRIMARY KEY (j) COMMENT 'rev:cf_t2') ENGINE = ROCKSDB;
CREATE TABLE t3 (k INT, PRIMARY KEY (k) COMMENT 'cf_t1') ENGINE = ROCKSDB; CREATE TABLE t3 (k INT, PRIMARY KEY (k) COMMENT 'cf_t1') ENGINE = ROCKSDB;
CREATE TABLE t4 (l INT, PRIMARY KEY (l) COMMENT 'cf_t4') ENGINE = ROCKSDB CREATE TABLE t4 (l INT, PRIMARY KEY (l) COMMENT 'cf_t4') ENGINE = ROCKSDB
PARTITION BY KEY(l) PARTITIONS 4; PARTITION BY KEY(l) PARTITIONS 4;
SET GLOBAL rocksdb_force_flush_memtable_now=1; SET @save.rocksdb_max_background_jobs= @@global.rocksdb_max_background_jobs;
SHOW ENGINE rocksdb STATUS; SET GLOBAL rocksdb_max_background_jobs= 1;
Type Name Status
STATISTICS # #
DBSTATS # #
CF_COMPACTION # #
CF_COMPACTION # #
CF_COMPACTION # #
CF_COMPACTION # #
MEMORY_STATS # #
BG_THREADS # #
INSERT INTO t1 VALUES (1), (2), (3); INSERT INTO t1 VALUES (1), (2), (3);
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
COUNT(*) COUNT(*)
...@@ -30,6 +21,19 @@ INSERT INTO t4 VALUES (1), (2), (3), (4), (5); ...@@ -30,6 +21,19 @@ INSERT INTO t4 VALUES (1), (2), (3), (4), (5);
SELECT COUNT(*) FROM t4; SELECT COUNT(*) FROM t4;
COUNT(*) COUNT(*)
5 5
SET GLOBAL rocksdb_force_flush_memtable_now=1;
SET GLOBAL rocksdb_compact_cf="cf_t1";
SHOW ENGINE rocksdb STATUS;
Type Name Status
STATISTICS # #
DBSTATS # #
CF_COMPACTION # #
CF_COMPACTION # #
CF_COMPACTION # #
CF_COMPACTION # #
MEMORY_STATS # #
BG_THREADS # #
BG_THREADS # #
SELECT * FROM INFORMATION_SCHEMA.ROCKSDB_CFSTATS; SELECT * FROM INFORMATION_SCHEMA.ROCKSDB_CFSTATS;
CF_NAME STAT_TYPE VALUE CF_NAME STAT_TYPE VALUE
__system__ NUM_IMMUTABLE_MEM_TABLE # __system__ NUM_IMMUTABLE_MEM_TABLE #
...@@ -356,7 +360,7 @@ Type Name Status ...@@ -356,7 +360,7 @@ Type Name Status
SHOW ENGINE ALL MUTEX; SHOW ENGINE ALL MUTEX;
SHOW ENGINE rocksdb TRANSACTION STATUS; SHOW ENGINE rocksdb TRANSACTION STATUS;
Type Name Status Type Name Status
SNAPSHOTS rocksdb rocksdb
============================================================ ============================================================
TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
============================================================ ============================================================
...@@ -364,6 +368,7 @@ TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT ...@@ -364,6 +368,7 @@ TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
SNAPSHOTS SNAPSHOTS
--------- ---------
LIST OF SNAPSHOTS FOR EACH SESSION: LIST OF SNAPSHOTS FOR EACH SESSION:
----------LATEST DETECTED DEADLOCKS----------
----------------------------------------- -----------------------------------------
END OF ROCKSDB TRANSACTION MONITOR OUTPUT END OF ROCKSDB TRANSACTION MONITOR OUTPUT
========================================= =========================================
...@@ -371,7 +376,7 @@ END OF ROCKSDB TRANSACTION MONITOR OUTPUT ...@@ -371,7 +376,7 @@ END OF ROCKSDB TRANSACTION MONITOR OUTPUT
START TRANSACTION WITH CONSISTENT SNAPSHOT; START TRANSACTION WITH CONSISTENT SNAPSHOT;
SHOW ENGINE rocksdb TRANSACTION STATUS; SHOW ENGINE rocksdb TRANSACTION STATUS;
Type Name Status Type Name Status
SNAPSHOTS rocksdb rocksdb
============================================================ ============================================================
TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT TIMESTAMP ROCKSDB TRANSACTION MONITOR OUTPUT
============================================================ ============================================================
...@@ -384,8 +389,10 @@ MySQL thread id TID, OS thread handle PTR, query id QID localhost root ACTION ...@@ -384,8 +389,10 @@ 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 0, write count 0 lock count 0, write count 0
insert count 0, update count 0, delete count 0 insert count 0, update count 0, delete count 0
----------LATEST DETECTED DEADLOCKS----------
----------------------------------------- -----------------------------------------
END OF ROCKSDB TRANSACTION MONITOR OUTPUT END OF ROCKSDB TRANSACTION MONITOR OUTPUT
========================================= =========================================
ROLLBACK; ROLLBACK;
SET GLOBAL rocksdb_max_background_jobs= @save.rocksdb_max_background_jobs;
CREATE TABLE t1 (pk int primary key) ENGINE=ROCKSDB;
set session debug="+d,gen_sql_table_name";
rename table t1 to t2;
set session debug= "-d,gen_sql_table_name";
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 'rev:cf2' not found");
set global rocksdb_compact_cf = 'cf1'; set global rocksdb_compact_cf = 'cf1';
set global rocksdb_compact_cf = 'rev:cf2'; set global rocksdb_compact_cf = 'rev:cf2';
set global rocksdb_signal_drop_index_thread = 1; set global rocksdb_signal_drop_index_thread = 1;
......
...@@ -337,9 +337,7 @@ b INT ...@@ -337,9 +337,7 @@ b INT
) ENGINE=rocksdb ) ENGINE=rocksdb
COMMENT='ttl_duration=100;'; COMMENT='ttl_duration=100;';
ALTER TABLE t1 DROP PRIMARY KEY; ALTER TABLE t1 DROP PRIMARY KEY;
ERROR HY000: TTL support is currently disabled when table has secondary indexes or hidden PK. ERROR HY000: TTL support is currently disabled when table has a hidden PK.
ALTER TABLE t1 ADD INDEX kb(b), ALGORITHM=INPLACE;
ERROR HY000: TTL support is currently disabled when table has secondary indexes or hidden PK.
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
a INT PRIMARY KEY, a INT PRIMARY KEY,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--rocksdb_max_subcompactions=1 --rocksdb_max_subcompactions=1
--rocksdb_info_log_level=info_level
--rocksdb_default_cf_options=write_buffer_size=512k;target_file_size_base=512k;level0_file_num_compaction_trigger=2;level0_slowdown_writes_trigger=-1;level0_stop_writes_trigger=1000;max_bytes_for_level_base=1m --rocksdb_default_cf_options=write_buffer_size=512k;target_file_size_base=512k;level0_file_num_compaction_trigger=2;level0_slowdown_writes_trigger=-1;level0_stop_writes_trigger=1000;max_bytes_for_level_base=1m
This diff is collapsed.
This diff is collapsed.
--rocksdb_default_cf_options=disable_auto_compactions=true
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment