Merge lp:~sergei.glushchenko/percona-xtrabackup/BT31424-2.0-xb-bug1174314 into lp:percona-xtrabackup/2.0

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 553
Proposed branch: lp:~sergei.glushchenko/percona-xtrabackup/BT31424-2.0-xb-bug1174314
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 67 lines (+39/-2)
3 files modified
src/xtrabackup.cc (+5/-1)
test/t/xb_stats.sh (+1/-1)
test/t/xb_stats_datadir.sh (+33/-0)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-xtrabackup/BT31424-2.0-xb-bug1174314
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+162063@code.launchpad.net

Description of the change

Bug 1174314: Make xtrabackup --stats work with server datadir
xtrabackup --stats made checks whether log files are created or not.
It always considered that log files are stored in data directory.
Solution is to modify check to use innodb_log_group_home_dir value.

http://jenkins.percona.com/view/XtraBackup/job/percona-xtrabackup-2.0-param/429/

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

No testcase?

review: Needs Fixing
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Indeed, I forgot to put it under version control. Branch is updated. Starting Jenkins job.

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Repushed tree because trap statement in test case has been commented out for debug purposes.
I uncommented it.

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-04-29 05:45:52 +0000
+++ src/xtrabackup.cc 2013-05-02 13:11:26 +0000
@@ -6118,7 +6118,11 @@
6118 ibool exists;6118 ibool exists;
6119 os_file_type_t type;6119 os_file_type_t type;
61206120
6121 sprintf(logname, "ib_logfile%lu", (ulong) n);6121 snprintf(logname, sizeof(logname), "%s%c%s%lu",
6122 INNODB_LOG_DIR, SRV_PATH_SEPARATOR,
6123 "ib_logfile", (ulong) n);
6124 srv_normalize_path_for_win(logname);
6125
6122 if (!os_file_status(logname, &exists, &type) || !exists ||6126 if (!os_file_status(logname, &exists, &type) || !exists ||
6123 type != OS_FILE_TYPE_FILE) {6127 type != OS_FILE_TYPE_FILE) {
6124 msg("xtrabackup: Error: "6128 msg("xtrabackup: Error: "
61256129
=== modified file 'test/t/xb_stats.sh'
--- test/t/xb_stats.sh 2012-10-15 16:14:59 +0000
+++ test/t/xb_stats.sh 2013-05-02 13:11:26 +0000
@@ -17,7 +17,7 @@
17vlog "===> xtrabackup --stats --datadir=$topdir/backup"17vlog "===> xtrabackup --stats --datadir=$topdir/backup"
18run_cmd_expect_failure $XB_BIN $XB_ARGS --stats --datadir=$topdir/backup18run_cmd_expect_failure $XB_BIN $XB_ARGS --stats --datadir=$topdir/backup
1919
20if ! grep -q "Cannot find log file ib_logfile0" $OUTFILE20if ! grep -q "Cannot find log file" $OUTFILE
21then21then
22 die "Cannot find the expected error message from xtrabackup --stats"22 die "Cannot find the expected error message from xtrabackup --stats"
23fi23fi
2424
=== added file 'test/t/xb_stats_datadir.sh'
--- test/t/xb_stats_datadir.sh 1970-01-01 00:00:00 +0000
+++ test/t/xb_stats_datadir.sh 2013-05-02 13:11:26 +0000
@@ -0,0 +1,33 @@
1################################################################################
2# Bug #1174314
3# Test xtrabackup --stats with server dir
4################################################################################
5
6. inc/common.sh
7
8mkdir ${TEST_BASEDIR}/logs
9
10trap "rm -rf ${TEST_BASEDIR}/logs" INT TERM EXIT
11
12MYSQLD_EXTRA_MY_CNF_OPTS="
13innodb_log_group_home_dir=${TEST_BASEDIR}/logs
14"
15
16start_server
17
18run_cmd $MYSQL $MYSQL_ARGS test <<EOF
19CREATE TABLE t1(a INT) ENGINE=InnoDB;
20INSERT INTO t1 VALUES (1), (2), (3);
21EOF
22
23shutdown_server
24
25# there is inconsistency between shutdown_server and stop_server
26# stop_server sets XB_ARGS="--no-defaults", while shutdown_server
27# doesn't.
28# we pass all necessary options as an arguments, so if someday this
29# will be changed, test still will work
30xtrabackup --stats --datadir=${MYSQLD_DATADIR} \
31 --innodb_log_group_home_dir=${TEST_BASEDIR}/logs
32
33vlog "stats did not fail"

Subscribers

People subscribed via source and target branches