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

Proposed by Vlad Lesin
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 694
Proposed branch: lp:~vlad-lesin/percona-xtrabackup/2.1-bug-1227240
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 67 lines (+48/-4)
2 files modified
src/xtrabackup.cc (+9/-4)
test/t/xb_bug_1227240.sh (+39/-0)
To merge this branch: bzr merge lp:~vlad-lesin/percona-xtrabackup/2.1-bug-1227240
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+190068@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.1-param/456/

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

1. Testcase?

2. The warning refers to the --archived-logs-dir option, but the current name is --innobase-log-arch-dir?

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

> 1. Testcase?
>
> 2. The warning refers to the --archived-logs-dir option, but the current name
> is --innobase-log-arch-dir?

Done.

http://jenkins.percona.com/view/XtraBackup/job/percona-xtrabackup-2.1-param/478/

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

Vlad,

If you have require_* calls at the start, why do you need other checks at the end of the test (and a separate function)?

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

On 11/11/2013 07:32 AM, Alexey Kopytov wrote:
> Review: Needs Fixing
>
> Vlad,
>
> If you have require_* calls at the start, why do you need other checks at the end of the test (and a separate function)?
>

As the test requires archived logs enabled the check is the same as for
xb_apply_archived_logs.sh. "require_xtradb" checks only the fact that
xtrabackup is built with xtradb, but it does not examine the version of
built-in xtradb. Archived logs applying is enabled only in xtradb 5.6.

Additional function was involved for better code readability from my
point of view.

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

Vlad,

"require_server_version_higher_than '5.6.10'" ensures that the test is only run with xtrabackup_56 as the XtraBackup binary. If it wasn't the case, a lot of other tests would fail too. Thus checks for xtrabackup_56 (and thus, the function) are redundant, please remove them.

Revision history for this message
Vlad Lesin (vlad-lesin) wrote :

On 11/11/2013 02:05 PM, Alexey Kopytov wrote:
> Vlad,
>
> "require_server_version_higher_than '5.6.10'" ensures that the test is only run with xtrabackup_56 as the XtraBackup binary. If it wasn't the case, a lot of other tests would fail too. Thus checks for xtrabackup_56 (and thus, the function) are redundant, please remove them.
>

This is true for our default use case but this is not true for common
case. "require_server_version_higher_than" checks only server version.
If "XB_BUILD" variable is set to "autodetect"(default value) then
xtrabackup binary name is chosen based on server version(see
get_version_info()). But the default value and consequently xtrabackup
binary name can be changed with "-c" option of "run.sh".

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

Hi Vlad,

On Mon, 11 Nov 2013 11:03:20 -0000, Vlad Lesin wrote:
> On 11/11/2013 02:05 PM, Alexey Kopytov wrote:
>> Vlad,
>>
>> "require_server_version_higher_than '5.6.10'" ensures that the test is only run with xtrabackup_56 as the XtraBackup binary. If it wasn't the case, a lot of other tests would fail too. Thus checks for xtrabackup_56 (and thus, the function) are redundant, please remove them.
>>
>
> This is true for our default use case but this is not true for common
> case. "require_server_version_higher_than" checks only server version.
> If "XB_BUILD" variable is set to "autodetect"(default value) then
> xtrabackup binary name is chosen based on server version(see
> get_version_info()). But the default value and consequently xtrabackup
> binary name can be changed with "-c" option of "run.sh".
>

The '-c' option is only required to test "unreleased" patches and
configurations. For example, the xtrabackup binary based on
innodb51.patch is never released, innobackupex uses the xtradb51-based
binary to backup MySQL 5.1 servers.

However, we still need to support and maintain innodb51.patch in 2.1. In
2.2 all patches and the -c option will go away soon.

With that in mind, I don't see how, for example, "run.sh -c xtradb55"
against a 5.6 server would be a valid "case". It's just misusing a
feature designed for something completely different. And, as I said, a
lot of tests would fail in that case, not just this specific one.

Revision history for this message
Alexey Kopytov (akopytov) wrote :
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
=== modified file 'src/xtrabackup.cc'
--- src/xtrabackup.cc 2013-11-12 08:56:58 +0000
+++ src/xtrabackup.cc 2013-11-13 23:52:00 +0000
@@ -5993,10 +5993,15 @@
59935993
5994 if (!xtrabackup_prepare &&5994 if (!xtrabackup_prepare &&
5995 (innobase_log_arch_dir || xtrabackup_archived_to_lsn)) {5995 (innobase_log_arch_dir || xtrabackup_archived_to_lsn)) {
5996 msg("xtrabackup: error: "5996 /*
5997 "--archived-logs-dir and --to-archived-lsn can be used "5997 Default my.cnf can contain innobase_log_arch_dir option set for server,
5998 "only with --prepare\n");5998 reset it to allow backup.
5999 exit(EXIT_FAILURE);5999 */
6000 innobase_log_arch_dir= NULL;
6001 xtrabackup_archived_to_lsn= 0;
6002 msg("xtrabackup: warning: "
6003 "as --innodb-log-arch-dir and --to-archived-lsn can be used "
6004 "only with --prepare they will be reset\n");
6000 }6005 }
60016006
6002 /* cannot execute both for now */6007 /* cannot execute both for now */
60036008
=== added file 'test/t/xb_bug_1227240.sh'
--- test/t/xb_bug_1227240.sh 1970-01-01 00:00:00 +0000
+++ test/t/xb_bug_1227240.sh 2013-11-13 23:52:00 +0000
@@ -0,0 +1,39 @@
1. inc/common.sh
2# If server config file contains innodb-log-arch-dir option
3# then "xtrabackup --backup" fails as it reads this option
4# from server config file and it was supposed innodb-log-arch-dir
5# option can be used only with --prepare for xtrabackup.
6# Currently this limitation is removed and only warning outputs
7# when attempt of using innodb-log-arch-dir without --prepare
8# takes place.
9
10require_xtradb
11# The xtrabackup build and binary names are choosen automatically
12# corresponding to server version except the case when
13# build name is set explicitly with certain command line option.
14# If such option is not used the below string not only checks the
15# server version but if the check passed this means that the
16# required xtrabackup build name is set.
17require_server_version_higher_than '5.6.10'
18
19init_server_variables 1
20switch_server 1
21ARCH_LOG_DIR=$MYSQLD_VARDIR/arch_log
22BACKUP_DIR=$MYSQLD_VARDIR/backup
23reset_server_variables 1
24
25MYSQLD_EXTRA_MY_CNF_OPTS="innodb-log-archive=ON
26 innodb-log-arch-dir=$ARCH_LOG_DIR"
27mkdir -p $ARCH_LOG_DIR $BACKUP_DIR
28
29start_server
30# If xtrabackup finished whithout error the test passed.
31xtrabackup --backup --datadir=$MYSQLD_DATADIR --target-dir=$BACKUP_DIR
32stop_server
33
34rm -rf $ARCH_LOG_DIR $BACKUP_DIR
35
36unset ARCH_LOG_DIR
37unset BACKUP_DIR
38
39exit 0

Subscribers

People subscribed via source and target branches