Merge lp:~vlad-lesin/percona-xtrabackup/2.2-bug-1227240 into lp:percona-xtrabackup/2.2

Proposed by Vlad Lesin
Status: Merged
Approved by: Alexey Kopytov
Approved revision: 4886
Merge reported by: Alexey Kopytov
Merged at revision: not available
Proposed branch: lp:~vlad-lesin/percona-xtrabackup/2.2-bug-1227240
Merge into: lp:percona-xtrabackup/2.2
Diff against target: 67 lines (+48/-4)
2 files modified
xtrabackup/src/xtrabackup.cc (+9/-4)
xtrabackup/test/t/xb_bug_1227240.sh (+39/-0)
To merge this branch: bzr merge lp:~vlad-lesin/percona-xtrabackup/2.2-bug-1227240
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+190070@code.launchpad.net

Description of the change

Bug #1227240 fix.

my.cnf can contain innodb_log_arch_dir option for server. xtrabackup can
use servers my.cnf. As innodb_log_arch_dir option can be used only for backup
preparing xtrabackup exits with error message in the case of backup with
innodb_log_arch_dir option. Such behavior does not allow to make backup if
default my.cnf contains innodb_log_arch_dir.

This fix ignores --innodb_log_arch_dir and --to-archived-lsn and outputs warning
if --prepare is not set.

http://jenkins.percona.com/view/XtraBackup/job/percona-xtrabackup-2.2-param/16/

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Same comments as in 2.1.

review: Needs Fixing
Revision history for this message
Vlad Lesin (vlad-lesin) wrote :
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Same question as in 2.1.

review: Needs Fixing
4886. By Vlad Lesin

Bug #1227240 fix.

my.cnf can contain innodb_log_arch_dir option for server. xtrabackup can
use servers my.cnf. As innodb_log_arch_dir option can be used only for backup
preparing xtrabackup exits with error message in the case of backup with
innodb_log_arch_dir option. Such behavior does not allow to make backup if
default my.cnf contains innodb_log_arch_dir.

This fix ignores --innodb_log_arch_dir and --to-archived-lsn and outputs warning
if --prepare is not set.

Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'xtrabackup/src/xtrabackup.cc'
2--- xtrabackup/src/xtrabackup.cc 2013-11-12 08:56:58 +0000
3+++ xtrabackup/src/xtrabackup.cc 2013-11-13 23:52:34 +0000
4@@ -5993,10 +5993,15 @@
5
6 if (!xtrabackup_prepare &&
7 (innobase_log_arch_dir || xtrabackup_archived_to_lsn)) {
8- msg("xtrabackup: error: "
9- "--archived-logs-dir and --to-archived-lsn can be used "
10- "only with --prepare\n");
11- exit(EXIT_FAILURE);
12+ /*
13+ Default my.cnf can contain innobase_log_arch_dir option set for server,
14+ reset it to allow backup.
15+ */
16+ innobase_log_arch_dir= NULL;
17+ xtrabackup_archived_to_lsn= 0;
18+ msg("xtrabackup: warning: "
19+ "as --innodb-log-arch-dir and --to-archived-lsn can be used "
20+ "only with --prepare they will be reset\n");
21 }
22
23 /* cannot execute both for now */
24
25=== added file 'xtrabackup/test/t/xb_bug_1227240.sh'
26--- xtrabackup/test/t/xb_bug_1227240.sh 1970-01-01 00:00:00 +0000
27+++ xtrabackup/test/t/xb_bug_1227240.sh 2013-11-13 23:52:34 +0000
28@@ -0,0 +1,39 @@
29+. inc/common.sh
30+# If server config file contains innodb-log-arch-dir option
31+# then "xtrabackup --backup" fails as it reads this option
32+# from server config file and it was supposed innodb-log-arch-dir
33+# option can be used only with --prepare for xtrabackup.
34+# Currently this limitation is removed and only warning outputs
35+# when attempt of using innodb-log-arch-dir without --prepare
36+# takes place.
37+
38+require_xtradb
39+# The xtrabackup build and binary names are choosen automatically
40+# corresponding to server version except the case when
41+# build name is set explicitly with certain command line option.
42+# If such option is not used the below string not only checks the
43+# server version but if the check passed this means that the
44+# required xtrabackup build name is set.
45+require_server_version_higher_than '5.6.10'
46+
47+init_server_variables 1
48+switch_server 1
49+ARCH_LOG_DIR=$MYSQLD_VARDIR/arch_log
50+BACKUP_DIR=$MYSQLD_VARDIR/backup
51+reset_server_variables 1
52+
53+MYSQLD_EXTRA_MY_CNF_OPTS="innodb-log-archive=ON
54+ innodb-log-arch-dir=$ARCH_LOG_DIR"
55+mkdir -p $ARCH_LOG_DIR $BACKUP_DIR
56+
57+start_server
58+# If xtrabackup finished whithout error the test passed.
59+xtrabackup --backup --datadir=$MYSQLD_DATADIR --target-dir=$BACKUP_DIR
60+stop_server
61+
62+rm -rf $ARCH_LOG_DIR $BACKUP_DIR
63+
64+unset ARCH_LOG_DIR
65+unset BACKUP_DIR
66+
67+exit 0

Subscribers

People subscribed via source and target branches