xtrabackup ignores defaults-file in apply-log-only prepare mode

Bug #798488 reported by Lachlan Mulcahy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
Low
Alexey Kopytov
2.0
Fix Released
Low
Alexey Kopytov

Bug Description

When running a command like the following it seems the contents of the backup-my.cnf is ignored with regards to some innodb params, specifically the central tablespace files and their sizes.

eg.

root@mslvlxbp01:/backup/tdp03r-int/2011-05-25_00-13-54# cat backup-my.cnf
# This MySQL options file was generated by innobackupex-1.5.1.

# The MySQL server
[mysqld]
datadir=/backup/tdp03r-int/2011-05-25_00-13-54
innodb_data_home_dir=/backup/tdp03r-int/2011-05-25_00-13-54
innodb_data_file_path=ibdata1:2000M;ibdata2:10M:autoextend
innodb_log_group_home_dir=/backup/tdp03r-int/2011-05-25_00-13-54
innodb_log_files_in_group=2
innodb_log_file_size=2097152000

root@mslvlxbp01:/backup/tdp03r-int/2011-05-25_00-13-54# xtrabackup_51 --prepare --apply-log-only --target-dir=./ --defaults-file=backup-my.cnf
xtrabackup_51 Ver undefined Rev undefined for 5.1.56 pc-solaris2.11 (i386)
xtrabackup: cd to ./
xtrabackup: This target seems to be not prepared yet.
xtrabackup: xtrabackup_logfile detected: size=20582907904, start_lsn=(1927 3164130075)
xtrabackup: Temporary instance for recovery is set 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 = 1
xtrabackup: innodb_log_file_size = 20582907904
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: The InnoDB memory heap is disabled

Note in the above that innodb_data_file_path regurgitated by xtrabackup binary is not the same as in the backup-my.cnf file.

Now giving these parameters directly to xtrabackup binary on the cmd line you can see it regurgitates them correctly:

root@mslvlxbp01:/backup/tdp03r-int/2011-05-25_00-13-54# xtrabackup_51 --apply-log-only --prepare --innodb_data_file_path='ibdata1:2000M;ibdata2:10M:autoextend' --innodb_data_home_dir=`pwd` --target-dir=./
xtrabackup_51 Ver undefined Rev undefined for 5.1.56 pc-solaris2.11 (i386)
xtrabackup: cd to ./
xtrabackup: This target seems to be not prepared yet.
xtrabackup: xtrabackup_logfile detected: size=20582907904, start_lsn=(1927 3164130075)
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 1
xtrabackup: innodb_log_file_size = 20582907904
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: The InnoDB memory heap is disabled

This can be a fairly big issue, because not giving xtrabackup the correct innodb_data_file_path will cause an assert failure during the apply-log. The error isn't particularly descriptive, so it can be quite a headache to understand the cause.

Related branches

Stewart Smith (stewart)
Changed in percona-xtrabackup:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Alexey Kopytov (akopytov) wrote :

It's a documented limitation of --defaults-file: http://dev.mysql.com/doc/refman/5.5/en/option-files.html#option-file-options

"
Most MySQL programs that support option files handle the following options. They affect option-file handling, so they must be given on the command line and not in an option file. To work properly, each of these options must immediately follow the command name
"

So --defaults-file must be the first option on the command line in order to work correctly.

Revision history for this message
Stewart Smith (stewart) wrote :

I really hate this limitation... we should at least warn on it.

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

For a number of reasons load_defaults() must be called before parsing command line arguments. Fixing that MySQL limitation within xtrabackup patches does not look reasonable to me.

I'm going to "fix" it by making xtrabackup fail with an appropriate error message when --defaults-file is not the first option on the command line.

Changed in percona-xtrabackup:
assignee: nobody → Alexey Kopytov (akopytov)
Changed in percona-xtrabackup:
status: Triaged → Fix Committed
Changed in percona-xtrabackup:
importance: High → Low
Stewart Smith (stewart)
Changed in percona-xtrabackup:
milestone: none → 1.7.0beta1
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-828

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.