--no-timestamp gives a "failed to create backup directory" error if the root backup dir already exists

Bug #1162952 reported by Jay Janssen
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Triaged
Wishlist
Unassigned
2.0
Won't Fix
Undecided
Unassigned
2.1
Triaged
Wishlist
Unassigned
2.2
Triaged
Wishlist
Unassigned
2.3
Triaged
Wishlist
Unassigned

Bug Description

[root@node3 ~]# mkdir backup
[root@node3 ~]# innobackupex --galera-info --no-timestamp backup

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Ireland Ltd 2009-2012. All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

130401 14:51:43 innobackupex: Starting mysql with options: --unbuffered --
130401 14:51:43 innobackupex: Connected to database with mysql child process (pid=13165)
130401 14:51:49 innobackupex: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex
           prints "completed OK!".

innobackupex: Using mysql Ver 14.14 Distrib 5.5.29, for Linux (i686) using readline 5.1
innobackupex: Using mysql server version Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

innobackupex: Error: Failed to create backup directory backup: File exists at /usr/bin/innobackupex line 381.

[root@node3 ~]# rmdir backup
[root@node3 ~]# innobackupex --galera-info --no-timestamp backup

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Ireland Ltd 2009-2012. All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

130401 14:53:38 innobackupex: Starting mysql with options: --unbuffered --
130401 14:53:38 innobackupex: Connected to database with mysql child process (pid=13252)
130401 14:53:44 innobackupex: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex
           prints "completed OK!".

innobackupex: Using mysql Ver 14.14 Distrib 5.5.29, for Linux (i686) using readline 5.1
innobackupex: Using mysql server version Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

innobackupex: Created backup directory /root/backup
130401 14:53:44 innobackupex: Starting mysql with options: --unbuffered --
130401 14:53:44 innobackupex: Connected to database with mysql child process (pid=13279)
130401 14:53:46 innobackupex: Connection to database server closed

130401 14:53:46 innobackupex: Starting ibbackup with command: xtrabackup_55 --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/root/backup --tmpdir=/tmp
innobackupex: Waiting for ibbackup (pid=13287) to suspend
innobackupex: Suspend file '/root/backup/xtrabackup_suspended'

xtrabackup_55 version 2.0.6 for Percona Server 5.5.16 Linux (i686) (revision id: 521)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /var/lib/mysql
xtrabackup: Target instance is assumed as followings.
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 67108864
>> log scanned up to (79201709)
[01] Copying ./ibdata1 to /root/backup/ibdata1
[01] ...done

130401 14:53:49 innobackupex: Continuing after ibbackup has suspended
130401 14:53:49 innobackupex: Starting mysql with options: --unbuffered --
130401 14:53:49 innobackupex: Connected to database with mysql child process (pid=13301)
130401 14:53:51 innobackupex: Starting to lock all tables...
>> log scanned up to (79201709)
>> log scanned up to (79201709)
>> log scanned up to (79201709)
130401 14:54:05 innobackupex: All tables locked and flushed to disk

130401 14:54:05 innobackupex: Starting to backup non-InnoDB tables and files
innobackupex: in subdirectories of '/var/lib/mysql'
innobackupex: Backing up file '/var/lib/mysql/test/sbtest1.frm'
innobackupex: Backing up files '/var/lib/mysql/performance_schema/*.{frm,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (18 files)
innobackupex: Backing up files '/var/lib/mysql/mysql/*.{frm,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (72 files)
130401 14:54:06 innobackupex: Finished backing up non-InnoDB tables and files

130401 14:54:06 innobackupex: Waiting for log copying to finish

xtrabackup: The latest check point (for incremental): '79201555'
xtrabackup: Stopping log copying thread.
.>> log scanned up to (79201709)

xtrabackup: Transaction log of lsn (79201555) to (79201709) was copied.
130401 14:54:09 innobackupex: All tables unlocked
130401 14:54:09 innobackupex: Connection to database server closed

innobackupex: Backup created in directory '/root/backup'
innobackupex: MySQL binlog position: filename '', position
130401 14:54:09 innobackupex: completed OK!

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Yes, but what is the expected behavior in this case? Should --no-timestamp overwrite files in the existing directory? Or just require it to be empty and fail otherwise?

Changed in percona-xtrabackup:
status: New → Incomplete
Revision history for this message
Jay Janssen (jay-janssen) wrote :

Probably the latter -- if it's present but empty (i.e., perfectly usable for a backup), it shouldn't complain about an empty dir. If it detects files, it can error (and possibly provide an option to clean or ignore the existing files in the directory before backing up).

Revision history for this message
Francis Chuang (f21-groups-deactivatedaccount) wrote :

I just ran into this problem today. I would also like to see innobackupex not error out if the directory is present, but empty. My use-case is that I am using a backup application to perform backups from multiple resources and it will create the folder for the backups to go into.

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-994

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.