[MDEV-7841] Got error 2 "No such file or directory" when querying TokuDB_fractal_tree_info Created: 2015-03-25 Updated: 2015-07-30 Resolved: 2015-07-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - TokuDB |
| Affects Version/s: | 10.0.17, 5.5, 10.0 |
| Fix Version/s: | 5.5.44, 10.0.20 |
| Type: | Bug | Priority: | Major |
| Reporter: | Younes Naguib | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS release 6.6 (Final) |
||
| Issue Links: |
|
||||||||
| Sprint: | 5.5.45 | ||||||||
| Description |
|
We were running a very large insert (500M rows) from an innodb table to a tokudb table. The tokudb table has 700 partitions with 4 indexes. After the failures anything regarding TokuDB metadata was returning that error: No such file or directory. Whether we were looking at this table or another. Using sysdig, we found out that no mater what table you would be looking at, tokudb opens all tokudb related files. And in this case, the file it was looking for, existed but had a different name. We shutdown the database, and renamed the file, and all worked after that. We tried many thing to get around the problem, one was to drop the table, which wasn't possible as it was giving us the same error. |
| Comments |
| Comment by Elena Stepanova [ 2015-03-26 ] |
|
Can you shed any light on the naming issue before we start digging into everything else, e.g. crash reasons or correlation with Galera? |
| Comment by Younes Naguib [ 2015-03-26 ] |
|
I couldn't find the exact crash reason! The only thing I can say, is that we were running a very large insert when the db crashed. The insert was meant to migrate from innodb to tokudb. We're not using Galera! _MYDB_MYTAB_P_day_20140101_key_idx1_9a60c_2_1b_B_3.tokudb |
| Comment by Elena Stepanova [ 2015-03-26 ] |
|
Okay, thanks, I'll remove Galera from the equation (you put it into the Affected version/s list, that's why I added it as a possible factor). |
| Comment by Younes Naguib [ 2015-03-26 ] |
|
The problem reappeared for some reason! |
| Comment by Younes Naguib [ 2015-03-26 ] |
|
Here is what seems to be the problem: It returns a table_name. Anyway to clean this up? |
| Comment by Rich Prohaska [ 2015-03-26 ] |
|
Looks like the crash left the state of the tokudb.directory to be inconsistent with the tokudb file names. We would be interested in any way to reproduce this problem. The tokudb.directory is a meta-data fractal tree that contains a mapping from data names (like database/table-type) to the file name that contains the fractal tree. There is no current way to delete these names. However, since the tokudb.directory is a fractal tree, a program could be written that deletes the extraneous rows from it. If you supply your mysql data directory, i can develop such a program. |
| Comment by Younes Naguib [ 2015-03-26 ] |
|
Here are my dir: The crash happened when trying a very large insert from innodb->tokudb. I can probably reproduce the issue! I did before, but I though it was due to a faulty drive. I can try again, but I'd like to be able to clean it afterward |
| Comment by Rich Prohaska [ 2015-03-26 ] |
|
The mysql error log may have some stack trace information in it when mysqld crashed. Would like to see it. |
| Comment by Younes Naguib [ 2015-03-26 ] |
|
It had nothing! MySQL process died fast enough that it didn't write anything in it. |
| Comment by Younes Naguib [ 2015-03-26 ] |
|
I'll see if I can spawn an AWS instance to reproduce the problem. |
| Comment by Rich Prohaska [ 2015-03-26 ] |
|
I have seen mysqld killed by the OOM killer. When this happens, the error log does NOT contain any crash information. Is there anything in the linux system log about mysqld being killed? |
| Comment by Younes Naguib [ 2015-03-26 ] |
|
And that was it: I had so much messages from selinux, which I just disabled, I missed the obvious! So, this type of crashed, corrupts the tokudb catalog. |
| Comment by Rich Prohaska [ 2015-03-27 ] |
|
Thanks for the info. To summarize, a mysqld crash while an innodb table was being altered to tokudb can result in an inconsistency in the tokudb files. If you have the original mysql data directory after the crash, I would like to play with it. |
| Comment by Younes Naguib [ 2015-03-27 ] |
|
It wasn't an alter, but an "insert into tk_table select * from innodb_table. |
| Comment by Rich Prohaska [ 2015-03-27 ] |
|
Interesting. So tk_table was already created, the 'insert select' was executed, and the system crashed while the 'insert select' was still running? BTW, only create table, drop table, rename table, and alter table change the contents of the tokudb.directory. The best case for me is to get the entire MySQL data directory. If I can't get that, then all of the tokudb meta data files (log*.tokulog*, tokudb.), some of the tokudb files (.tokudb), and the output from "find $MYSQL_DATA_DIR". |
| Comment by Younes Naguib [ 2015-03-27 ] |
|
Yes DB crashed during the Insert! Does a large insert changes the tokudb file name? |
| Comment by Rich Prohaska [ 2015-03-27 ] |
|
If the target table is empty, tokudb will use a bulk loader which loads into new tokudb files and then does a big rename at the end. Was tk_table empty when the insert select was started? |
| Comment by Younes Naguib [ 2015-03-27 ] |
|
Yes it was... We're getting closer |
| Comment by Rich Prohaska [ 2015-03-27 ] |
|
I have not been able to reproduce this problem of crashing while inserting into an empty partitioned tokudb table. Is the original mysql data directory after the crash available? |
| Comment by Younes Naguib [ 2015-03-27 ] |
|
Yes the dir is available... I cant post the content as it is sensible information! |
| Comment by Rich Prohaska [ 2015-03-27 ] |
|
i created a table s with a bunch of rows in it. currently tokudb but it does not matter (IMO). why do i want the mysql dir? i want to run tokudb recovery and see where things go wrong. if i cant get the entire dir, can i get the tokudb recovery log files (log*.tokulog*) and a listing of the mysql data dir files (the output from find MYSQL_DATA_DIR)? |
| Comment by Younes Naguib [ 2015-03-28 ] |
|
I sent you all the info by email. y |
| Comment by Rich Prohaska [ 2015-03-28 ] |
|
Hello. Need the tokudb recovery log files (log*.tokulog*). |
| Comment by Younes Naguib [ 2015-03-30 ] |
|
I followed you advise and created a table with the same structure, renamed the files to reflect the files in the dictionary, then dropped the old table again. Thanks for your help. |
| Comment by Rich Prohaska [ 2015-06-08 ] |
|
The original bug of getting an error when querying the tokudb_fractal_tree_info table is fixed in tokudb 7.5.7. See https://tokutek.atlassian.net/browse/DB-829. |
| Comment by Elena Stepanova [ 2015-06-08 ] |
|
Thanks. |