Merge lp:~akopytov/percona-xtrabackup/bug1256942-2.2 into lp:percona-xtrabackup/2.2

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 4929
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1256942-2.2
Merge into: lp:percona-xtrabackup/2.2
Diff against target: 110 lines (+35/-22)
2 files modified
storage/innobase/xtrabackup/innobackupex.pl (+11/-0)
storage/innobase/xtrabackup/test/t/version_check.sh (+24/-22)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1256942-2.2
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+200790@code.launchpad.net
To post a comment you must log in.
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 'storage/innobase/xtrabackup/innobackupex.pl'
2--- storage/innobase/xtrabackup/innobackupex.pl 2014-01-03 10:47:03 +0000
3+++ storage/innobase/xtrabackup/innobackupex.pl 2014-01-08 09:52:56 +0000
4@@ -978,6 +978,10 @@
5 "$home",
6 );
7
8+ if ($ENV{PTDEBUG_VERSION_CHECK_HOME}) {
9+ @vc_dirs = ( $ENV{PTDEBUG_VERSION_CHECK_HOME} );
10+ }
11+
12 sub version_check_file {
13 foreach my $dir ( @vc_dirs ) {
14 if ( -d $dir && -w $dir ) {
15@@ -1547,6 +1551,10 @@
16 $now = current_time();
17 print STDERR
18 "$now $prefix Executing a version check against the server...\n";
19+
20+ # Redirect STDOUT to STDERR, as VersionCheck prints alerts to STDOUT
21+ select STDERR;
22+
23 VersionCheck::version_check(
24 force => 1,
25 instances => [ {
26@@ -1555,6 +1563,9 @@
27 }
28 ]
29 );
30+ # Restore STDOUT as the default filehandle
31+ select STDOUT;
32+
33 $now = current_time();
34 print STDERR "$now $prefix Done.\n";
35 }
36
37=== modified file 'storage/innobase/xtrabackup/test/t/version_check.sh'
38--- storage/innobase/xtrabackup/test/t/version_check.sh 2013-11-07 12:23:43 +0000
39+++ storage/innobase/xtrabackup/test/t/version_check.sh 2014-01-08 09:52:56 +0000
40@@ -7,22 +7,14 @@
41
42 start_server
43
44-# VersionCheck looks for a directory where percona-version-check file is created
45-# in the following order:
46-#
47-# my @vc_dirs = (
48-# '/etc/percona',
49-# '/etc/percona-toolkit',
50-# '/tmp',
51-# "$home",
52-# );
53-#
54-# Assume that both /etc/percona and /etc/percona-toolkit either do not exist or
55-# are not writable. So we'll be testing /tmp/percona-version-check. There's a
56-# potential race if there are concurrent tests or other tools using VC, but
57-# there's currently no way to avoid that.
58-
59-rm -f /tmp/percona-version-check
60+# Override the directory where percona-version-check is created to make the test
61+# stable
62+
63+export PTDEBUG_VERSION_CHECK_HOME=$topdir
64+
65+vc_file=$PTDEBUG_VERSION_CHECK_HOME/percona-version-check
66+
67+[ ! -f $vc_file ] || die "$vc_file exists!"
68
69 # VersionCheck is enabled by default, but the test suite adds --no-version-check
70 # to IB_ARGS so we don't execute it for all tests.
71@@ -30,23 +22,33 @@
72
73 innobackupex --no-timestamp $topdir/backup1
74
75-if [ -f /tmp/percona-version-check ]
76+if [ -f $vc_file ]
77 then
78- die "/tmp/percona-version-check has been created with --no-version-check!"
79+ die "$vc_file has been created with --no-version-check!"
80 fi
81
82 IB_ARGS=`echo $IB_ARGS | sed -e 's/--no-version-check//g'`
83
84 innobackupex --no-timestamp $topdir/backup2
85
86-if [ ! -f /tmp/percona-version-check ]
87+if [ ! -f $vc_file ]
88 then
89- die "/tmp/percona-version-check has not been created!"
90+ die "$vc_file has not been created!"
91 fi
92
93-rm -f /tmp/percona-version-check
94-
95 if ! grep -q "Executing a version check" $OUTFILE
96 then
97 die "Version check has not been performed."
98 fi
99+
100+################################################################################
101+# Bug #1256942: xbstream stream mode issues a warning on standard output messing
102+# up the backup stream
103+################################################################################
104+
105+mkdir $topdir/backup3
106+
107+rm -f $vc_file
108+
109+innobackupex --no-timestamp --stream=tar $topdir/backup3 | \
110+ $TAR -C $topdir/backup3 -xivf -

Subscribers

People subscribed via source and target branches

to all changes: