Feature Request: xtrabackup must have capability to detect if there's no datadir set

Bug #1301735 reported by Paul Namuag
6
This bug affects 1 person
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://www.percona.com/xb/p

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/ib_lru_dump: not overwriting file ./ib_lru_dump at /usr/bin/innobackupex line 2203.

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_checkpoints
-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_binlog_info
-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://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/restoring_a_backup_ibk.html -- see Note) then that error,

innobackupex: Error: Failed to process file /tmp/new/ib_lru_dump: not overwriting file ./ib_lru_dump at /usr/bin/innobackupex line 2203.

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
Revision history for this message
Alexey Kopytov (akopytov) wrote :

I think it's more a bug than a feature request. We should not assume datadir to be the current directory.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-911

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.