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
1=== modified file 'src/xtrabackup.cc'
2--- src/xtrabackup.cc 2013-04-29 05:45:52 +0000
3+++ src/xtrabackup.cc 2013-05-02 13:11:26 +0000
4@@ -6118,7 +6118,11 @@
5 ibool exists;
6 os_file_type_t type;
7
8- sprintf(logname, "ib_logfile%lu", (ulong) n);
9+ snprintf(logname, sizeof(logname), "%s%c%s%lu",
10+ INNODB_LOG_DIR, SRV_PATH_SEPARATOR,
11+ "ib_logfile", (ulong) n);
12+ srv_normalize_path_for_win(logname);
13+
14 if (!os_file_status(logname, &exists, &type) || !exists ||
15 type != OS_FILE_TYPE_FILE) {
16 msg("xtrabackup: Error: "
17
18=== modified file 'test/t/xb_stats.sh'
19--- test/t/xb_stats.sh 2012-10-15 16:14:59 +0000
20+++ test/t/xb_stats.sh 2013-05-02 13:11:26 +0000
21@@ -17,7 +17,7 @@
22 vlog "===> xtrabackup --stats --datadir=$topdir/backup"
23 run_cmd_expect_failure $XB_BIN $XB_ARGS --stats --datadir=$topdir/backup
24
25-if ! grep -q "Cannot find log file ib_logfile0" $OUTFILE
26+if ! grep -q "Cannot find log file" $OUTFILE
27 then
28 die "Cannot find the expected error message from xtrabackup --stats"
29 fi
30
31=== added file 'test/t/xb_stats_datadir.sh'
32--- test/t/xb_stats_datadir.sh 1970-01-01 00:00:00 +0000
33+++ test/t/xb_stats_datadir.sh 2013-05-02 13:11:26 +0000
34@@ -0,0 +1,33 @@
35+################################################################################
36+# Bug #1174314
37+# Test xtrabackup --stats with server dir
38+################################################################################
39+
40+. inc/common.sh
41+
42+mkdir ${TEST_BASEDIR}/logs
43+
44+trap "rm -rf ${TEST_BASEDIR}/logs" INT TERM EXIT
45+
46+MYSQLD_EXTRA_MY_CNF_OPTS="
47+innodb_log_group_home_dir=${TEST_BASEDIR}/logs
48+"
49+
50+start_server
51+
52+run_cmd $MYSQL $MYSQL_ARGS test <<EOF
53+CREATE TABLE t1(a INT) ENGINE=InnoDB;
54+INSERT INTO t1 VALUES (1), (2), (3);
55+EOF
56+
57+shutdown_server
58+
59+# there is inconsistency between shutdown_server and stop_server
60+# stop_server sets XB_ARGS="--no-defaults", while shutdown_server
61+# doesn't.
62+# we pass all necessary options as an arguments, so if someday this
63+# will be changed, test still will work
64+xtrabackup --stats --datadir=${MYSQLD_DATADIR} \
65+ --innodb_log_group_home_dir=${TEST_BASEDIR}/logs
66+
67+vlog "stats did not fail"

Subscribers

People subscribed via source and target branches