innobackupex failed to copy-back backup if destination dir is not empty
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB |
Fix Released
|
Low
|
Igor Tverdovskiy | ||
2.0 |
Fix Released
|
Low
|
Igor Tverdovskiy | ||
2.1 |
Fix Released
|
Low
|
Igor Tverdovskiy |
Bug Description
Hi,
innobackupex requires empty destination dir in order to copy backup to it. I think this is wrong behaviour, because target dir could/should contain custom my.cnf or master.info files. In such a case innobackupex should not consider non empty dir as error.
How to reproduce:
==
> ls -lh /var/192.
total 8,0K
-rw-rw---- 1 mysql mysql 69 Feb 18 23:08 master.info
-rw-r----- 1 mysql mysql 404 Feb 18 23:09 my.cnf
==
> sudo innobackupex --copy-back /var/tmps/backup
===
Original data directory is not empty! at /usr/bin/
===
Fix:
I have modified template which decides whether directory is empty or not.
==
--if ( ! scalar( grep { $_ ne "." && $_ ne ".." } readdir($dh)) == 0) {
++if ( ! scalar( grep { $_ ne "." && $_ ne ".." && $_ ne "my.cnf" && $_ ne "master.info"} readdir($dh)) == 0) {
==
Related branches
- Stewart Smith (community): Approve
- Valentine Gostev (community): Needs Fixing
- Alexey Kopytov: Pending requested
-
Diff: 12 lines (+1/-1)1 file modifiedinnobackupex (+1/-1)
Changed in percona-xtrabackup: | |
assignee: | nobody → Igor Tverdovskiy (igor-tverdovskiy) |
Changed in percona-xtrabackup: | |
status: | Confirmed → Fix Committed |
milestone: | none → 2.0.1 |
importance: | Undecided → Low |
Changed in percona-xtrabackup: | |
status: | Fix Committed → Fix Released |
also it should be backported to 1.6 release, changes are the same...