rocksdb.show_table_status: 1051: Unknown table 'db_new'
Description
Environment
Smart Checklist
Activity

George Lorch November 21, 2018 at 7:44 PMEdited

George Lorch November 21, 2018 at 6:15 PM
There is another issue, running this same test on TokuDB leads to a failure to create the table:
mysql> CREATE DATABASE `db_new..............................................end`;
Query OK, 1 row affected (0.00 sec)mysql> USE `db_new..............................................end`;
Database changed
mysql> CREATE TABLE `t1_new..............................................end`(a int) engine=TOKUDB;
ERROR 1030 (HY000): Got error 36 from storage engine
This failure to create is really not a bug in true sense, more would be like a feature request. Due to the expansion from system charset to fscs, the resulting PerconaFT index file name becomes longer than the allowed file system name. Using this example above, the resulting file name for the status dictionary/index file for this table would be
<mysqldatadir>/./db_new@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend/t1_new_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002e_002eend_status_d9_1_1d.tokudb
So it is plausible for a feature request to do something like 'squash' the filename into some obtuse name for these that would exceed the filesystem limit. That is far outside the scope of this issue though.

George Lorch November 21, 2018 at 5:52 PM
This is not a simple test failure, it is a regression introduced as a part of the native partitioning implementation.
The handler::delete_table method takes in database.table name in the expanded/converted format of the file system character set or fscs. The character set has file system characters expanded into '@xxxx' format so a '.' in a database or table name is represented as a '@002e' in expanded name.
The delete_table method needs to determine if the table is partitioned or not. It does this through the helper function native_part::get_part_str_for_table in sql/partitioning/partition_base.cc by parsing, then building the filename of the .frm file so that it can open and read partition info.
This parsing makes use of the function build_table_filename in sql/sql_table.cc. The build_table_filename function expects that the given database and table names are in system charset and again, converts these into the fscs, therefore double encoding the database and table name into something that does not exist.
This results in delete_table returning ERR_TABLE_CORRUPT to the server which then complains that it can't DROP the database because it can't properly remove all of the tables within.
Details
Assignee
George LorchGeorge Lorch(Deactivated)Reporter
WhissiWhissiTime tracking
6h 15m loggedComponents
Fix versions
Priority
High
Details
Details
Assignee

Reporter

Time tracking
Components
Fix versions
Priority
Smart Checklist
Open Smart Checklist
Smart Checklist
Open Smart Checklist
Smart Checklist

$ ./mtr --force rocksdb.show_table_status Logging: /var/tmp/portage/dev-db/percona-server-5.7.23.24/work/mysql/mysql-test/mysql-test-run.pl --force rocksdb.show_table_status MySQL Version 5.7.23 Too long tmpdir path '/var/tmp/portage/dev-db/percona-server-5.7.23.24/work/percona-server-5.7.23.24_build/mysql-test/var/tmp' creating a shorter one... - using tmpdir: '/tmp/uv7kO4sy0J' Checking supported features... - SSL connections supported Collecting tests... - adding combinations for rocksdb Checking leftover processes... Removing old var directory... Creating var directory '/var/tmp/portage/dev-db/percona-server-5.7.23.24/work/percona-server-5.7.23.24_build/mysql-test/var'... Installing system database... Using parallel: 1 ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 rocksdb.show_table_status 'write_prepared' [ fail ] Test ended at 2018-11-16 17:40:25 CURRENT_TEST: rocksdb.show_table_status mysqltest: At line 61: query 'DROP DATABASE `db_new..............................................end`' failed: 1051: Unknown table 'db_new..............................................end.t1_new......................................' The result from queries just before the failure was: CREATE TABLE t1 (a INT, b CHAR(8) PRIMARY KEY) ENGINE=ROCKSDB; INSERT INTO t1 (a,b) VALUES (100,'a'),(2,'foo'); CREATE TABLE t2 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=ROCKSDB; INSERT INTO t2 (a,b) VALUES (1,'bar'); set global rocksdb_force_flush_memtable_now = true; CREATE TABLE t3 (a INT, b CHAR(8), pk INT PRIMARY KEY) ENGINE=ROCKSDB CHARACTER SET utf8; SHOW TABLE STATUS WHERE name IN ( 't1', 't2', 't3' ); 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 2 # # 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL t2 ROCKSDB 10 Fixed 1 # # 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL t3 ROCKSDB 10 Fixed 1000 # # 0 0 0 NULL NULL NULL NULL utf8_general_ci NULL SHOW TABLE STATUS WHERE name LIKE 't2'; 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 t2 ROCKSDB 10 Fixed 10000 # # 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL DROP TABLE t1, t2, t3; CREATE DATABASE `db_new..............................................end`; USE `db_new..............................................end`; CREATE TABLE `t1_new..............................................end`(a int) engine=ROCKSDB; INSERT INTO `t1_new..............................................end` VALUES (1); SELECT MAX(a) FROM `t1_new..............................................end`; MAX(a) 1 SELECT TABLE_SCHEMA, TABLE_NAME FROM information_schema.table_statistics WHERE TABLE_NAME = 't1_new..............................................end'; safe_process[26529]: Child process: 26530, exit: 1 Server [mysqld.1 - pid: 26495, winpid: 26495] log: Server log from this test: ----------SERVER LOG START----------- 2018-11-16T16:40:19.088989Z 0 [Warning] Insecure configuration for --secure-file-priv: Data directory is accessible through --secure-file-priv. Consider choosing a different directory. 2018-11-16T16:40:19.089048Z 0 [Warning] Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory. 2018-11-16T16:40:19.089069Z 0 [Note] /var/tmp/portage/dev-db/percona-server-5.7.23.24/work/percona-server-5.7.23.24_build/sql/mysqld (mysqld 5.7.23-24-log) starting as process 26496 ... 2018-11-16T16:40:19.091371Z 0 [Note] InnoDB: PUNCH HOLE support available 2018-11-16T16:40:19.091389Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2018-11-16T16:40:19.091395Z 0 [Note] InnoDB: Uses event mutexes 2018-11-16T16:40:19.091400Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 2018-11-16T16:40:19.091405Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2018-11-16T16:40:19.091410Z 0 [Note] InnoDB: Using Linux native AIO 2018-11-16T16:40:19.091620Z 0 [Note] InnoDB: Number of pools: 1 2018-11-16T16:40:19.091715Z 0 [Note] InnoDB: Using CPU crc32 instructions 2018-11-16T16:40:19.093100Z 0 [Note] InnoDB: Initializing buffer pool, total size = 24M, instances = 1, chunk size = 24M 2018-11-16T16:40:19.094017Z 0 [Note] InnoDB: Completed initialization of buffer pool 2018-11-16T16:40:19.094860Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2018-11-16T16:40:19.107805Z 0 [Note] InnoDB: Crash recovery did not find the parallel doublewrite buffer at /var/tmp/portage/dev-db/percona-server-5.7.23.24/work/percona-server-5.7.23.24_build/mysql-test/var/mysqld.1/data/xb_doublewrite 2018-11-16T16:40:19.108358Z 0 [Note] InnoDB: Highest supported file format is Barracuda. 2018-11-16T16:40:19.122636Z 0 [Note] InnoDB: Created parallel doublewrite buffer at /var/tmp/portage/dev-db/percona-server-5.7.23.24/work/percona-server-5.7.23.24_build/mysql-test/var/mysqld.1/data/xb_doublewrite, size 3932160 bytes 2018-11-16T16:40:19.126543Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2018-11-16T16:40:19.126594Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2018-11-16T16:40:19.158525Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. 2018-11-16T16:40:19.159282Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. 2018-11-16T16:40:19.159294Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. 2018-11-16T16:40:19.160255Z 0 [Note] InnoDB: Waiting for purge to start 2018-11-16T16:40:19.211530Z 0 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.7.23-24 started; log sequence number 1355541 2018-11-16T16:40:19.212069Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/tmp/portage/dev-db/percona-server-5.7.23.24/work/percona-server-5.7.23.24_build/mysql-test/var/mysqld.1/data/ib_buffer_pool 2018-11-16T16:40:19.212505Z 0 [Note] Plugin 'FEDERATED' is disabled. 2018-11-16T16:40:19.216039Z 0 [Note] InnoDB: Buffer pool(s) load completed at 181116 19:40:19 2018-11-16T16:40:19.238384Z 0 [Note] RocksDB: Got ENOENT when listing column families 2018-11-16T16:40:19.238417Z 0 [Note] RocksDB: assuming that we're creating a new database 2018-11-16T16:40:19.238611Z 0 [Note] RocksDB: Column Families at start: 2018-11-16T16:40:19.238657Z 0 [Note] cf=default 2018-11-16T16:40:19.238670Z 0 [Note] write_buffer_size=67108864 2018-11-16T16:40:19.238678Z 0 [Note] target_file_size_base=67108864 2018-11-16T16:40:19.292779Z 0 [Note] RocksDB: creating a column family __system__ 2018-11-16T16:40:19.292814Z 0 [Note] write_buffer_size=67108864 2018-11-16T16:40:19.292818Z 0 [Note] target_file_size_base=67108864 2018-11-16T16:40:19.319896Z 0 [Note] RocksDB: Table_store: loaded DDL data for 0 tables 2018-11-16T16:40:19.323933Z 0 [Note] RocksDB instance opened 2018-11-16T16:40:19.324076Z 0 [Warning] unknown variable 'loose-mysqlx-port=13009' 2018-11-16T16:40:19.324089Z 0 [Warning] unknown variable 'loose-mysqlx-socket=/tmp/uv7kO4sy0J/mysqlx.1.sock' 2018-11-16T16:40:19.324094Z 0 [Warning] unknown variable 'loose-debug-sync-timeout=600' 2018-11-16T16:40:19.325613Z 0 [Note] Salting uuid generator variables, current_pid: 26496, server_start_time: 1542386419, bytes_sent: 0, 2018-11-16T16:40:19.325663Z 0 [Note] Generated uuid: '4dcecca6-e9be-11e8-989d-000c29545adf', server_start_time: 7457960984467954291, bytes_sent: 93886809187216 2018-11-16T16:40:19.325678Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 4dcecca6-e9be-11e8-989d-000c29545adf. 2018-11-16T16:40:19.327776Z 0 [Note] Skipping generation of SSL certificates as options related to SSL are specified. 2018-11-16T16:40:19.328362Z 0 [Warning] CA certificate /var/tmp/portage/dev-db/percona-server-5.7.23.24/work/mysql/mysql-test/std_data/cacert.pem is self signed. 2018-11-16T16:40:19.328392Z 0 [Note] Skipping generation of RSA key pair as --sha256_password_auto_generate_rsa_keys is set to OFF. 2018-11-16T16:40:19.328408Z 0 [Note] RSA private key file not found: /var/tmp/portage/dev-db/percona-server-5.7.23.24/work/percona-server-5.7.23.24_build/mysql-test/var/mysqld.1/data//private_key.pem. Some authentication plugins will not work. 2018-11-16T16:40:19.328418Z 0 [Note] RSA public key file not found: /var/tmp/portage/dev-db/percona-server-5.7.23.24/work/percona-server-5.7.23.24_build/mysql-test/var/mysqld.1/data//public_key.pem. Some authentication plugins will not work. 2018-11-16T16:40:19.328425Z 0 [Note] Server hostname (bind-address): '*'; port: 13001 2018-11-16T16:40:19.328447Z 0 [Note] IPv6 is available. 2018-11-16T16:40:19.328455Z 0 [Note] - '::' resolves to '::'; 2018-11-16T16:40:19.328500Z 0 [Note] Server socket created on IP: '::'. 2018-11-16T16:40:19.329492Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/tmp' in the path is accessible to all OS users. Consider choosing a different directory. 2018-11-16T16:40:19.339173Z 0 [Note] Event Scheduler: Loaded 0 events 2018-11-16T16:40:19.339620Z 0 [Note] /var/tmp/portage/dev-db/percona-server-5.7.23.24/work/percona-server-5.7.23.24_build/sql/mysqld: ready for connections. Version: '5.7.23-24-log' socket: '/tmp/uv7kO4sy0J/mysqld.1.sock' port: 13001 Gentoo Linux percona-server-5.7.23.24 2018-11-16T16:40:19.439266Z 3 [Note] RocksDB: Manual memtable flush. 2018-11-16T16:40:25.523206Z 3 [Note] RocksDB: Manual memtable flush. 2018-11-16T16:40:25.546709Z 3 [Note] RocksDB: Manual memtable flush. ----------SERVER LOG END-------------