innobackupex dies if a directory is not readable. i.e.: lost+found
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB | Status tracked in 2.4 | |||||
2.1 |
Won't Fix
|
Low
|
Unassigned | |||
2.2 |
Won't Fix
|
Low
|
Unassigned | |||
2.3 |
Fix Released
|
Low
|
Vasily Nemkov | |||
2.4 |
Fix Released
|
Low
|
Vasily Nemkov |
Bug Description
I am using percona-
MySQL uses innobackupex to perform SST (State Snapshot Tranfer) from one node to the others, and innobackupex is run as user mysql (we don't want to run mysql as root).
If a directory under the MySQL "datadir" is not accessible by the user, innobackupex will die.
A common case, is the 'lost+found' directory which is owned by root and has permissions 0700
I don't have the logs with me, but it's just easy to reproduce:
1) install -g root -o root -m 0700 -d ~mysql/blahblah
2) run innobackupex as user mysql
Of course, there should not be such a weird directory, but in the case of 'lost+found' there should be an exception.
The fix that makes much more sense to me, is to have an exception for such directory (nobody will call a schema with such name).
It would be acceptable to have an option to exclude a specific directory, but this option should be understandable by Galera, and writable to MySQL configuration file.
description: | updated |
description: | updated |
description: | updated |
tags: | added: low-hanging-fruit |
Note there's a very similar bug reported against MySQL: http:// bugs.mysql. com/bug. php?id= 22615
I.e. the server treats any directory as a database and that may cause issues if some directories (such as lost+found, .Trashes, etc.) are created by OS utilities rather than the server.
The suggested workaround for lost+found mentioned in that bug report would also eliminate the problem for XtraBackup. I.e. just make datadir a subdirectory of a mount rather than the top-level directory.
That bug was fixed only in 5.6 by introducing another server option, --ignore-db-dir.
I see 2 ways to fix this for XtraBackup:
1) Provide a way to exclude certain directories from the backup. Which has already been requested in bug #688717.
2) Read ignore_db_dir from my.cnf in server versions 5.6 and higher, and automatically exclude them from the backup.
Which makes this report essentially a request to implement #2.