[MDEV-8541] TokuDB file map table doesn't reflect the real situation of the files on the disk Created: 2015-07-24 Updated: 2019-12-05 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - TokuDB |
| Affects Version/s: | 10.0.20 |
| Fix Version/s: | 10.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Risato Stefano | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | tokudb, upstream | ||
| Environment: |
ubuntu 15.04 64 bit |
||
| Description |
|
Sometimes TokuDB tables get corrupted, the server crash and will not start anymore. The only way I found to have the server running, is to delete all the .tokudb, .frm and .par files related to the table that caused the crash. The problem is that the information_schema.TokuDB_file_map table still shows the records related to the table, and any subsequent attempt to recreate the table produces the error: 17 "File exists". As reported in |
| Comments |
| Comment by Elena Stepanova [ 2015-07-27 ] | |||||
|
We don't have direct connection to TokuDB gurus from our JIRA anymore, so we need to re-report TokuDB issues (non-specific to MariaDB) to their JIRA: https://tokutek.atlassian.net . | |||||
| Comment by Elena Stepanova [ 2015-08-25 ] | |||||
|
Back to the question, I can report it to TokuDB on your behalf, but they will probably request more information from you, will you be ready to provide it? | |||||
| Comment by Risato Stefano [ 2015-08-25 ] | |||||
|
Hello, sorry for the delay... Thank you! | |||||
| Comment by Risato Stefano [ 2015-08-31 ] | |||||
|
Hello, I'm ready to provide all the information needed. Thank you. ---- Elena Stepanova commented on MDEV-8541: Back to the question, I can report it to TokuDB on your behalf, but they will probably request more information from you, will you be ready to provide it? – | |||||
| Comment by Elena Stepanova [ 2015-08-31 ] | |||||
|
I have refiled it as https://tokutek.atlassian.net/browse/DB-872, so you can track it there. But I suppose for efficient communication you will need to have an account in TokuDB JIRA. | |||||
| Comment by Elena Stepanova [ 2015-09-29 ] | |||||
|
Sadly, the upstream report does not show any activity... We will still have to wait for Percona to work on it, I don't think we have manpower now to start digging deep into TokuDB. | |||||
| Comment by Risato Stefano [ 2015-09-29 ] | |||||
|
Thank you. I started with a fresh install with version 10.1.7, and recreated the databases (about 300GB of compresseded TokuDB files) and in two weeks I did't have any problem. I hope for the future... Bye ---- Elena Stepanova updated MDEV-8541: Sadly, the upstream report does not show any activity... We will still have to wait for Percona to work on it, I don't think we have manpower now to start digging deep into TokuDB. – | |||||
| Comment by Elena Stepanova [ 2015-10-28 ] | |||||
|
steris, how did it go with the fresh install? | |||||
| Comment by Elena Stepanova [ 2015-11-25 ] | |||||
|
Please comment to re-open (or comment directly on the upstream report) if you encounter the problem again. | |||||
| Comment by Risato Stefano [ 2015-11-27 ] | |||||
|
The problem is still present (version 10.1.8). I have executed the following steps: With the last two versions I did't have table corruption after a fresh new install, so the problem wasn't relevant for me (but I had serious problem during the upgrade from 10.1.7 to 10.1.8 on one on the two very similar machines; something were wrong and I needed to fresh install again losing all the data). | |||||
| Comment by Elena Stepanova [ 2015-11-27 ] | |||||
|
steris, I was rather hoping for upstream (TokuDB) to suggest a workaround for the problem, how to get the data back to the consistent state in a best possible way. Since we are not getting any response, I would suggest to try this dirty trick: Lets suppose you had create table test.t1 (pk int primary key, c char(255)) engine=TokuDB, populated with some data, and TokuDB files for this table got corrupted;
Please let me know if it works for you. | |||||
| Comment by Risato Stefano [ 2015-12-02 ] | |||||
|
Ok, I tried the solution and it worked, only I had to add the -a switch to the cp commands to preserve the file permissions (copied as root) elsewhere mariadb can't delete the files and the trick doesn't work. From my point of view the priority should be: Thank you again! PS: I had similar headache when I upgraded from 10.1.7 to 10.1.8 also with some InnoDB tables, but the situation was too complex to report, and finally I've reinstalled MariaDB and restored the DBs cloning the data hard disk from the second test PC, where the upgrade was ok. ---- Elena Stepanova commented on MDEV-8541: steris, I was rather hoping for upstream (TokuDB) to suggest a workaround for the problem, how to get the data back to the consistent state in a best possible way. Since we are not getting any response, I would suggest to try this dirty trick: Lets suppose you had create table test.t1 (pk int primary key, c char(255)) engine=TokuDB, populated with some data, and TokuDB files for this table got corrupted;
Please let me know if it works for you. – | |||||
| Comment by Kai [ 2017-04-26 ] | |||||
|
This continues to be a problem, particularly in cases where files have been lost for whatever reason. | |||||
| Comment by Kai [ 2017-04-26 ] | |||||
|
Apparently, this is resolved in an upcoming version. Fixed in https://tokutek.atlassian.net/browse/FT-733 | |||||
| Comment by Kai [ 2017-08-14 ] | |||||
|
For whatever reason, the solution for this bug is being removed from the upstream TokuDB code – see https://github.com/MariaDB/server/commit/dfeff40706 | |||||
| Comment by Sergei Golubchik [ 2017-08-14 ] | |||||
|
We might merge the upstream solution later, when it gets more mature. It's currently marked Experimental, and TokuDB storage engine in MariaDB is marked stable. | |||||
| Comment by Kai [ 2017-08-14 ] | |||||
|
That commit message is pretty misleading, but your explanation makes more sense. It's definitely a mandatory tool when dealing with certain recovery cases - or, as in my case, when dealing with a table that was corrupted by an earlier bug in TokuDB that has since been fixed. | |||||
| Comment by Risato Stefano [ 2019-12-05 ] | |||||
|
Having a similar situation, where I can't drop and recreate a table with a corrupted partition, with error "File exists", I report my workaround to resolve the problem (MariaDB 10.2.21): SELECT CONCAT('cp /media/data/data/', MID(new.internal_file_name,3), ' /media/data/data/four/', MID(old.internal_file_name,10)) command -rows generated are similar to this one: |