[MDEV-9673] InnoDB/XtraDB recovery should fail early if datadir is not readable Created: 2016-03-02 Updated: 2020-08-25 Resolved: 2017-11-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 10.0.16, 5.5, 10.0, 10.1 |
| Fix Version/s: | 10.2.2, 10.3.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Hartmut Holzgraefe | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | upstream-fixed | ||
| Environment: |
Linux |
||
| Description |
|
If mysqld has no read permission on the data directory it will normally pass InnoDB initialization, but will fail with a clear error message during Aria initialization:
Here the problem "Permission denied" is clearly stated, and the directory name is given. If InnoDB requires crash recovery though it will also complain about the permission problem, but is only giving the error number and does not print the directory name:
followed by an error message for every per-table .idb file, e.g.:
This makes the actual permission error messages easy to miss in the flood of .ibd per-table related messages. How to reproduce:
IMHO InnoDB crash recovery should already fail hard after the initial permission error, it is pretty clear at that point already that full recovery will not be possible. Also the initial InnoDB error message should contain the textual error description from perror()/strerror() "Permission denied" and should print the directory path, to make clear what the error is and on which directory it happened. |
| Comments |
| Comment by Elena Stepanova [ 2016-03-02 ] | |||||||||||||||||||||||||||||||||||||||
|
Also reproducible on MySQL 5.6, but appears to be fixed in MySQL 5.7 – it now recognizes the lack of access and refuses to proceed:
Hopefully, it will be fixed in MariaDB 10.2 by merging corresponding versions of InnoDB/XtraDB. | |||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-03-24 ] | |||||||||||||||||||||||||||||||||||||||
|
elenst, can you confirm whether this is fixed in 10.2.2 (which merged MySQL 5.7.9)? I think that with my WL#7142 (InnoDB Crash Recovery Improvements in MySQL 5.7), InnoDB recovery is more robust. If any .ibd file that is mentioned by the redo log is missing, we will refuse recovery unless innodb_force_recovery=1 is set. Older InnoDB versions would silently lose changes to files that were not accessible. | |||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-06-21 ] | |||||||||||||||||||||||||||||||||||||||
|
I can confirm that now it behaves as described previously for MySQL 5.7:
It still doesn't print the datadir as mentioned in the initial description, but neither does MySQL; at least the error message isn't that easy to miss anymore. On a debug build, this refusal to start is followed by Assertion `global_status_var.global_memory_used == 0' failed:
marko, are you okay with the above, or do you want to fix anything else in scope of this issue? | |||||||||||||||||||||||||||||||||||||||
| Comment by Julien Fritsch [ 2017-09-06 ] | |||||||||||||||||||||||||||||||||||||||
|
Hi marko, can I ask you if this bug shouldn't be closed ? I have seen your comment asking Elena if this was fixed in 10.2.2 and she confirmed that it behaves as described previously for MySQL 5.7 | |||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-09-06 ] | |||||||||||||||||||||||||||||||||||||||
|
I think that this should be fixed in MariaDB. | |||||||||||||||||||||||||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2017-11-08 ] | |||||||||||||||||||||||||||||||||||||||
|
The excessive error messages are reproducible up to MariaDB 10.1.x With 10.2 they are gone, startup indeed gets terminated right after the first permission problem is detected:
The original problem was that in function recv_init_crash_recovery() the return value of fil_load_single_table_tablespaces() was ignored, so letting execution continue ... This part of code has changed substantially in the MySQL 5.7 version of the InnoDB storage engine code we are now using instead of XtraDB. The lack of printing the actual path related to the permission error code persists, but was never the main focus of this bug report. So this can be closed at this point IMHO | |||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-11-08 ] | |||||||||||||||||||||||||||||||||||||||
|
hholzgra, thank you! The goal was to make crash recovery more reliable, so that missing data files are no longer silently ignored, and also faster, because applying redo log no longer requires reading the first page of all the *.ibd files. The error messages related to file I/O should indeed be improved, and the whole I/O layer should be simplified. That is challenging to do in a GA release, and for development releases, there always seem to exist higher-priority tasks. |