TokuDB does not allow to re-create table after one of partitions lost
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Won't Fix
|
Undecided
|
Unassigned | ||
5.5 |
Invalid
|
Undecided
|
Unassigned | ||
5.6 |
Won't Fix
|
Undecided
|
Unassigned | ||
5.7 |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
After some disaster one of partitions in a table was lost. Other tables were not affected. Restoring full database from backup is not an option due to size. Server crashed during start, so we deleted partition. After that server successfully stopped, but table could not be dropped. Then we dropped database which contained the table, re-created it. After that all tries to re-create the table failed with error 17.
How to repeat:
1. cd into mysql-test directory
2. LD_PRELOAD=
3. sudo ../bin/
4. cat > small_tab.sql
CREATE TABLE `t1` (
`uid` bigint(20) unsigned NOT NULL,
`tstamp` int(10) unsigned NOT NULL,
`value` decimal(15,2) NOT NULL,
PRIMARY KEY (`uid`,`tstamp`),
KEY `tstamp` (`tstamp`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
PARTITION BY RANGE (tstamp)
(PARTITION p1421712000 VALUES LESS THAN (1421712000) ENGINE = TokuDB,
PARTITION p1421798400 VALUES LESS THAN (1421798400) ENGINE = TokuDB,
PARTITION p1421884800 VALUES LESS THAN (1421884800) ENGINE = TokuDB,
PARTITION p1487030400 VALUES LESS THAN (1487030400) ENGINE = TokuDB,
PARTITION p1487116800 VALUES LESS THAN (1487116800) ENGINE = TokuDB,
PARTITION p1487203200 VALUES LESS THAN (1487203200) ENGINE = TokuDB,
PARTITION p1487289600 VALUES LESS THAN (1487289600) ENGINE = TokuDB,
PARTITION pMAX VALUES LESS THAN MAXVALUE ENGINE = TokuDB);
^C
5. alias mysqlmtr=
6. mysqlmtr -P13001 test < /home/sveta/
7. ../bin/mysqladmin -h127.0.0.1 -P13001 -uroot shutdown
8. rm var/mysqld.
9. LD_PRELOAD=
10. mysqlmtr -P13001 test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.6.34-
Copyright (c) 2009-2016 Percona LLC and/or its affiliates
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| t1 |
+----------------+
1 row in set (0.00 sec)
mysql> drop table t1;
ERROR 1051 (42S02): Unknown table 'test.t1'
mysql> show tables;
Empty set (0.00 sec)
mysql> drop database test;
Query OK, 0 rows affected (0.01 sec)
mysql> create database test;
Query OK, 1 row affected (0.00 sec)
mysql> \q
Bye
11. mysqlmtr -P13001 test < /home/sveta/
ERROR 1030 (HY000) at line 1: Got error 17 from storage engine
12. ls var/mysqld.1/data/
auto.cnf log000000000001
ibdata1 mtr test tokudb.environment __tokudb_
ib_logfile0 mysql _test_t1_
ib_logfile1 performance_schema _test_t1_
13. rm var/mysqld.
14. ls var/mysqld.1/data/
auto.cnf ib_logfile1 mysql test __tokudb_
ibdata1 log000000000001
ib_logfile0 mtr tc.log tokudb.environment __tokudb_
15. mysqlmtr -P13001 test < /home/sveta/
ERROR 1030 (HY000) at line 1: Got error 17 from storage engine
16. tail var/log/
2017-01-20 01:29:22 14072 [Note] InnoDB: Percona XtraDB (http://
2017-01-20 01:29:22 14072 [Note] Server hostname (bind-address): '*'; port: 13001
2017-01-20 01:29:22 14072 [Note] IPv6 is available.
2017-01-20 01:29:22 14072 [Note] - '::' resolves to '::';
2017-01-20 01:29:22 14072 [Note] Server socket created on IP: '::'.
2017-01-20 01:29:22 14072 [Note] Event Scheduler: Loaded 0 events
2017-01-20 01:29:22 14072 [Note] /home/sveta/
Version: '5.6.34-
2017-01-20 01:29:41 14072 [ERROR] TokuDB: toku dbremove failed
Option tokudb_
Changed in percona-server: | |
status: | Confirmed → Won't Fix |
tokudb_ strip_frm_ data is not for this purpose and should never be used in any attempt of data recovery as it can actually cause further data loss.
This sounds like some TokuDB/PerconaFT data files were deleted out from under the storage engine, causing the PerconaFT directory file mapping to become inconsistent (and possibly inconsistent with recovery log entries that also might refer to that now missing data file). This is not a supported operation and will result in precisely the situation that is described. Restore from a backup or logical dump and reload is the only recovery mechanism available and supported at this time.