Merge lp:~sergei.glushchenko/percona-xtrabackup/bug983720 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: 423
Proposed branch: lp:~sergei.glushchenko/percona-xtrabackup/bug983720
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 93 lines (+63/-3)
3 files modified
innobackupex (+3/-3)
test/t/bug983720_galerainfo.sh (+32/-0)
test/t/bug983720_lrudump.sh (+28/-0)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-xtrabackup/bug983720
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+102907@code.launchpad.net

Description of the change

Bug #983720: ib_lru_dump and --galera-info fail with --stream=xbstream
innobackupex called the tar utility unconditionally when streaming
ib_lru_dump and xtrabackup_galera_info. Which led to a broken stream
when the xbstream format is used.
Fix is to use $stream_cmd instead of calling the hard-coded "tar" utility.

Jenkins:
http://jenkins.percona.com/view/Percona%20Xtrabackup/job/percona-xtrabackup-param/177/

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

OK to merge. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innobackupex'
2--- innobackupex 2012-03-27 01:08:22 +0000
3+++ innobackupex 2012-04-20 17:23:20 +0000
4@@ -440,7 +440,7 @@
5 and Die "Failed to scp file 'ib_lru_dump': $!";
6 } elsif ($option_stream) {
7 print STDERR "$prefix Backing up as tar stream 'ib_lru_dump'\n";
8- system("cd $orig_datadir; tar chf - ib_lru_dump")
9+ system("cd $orig_datadir; $stream_cmd ib_lru_dump")
10 and Die "Failed to stream 'ib_lru_dump': $!";
11 } elsif (!$option_rsync) {
12 my $src_name = escape_path("$orig_datadir/ib_lru_dump");
13@@ -1277,8 +1277,8 @@
14
15 close(FILE);
16
17- if ($option_stream eq 'tar') {
18- system("cd $option_tmpdir; tar chf - xtrabackup_galera_info")
19+ if ($option_stream) {
20+ system("cd $option_tmpdir; $stream_cmd xtrabackup_galera_info")
21 and Die "Failed to stream 'xtrabackup_galera_info': $!";
22 unlink $galera_info || Die "Failed to delete '$galera_info': $!";
23 }
24
25=== added file 'test/t/bug983720_galerainfo.sh'
26--- test/t/bug983720_galerainfo.sh 1970-01-01 00:00:00 +0000
27+++ test/t/bug983720_galerainfo.sh 2012-04-20 17:23:20 +0000
28@@ -0,0 +1,32 @@
29+############################################################################
30+# Bug983720: ib_lru_dump and --galera-info fail with --stream=xbstream
31+############################################################################
32+
33+. inc/common.sh
34+
35+set +e
36+${MYSQLD} --basedir=$MYSQL_BASEDIR --user=$USER --help --verbose --wsrep-sst-method=rsync| grep -q wsrep
37+probe_result=$?
38+if [[ "$probe_result" == "0" ]]
39+ then
40+ vlog "Server supports wsrep"
41+ else
42+ echo "Requires WSREP enabled" > $SKIPPED_REASON
43+ exit $SKIPPED_EXIT_CODE
44+fi
45+set -e
46+
47+init
48+run_mysqld --log-bin=`hostname`-bin --binlog-format=ROW --wsrep-provider=${MYSQL_BASEDIR}/libgalera_smm.so --wsrep_cluster_address=gcomm://
49+
50+# take a backup with stream mode
51+mkdir -p $topdir/backup
52+innobackupex --galera-info --stream=xbstream $topdir/backup > $topdir/backup/stream.xbs
53+
54+xbstream -xv -C $topdir/backup < $topdir/backup/stream.xbs
55+if [ -f $topdir/backup/xtrabackup_galera_info ] ; then
56+ vlog "galera info has been backed up"
57+else
58+ vlog "galera info has not been backed up"
59+ exit -1
60+fi
61
62=== added file 'test/t/bug983720_lrudump.sh'
63--- test/t/bug983720_lrudump.sh 1970-01-01 00:00:00 +0000
64+++ test/t/bug983720_lrudump.sh 2012-04-20 17:23:20 +0000
65@@ -0,0 +1,28 @@
66+############################################################################
67+# Bug983720: ib_lru_dump and --galera-info fail with --stream=xbstream
68+############################################################################
69+
70+. inc/common.sh
71+
72+if [ -z "$XTRADB_VERSION" ]; then
73+ echo "Requires XtraDB" > $SKIPPED_REASON
74+ exit $SKIPPED_EXIT_CODE
75+fi
76+
77+init
78+run_mysqld
79+
80+# produce ib_lru_dump
81+${MYSQL} ${MYSQL_ARGS} -e "select * from information_schema.XTRADB_ADMIN_COMMAND /*!XTRA_LRU_DUMP*/;"
82+
83+# take a backup with stream mode
84+mkdir -p $topdir/backup
85+innobackupex --stream=xbstream $topdir/backup > $topdir/backup/stream.xbs
86+
87+xbstream -xv -C $topdir/backup < $topdir/backup/stream.xbs
88+if [ -f $topdir/backup/ib_lru_dump ] ; then
89+ vlog "LRU dump has been backed up"
90+else
91+ vlog "LRU dump has not been backed up"
92+ exit -1
93+fi

Subscribers

People subscribed via source and target branches