Wrong placement of xtrabackup_suspended and xtrabackup_checkpoint

Bug #691090 reported by Alexey Kopytov on 2010-12-16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup
Sergei Glushchenko
Sergei Glushchenko
Sergei Glushchenko

Bug Description

Reporting the comment #3 from bug #576286 as a separate bug:

Daniel Harvey wrote on 2010-07-28: #3

There is however a problem with the placement by the script of xtrabackup_suspended file in the streaming case.

When I call

innobackupex-1.5.1 --stream=tar --defaults-file=/home/xxx/.my.cnf ./ | gzip > 20100728.tgz

this file is placed in /var/lib/mysql/xtrabackup_suspended which my non-root user does not have write access to. I will attached my suggested patch fixing this.

Note that the my.cnf file does not overwrite the default MySQL datadir.

Sample output illustrating this:

innobackupex-1.5.1: Using mysql Ver 14.12 Distrib 5.0.75, for debian-linux-gnu (x86_64) using readline 5.2
innobackupex-1.5.1: Using mysql server version Copyright (C) 2000-2008 MySQL AB

innobackupex-1.5.1: Created backup directory /home/xxx/backup/mysql/current
100728 12:46:51 innobackupex-1.5.1: Starting mysql with options: --defaults-file="/home/xxx/.my.cnf" --unbuffered --
100728 12:46:51 innobackupex-1.5.1: Connected to database with mysql child process (pid=4522)
100728 12:46:59 innobackupex-1.5.1: Connection to database server closed
100728 12:46:59 innobackupex-1.5.1: Starting mysql with options: --defaults-file="/home/xxx/.my.cnf" --unbuffered --
100728 12:46:59 innobackupex-1.5.1: Connected to database with mysql child process (pid=4726)
100728 12:47:03 innobackupex-1.5.1: Connection to database server closed

100728 12:47:03 innobackupex-1.5.1: Starting ibbackup with command: xtrabackup_50 --defaults-file="/home/xxx/.my.cnf" --backup --suspend-at-end --log-stream --target-dir=./
innobackupex-1.5.1: Waiting for ibbackup (pid=4830) to suspend
innobackupex-1.5.1: Suspend file '/var/lib/mysql/xtrabackup_suspended'

xtrabackup: suspend-at-end is enabled.
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 = 5242880
xtrabackup: Stream mode.
>> log scanned up to (0 95790)
100728 12:47:03 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name .//xtrabackup_suspended
InnoDB: File operation call: 'open'.
xtrabackup: Error: failed to create file 'xtrabackup_suspended'
xtrabackup: The latest check point (for incremental): '0:95790'
xtrabackup: Error: cannot open .//xtrabackup_checkpoints
xtrabackup: error: xtrabackup_write_metadata()
>> log scanned up to (0 95790)
xtrabackup: Transaction log of lsn (0 95790) to (0 95790) was copied.
innobackupex-1.5.1: Error: ibbackup child process has died at /usr/bin/innobackupex-1.5.1 line 480.

Related branches

Alexey Kopytov: Needs Fixing on 2011-11-14
Stewart Smith: Pending requested 2011-10-28
Merged into lp:percona-xtrabackup/2.0 at revision 388
Alexey Kopytov: Approve on 2012-01-27
Merged into lp:percona-xtrabackup/1.6 at revision 320
Alexey Kopytov: Approve on 2012-01-27
Alexey Kopytov (akopytov) wrote :

Right, I forgot to re-attach the patch from #576286. Thanks for posting the link.

Changed in percona-xtrabackup:
assignee: nobody → Alexey Kopytov (akopytov)
status: New → Confirmed
importance: Undecided → Medium
milestone: none → 1.6
Changed in percona-xtrabackup:
status: Confirmed → New
assignee: Alexey Kopytov (akopytov) → Valentine Gostev (core-longbow)
Changed in percona-xtrabackup:
milestone: 1.6 → 1.7
Valentine Gostev (longbow) wrote :


 726 sub start_ibbackup {
 737 if (!$option_remote_host && !$option_stream) {
 738 $options = $options . " --target-dir=$backup_dir";
 739 } else {
 740 #(datadir) for 'xtrabackup_suspended' and 'xtrabackup_checkpoints'
 741 $options = $options . " --log-stream --target-dir=./";
 742 }

1369 sub init {
1436 if (!$option_apply_log && !$option_copy_back) {
1443 print STDERR "$prefix Created backup directory $backup_dir\n";
1444 if (!$option_remote_host && !$option_stream) {
1451 } else {
1452 $suspend_file = get_option(\%config, 'mysqld', 'datadir') . '/xtrabackup_suspended';

When stream option specified, xtrabackup_suspended in mysql datadir and may cause permission issues when running from user which does not have write permissions in mysql datadir

Changed in percona-xtrabackup:
status: New → Confirmed
importance: Medium → High
Changed in percona-xtrabackup:
status: Confirmed → In Progress
Stewart Smith (stewart) wrote :

Valentine, are you working on getting a merge request in with the fix? Or should I reassign?

Valentine Gostev (longbow) wrote :

scheduled working on this for Sunday

Alexey Kopytov (akopytov) wrote :

The fix for this bug is essentially a prerequisite to fixing bug #489290. Reassigning to Sergei.

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

Other bug subscribers