Skip to content

Commit

Permalink
Remove rocksdb-large-prefix sysvar (facebook#1397)
Browse files Browse the repository at this point in the history
Summary:
It was deprecated in 8.0.28.

Pull Request resolved: facebook#1397

Differential Revision: D51635623

fbshipit-source-id: 302a39f

-------------------------------------------------------------------------------

Set rocksdb_large_prefix to ON and deprecate this system variable (facebook#1322)

Summary:
This variable was introduced to mirror innodb_large_prefix, which was deprecated in 5.7 and removed in 8.0, and no longer serves any real purpose, nor there is anything to gain with its 'OFF' setting, which is also incompatible with the data dictionary schema. Thus 1) change the default to 'ON'; 2) deprecate it.

Pull Request resolved: facebook#1322

Differential Revision: D46773511
  • Loading branch information
laurynas-biveinis authored and inikep committed Jul 16, 2024
1 parent af4bf7d commit 3cee328
Show file tree
Hide file tree
Showing 19 changed files with 24 additions and 241 deletions.
4 changes: 0 additions & 4 deletions mysql-test/r/mysqld--help-notwin.result
Original file line number Diff line number Diff line change
Expand Up @@ -2144,9 +2144,6 @@ The following options may be given as the first argument:
(Defaults to on; use --skip-rocksdb-is-fd-close-on-exec to disable.)
--rocksdb-keep-log-file-num=#
DBOptions::keep_log_file_num for RocksDB
--rocksdb-large-prefix
Support large index prefix length of 3072 bytes. If off,
the maximum index prefix length is 767.
--rocksdb-live-files-metadata[=name]
Enable or disable ROCKSDB_LIVE_FILES_METADATA plugin.
Possible values are ON, OFF, FORCE (don't start if the
Expand Down Expand Up @@ -3661,7 +3658,6 @@ rocksdb-info-log-level error_level
rocksdb-io-write-timeout 0
rocksdb-is-fd-close-on-exec TRUE
rocksdb-keep-log-file-num 1000
rocksdb-large-prefix FALSE
rocksdb-live-files-metadata ON
rocksdb-lock-scanned-rows FALSE
rocksdb-lock-wait-timeout 1
Expand Down
6 changes: 0 additions & 6 deletions mysql-test/suite/rocksdb/r/dup_key_update.result
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (id1 INT, id2 INT, id3 INT,
PRIMARY KEY (id1, id2, id3),
UNIQUE KEY (id3, id1)) ENGINE=ROCKSDB;
Expand Down Expand Up @@ -178,7 +176,6 @@ id1 id2 id3
9 17 9
DROP TABLE t1;
DROP TABLE t2;
set global rocksdb_large_prefix=1;
CREATE TABLE t1 (id1 varchar(128) CHARACTER SET latin1 COLLATE latin1_bin,
id2 varchar(256) CHARACTER SET utf8 COLLATE utf8_bin,
id3 varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci,
Expand All @@ -187,8 +184,6 @@ UNIQUE KEY (id3, id1)) ENGINE=ROCKSDB;
Warnings:
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
Warning 3778 'utf8mb3_bin' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
set global rocksdb_large_prefix=DEFAULT;
set global rocksdb_large_prefix=1;
CREATE TABLE t2 (id1 varchar(128) CHARACTER SET latin1 COLLATE latin1_bin,
id2 varchar(256) CHARACTER SET utf8 COLLATE utf8_bin,
id3 varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci,
Expand All @@ -197,7 +192,6 @@ UNIQUE KEY (id3, id1) COMMENT 'rev:cf') ENGINE=ROCKSDB;
Warnings:
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
Warning 3778 'utf8mb3_bin' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
set global rocksdb_large_prefix=DEFAULT;
INSERT INTO t1 VALUES (1, 1, 1) ON DUPLICATE KEY UPDATE id2 = 9;
SELECT * FROM t1 WHERE id1 = 1;
id1 id2 id3
Expand Down
4 changes: 4 additions & 0 deletions mysql-test/suite/rocksdb/r/early_load_rocksdb_plugin.result
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#
# Restarting the server
# restart
#
# Error log checks
#
include/assert_grep.inc [Check RocksDB:Init column families]
include/assert_grep.inc [Check Data dictionary initializing]
include/assert_grep.inc [disabling rocksdb_large_prefix is not allowed with MySQL data dictionary in MyRocks]
# Remove data dir and log file.
15 changes: 0 additions & 15 deletions mysql-test/suite/rocksdb/r/index.result
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,6 @@ t1 0 PRIMARY 1 pk A # NULL NULL SE_SPECIFIC YES NULL
t1 1 a 1 a A # NULL NULL YES SE_SPECIFIC simple index on a YES NULL
ALTER TABLE t1 DROP KEY a;
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))
Expand All @@ -66,7 +52,6 @@ KEY (a(3073))
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
#
Expand Down
13 changes: 0 additions & 13 deletions mysql-test/suite/rocksdb/r/index_primary.result
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,6 @@ 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 Visible Expression
t1 0 PRIMARY 1 b A # NULL NULL SE_SPECIFIC YES NULL
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))
Expand All @@ -68,4 +56,3 @@ 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;
15 changes: 0 additions & 15 deletions mysql-test/suite/rocksdb/r/index_type_btree.result
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,6 @@ t1 0 PRIMARY 1 pk A # NULL NULL SE_SPECIFIC YES NULL
t1 1 a 1 a A # NULL NULL YES SE_SPECIFIC simple index on a YES NULL
ALTER TABLE t1 DROP KEY a;
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))
Expand All @@ -75,4 +61,3 @@ KEY (a(3073))
Warnings:
Warning 1071 Specified key was too long; max key length is 3072 bytes
DROP TABLE t1;
set global rocksdb_large_prefix=DEFAULT;
15 changes: 0 additions & 15 deletions mysql-test/suite/rocksdb/r/index_type_hash.result
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,6 @@ t1 0 PRIMARY 1 pk A # NULL NULL SE_SPECIFIC YES NULL
t1 1 a 1 a A # NULL NULL YES SE_SPECIFIC simple index on a YES NULL
ALTER TABLE t1 DROP KEY a;
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))
Expand All @@ -75,4 +61,3 @@ KEY (a(3073))
Warnings:
Warning 1071 Specified key was too long; max key length is 3072 bytes
DROP TABLE t1;
set global rocksdb_large_prefix=DEFAULT;
12 changes: 1 addition & 11 deletions mysql-test/suite/rocksdb/r/rocksdb.result
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,6 @@ rocksdb_index_type kBinarySearch
rocksdb_info_log_level error_level
rocksdb_is_fd_close_on_exec ON
rocksdb_keep_log_file_num 1000
rocksdb_large_prefix OFF
rocksdb_lock_scanned_rows OFF
rocksdb_lock_wait_timeout 1
rocksdb_log_file_time_to_roll 0
Expand Down Expand Up @@ -2512,16 +2511,10 @@ id
select * from t1 where id=9 for update;
id
drop table t1;
#Index on blob column
SET @old_mode = @@sql_mode;
SET sql_mode = 'strict_all_tables';
Warnings:
Warning 3135 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
# Index on blob column
create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(c, b(255))) ENGINE=rocksdb CHARSET=latin1;
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 CHARSET=latin1;
set global rocksdb_large_prefix=0;
insert into t1 values (1, '1abcde', '1abcde'), (2, '2abcde', '2abcde'), (3, '3abcde', '3abcde');
select * from t1;
a b c
Expand All @@ -2545,9 +2538,6 @@ a b c
2 12345 2abcde
3 3abcde 3abcde
drop table t1;
create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(2255))) ENGINE=rocksdb CHARSET=latin1;
ERROR 42000: Specified key was too long; max key length is 767 bytes
SET sql_mode = @old_mode;
drop table t0;
#
# Fix assertion failure (attempt to overrun the key buffer) for prefix indexes
Expand Down
10 changes: 0 additions & 10 deletions mysql-test/suite/rocksdb/t/dup_key_update.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

# Test insert ... on duplicate key update statements

--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings

CREATE TABLE t1 (id1 INT, id2 INT, id3 INT,
PRIMARY KEY (id1, id2, id3),
UNIQUE KEY (id3, id1)) ENGINE=ROCKSDB;
Expand All @@ -15,28 +10,23 @@ CREATE TABLE t2 (id1 INT, id2 INT, id3 INT,
PRIMARY KEY (id1, id2, id3),
UNIQUE KEY (id3, id1) COMMENT 'rev:cf') ENGINE=ROCKSDB;


--source suite/rocksdb/include/dup_key_update.inc

# Cleanup
DROP TABLE t1;
DROP TABLE t2;

set global rocksdb_large_prefix=1;
CREATE TABLE t1 (id1 varchar(128) CHARACTER SET latin1 COLLATE latin1_bin,
id2 varchar(256) CHARACTER SET utf8 COLLATE utf8_bin,
id3 varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci,
PRIMARY KEY (id1, id2, id3),
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,
id2 varchar(256) CHARACTER SET utf8 COLLATE utf8_bin,
id3 varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci,
PRIMARY KEY (id1, id2, id3),
UNIQUE KEY (id3, id1) COMMENT 'rev:cf') ENGINE=ROCKSDB;
set global rocksdb_large_prefix=DEFAULT;

--source suite/rocksdb/include/dup_key_update.inc

Expand Down
7 changes: 7 additions & 0 deletions mysql-test/suite/rocksdb/t/early_load_rocksdb_plugin.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ let extra_args=--no-defaults --basedir=$BASEDIR --debug=+d,ddse_rocksdb;
--echo # Try --initialize
--echo #


--echo # Run the server with --initialize
--exec $MYSQLD $extra_args --initialize --default_dd_storage_engine=RocksDB --datadir=$DDIR --log-error-verbosity=3 > $MYSQLD_LOG 2>&1

Expand All @@ -29,6 +30,9 @@ let extra_args=--no-defaults --basedir=$BASEDIR --debug=+d,ddse_rocksdb;
--echo # Restarting the server
--source include/start_mysqld.inc

--echo #
--echo # Error log checks
--echo #
--let $assert_file = $MYSQLD_LOG
--let $assert_count = 1

Expand All @@ -41,5 +45,8 @@ let extra_args=--no-defaults --basedir=$BASEDIR --debug=+d,ddse_rocksdb;
--let $assert_only_after = Check RocksDB:Init column families
--source include/assert_grep.inc

--let $assert_text=disabling rocksdb_large_prefix is not allowed with MySQL data dictionary in MyRocks
--source include/assert_grep.inc

--echo # Remove data dir and log file.
--remove_file $MYSQLD_LOG
22 changes: 0 additions & 22 deletions mysql-test/suite/rocksdb/t/index.inc
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,6 @@ DROP TABLE t1;

--enable_testcase

#
# Test index prefix length limits.
#
set global rocksdb_large_prefix=0;

CREATE TABLE t1 (
a BLOB(1024),
KEY (a(767))
) ENGINE=rocksdb;
DROP TABLE t1;

# Should display warning
CREATE TABLE t1 (
a BLOB(1024),
KEY (a(768))
) ENGINE=rocksdb;
DROP TABLE t1;

set global rocksdb_large_prefix=1;

CREATE TABLE t1 (
a BLOB(4096),
KEY (a(3072))
Expand All @@ -151,5 +131,3 @@ CREATE TABLE t1 (
KEY (a(3073))
) ENGINE=rocksdb;
DROP TABLE t1;

set global rocksdb_large_prefix=DEFAULT;
21 changes: 0 additions & 21 deletions mysql-test/suite/rocksdb/t/index_primary.test
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,6 @@ ALTER TABLE t1 ADD CONSTRAINT PRIMARY KEY pk (a);
SHOW KEYS IN t1;
DROP TABLE t1;

#
# Test index prefix length limits.
#
set global rocksdb_large_prefix=0;

CREATE TABLE t1 (
a BLOB(1024),
PRIMARY KEY (a(767))
) ENGINE=rocksdb;
DROP TABLE t1;

--error ER_TOO_LONG_KEY
CREATE TABLE t1 (
a BLOB(1024),
PRIMARY KEY (a(768))
) ENGINE=rocksdb;

set global rocksdb_large_prefix=1;

CREATE TABLE t1 (
a BLOB(4096),
PRIMARY KEY (a(3072))
Expand All @@ -92,5 +73,3 @@ CREATE TABLE t1 (
a BLOB(4096),
PRIMARY KEY (a(3073))
) ENGINE=rocksdb;

set global rocksdb_large_prefix=DEFAULT;
9 changes: 1 addition & 8 deletions mysql-test/suite/rocksdb/t/rocksdb.test
Original file line number Diff line number Diff line change
Expand Up @@ -1669,14 +1669,10 @@ select * from t1 where id=9 for update;
-- disconnect con1
drop table t1;

--echo #Index on blob column
SET @old_mode = @@sql_mode;
SET sql_mode = 'strict_all_tables';
--echo # Index on blob column
create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(c, b(255))) ENGINE=rocksdb CHARSET=latin1;
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 CHARSET=latin1;
set global rocksdb_large_prefix=0;
insert into t1 values (1, '1abcde', '1abcde'), (2, '2abcde', '2abcde'), (3, '3abcde', '3abcde');
select * from t1;
--replace_column 10 # 11 #
Expand All @@ -1686,9 +1682,6 @@ explain select b, a from t1 where b like '1%';
update t1 set b= '12345' where b = '2abcde';
select * from t1;
drop table t1;
--error ER_TOO_LONG_KEY
create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(2255))) ENGINE=rocksdb CHARSET=latin1;
SET sql_mode = @old_mode;

drop table t0;

Expand Down
Loading

0 comments on commit 3cee328

Please sign in to comment.