Feature Request: xtrabackup must have capability to detect if there's no datadir set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB |
Triaged
|
Low
|
Unassigned | ||
2.1 |
Triaged
|
Low
|
Unassigned | ||
2.2 |
Triaged
|
Low
|
Unassigned | ||
2.3 |
Triaged
|
Low
|
Unassigned |
Bug Description
When there's no found my.cnf file, either /etc/ or given with --defaults-file option,
ex.
# innobackupex --copy-back /tmp/new/
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
Get the latest version of Percona XtraBackup, documentation, and help resources:
http://
IMPORTANT: Please check that the copy-back run completes successfully.
At the end of a successful copy-back run innobackupex
prints "completed OK!".
innobackupex: Starting to copy files in '/tmp/new'
innobackupex: back to original data directory './'
innobackupex: Error: Failed to process file /tmp/new/
XtraBackup routes to the path specified in the source of backup files, in that example, it's /tmp/new, as it's datadir path.
# ls -alth /tmp/new/
[root@localhost mysql]# ls -alth /tmp/new/
total 96M
drwxrwxrwt. 5 root root 4.0K Apr 3 05:33 ..
drwxr-xr-x 7 root root 4.0K Apr 3 05:17 .
drwxr-xr-x 2 root root 16K Apr 3 05:17 dbdtest
drwxr-xr-x 2 root root 20K Apr 3 05:17 sugarcrm
drwxr-xr-x 2 root root 4.0K Apr 3 05:17 mysql
drwxr-xr-x 2 root root 4.0K Apr 3 05:17 test
drwxr-xr-x 2 root root 4.0K Apr 3 05:17 performance_schema
-rw-r--r-- 1 root root 13 Apr 3 04:43 xtrabackup_binary
-rw-rw---- 1 root root 93 Apr 3 04:42 xtrabackup_
-rw-rw---- 1 root root 2.5K Apr 3 04:42 xtrabackup_logfile
-rw-rw---- 1 mysql mysql 128K Apr 3 04:42 ib_lru_dump
-rw-r--r-- 1 root root 29 Apr 3 04:42 xtrabackup_
-rw-r--r-- 1 root root 262 Apr 3 04:42 backup-my.cnf
-rw-rw---- 1 root root 18M Apr 3 04:39 ibdata1
Since XtraBackup doesn't overwrite files (http://
innobackupex: Error: Failed to process file /tmp/new/
is triggered and thus, since ib_lru_dump file is the first listed file when XtraBackup copies the file by the system, then it shows that error.
Suggested Fix:
If no datadir is set, can we have instead say in the output log as, "XtraBackup can't detect datadir path. You need to have a config file, ideally /etc/my.cnf or use --defaults-file, else it'll route its datadir path to the source directory of your backup and could trigger error avoiding to overwrite files.."
description: | updated |
I think it's more a bug than a feature request. We should not assume datadir to be the current directory.