Merge lp:~percona-dev/percona-xtrabackup/bug387587 into lp:percona-xtrabackup/2.0

Proposed by Alexey Kopytov
Status: Merged
Approved by: Valentine Gostev
Approved revision: no longer in the source branch.
Merged at revision: 258
Proposed branch: lp:~percona-dev/percona-xtrabackup/bug387587
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 265 lines (+101/-23)
6 files modified
patches/tar4ibd_libtar-1.2.11.patch (+30/-14)
test/inc/common.sh (+13/-6)
test/t/bug606981.sh (+1/-1)
test/t/bug723318.sh (+1/-1)
test/t/tar4ibd_symlink.sh (+55/-0)
test/t/xb_stream.sh (+1/-1)
To merge this branch: bzr merge lp:~percona-dev/percona-xtrabackup/bug387587
Reviewer Review Type Date Requested Status
Valentine Gostev (community) qa Approve
Stewart Smith code review Pending
Percona developers Pending
Review via email: mp+62320@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stewart Smith (stewart) wrote :

On Wed, 25 May 2011 15:05:58 -0000, Alexey Kopytov <email address hidden> wrote:
> Alexey Kopytov has proposed merging lp:~percona-dev/percona-xtrabackup/bug387587 into lp:percona-xtrabackup.

I also want this for 1.6.1 - which we need to create tree on lp
for. (based on 1.6 tree)

--
Stewart Smith

Revision history for this message
Valentine Gostev (longbow) wrote :

Looks fine

review: Approve (qa)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'patches/tar4ibd_libtar-1.2.11.patch'
2--- patches/tar4ibd_libtar-1.2.11.patch 2011-03-15 21:58:13 +0000
3+++ patches/tar4ibd_libtar-1.2.11.patch 2011-05-25 15:05:40 +0000
4@@ -1,5 +1,6 @@
5---- a/lib/Makefile.in 2011-02-21 08:15:39.000000000 -0800
6-+++ b/lib/Makefile.in 2011-02-23 06:43:36.000000000 -0800
7+diff -ruN a/lib/Makefile.in b/lib/Makefile.in
8+--- a/lib/Makefile.in 2011-05-25 16:46:41.000000000 +0400
9++++ b/lib/Makefile.in 2011-05-25 16:47:54.000000000 +0400
10 @@ -29,7 +29,7 @@
11 -I${top_srcdir}/compat \
12 -I../listhash \
13@@ -9,8 +10,9 @@
14 LDFLAGS = @LDFLAGS@
15 LIBS = @LIBS@
16 LIBOBJS = @LIBOBJS@
17---- a/lib/append.c 2011-02-21 08:15:39.000000000 -0800
18-+++ b/lib/append.c 2011-02-23 21:31:20.000000000 -0800
19+diff -ruN a/lib/append.c b/lib/append.c
20+--- a/lib/append.c 2011-05-25 16:46:41.000000000 +0400
21++++ b/lib/append.c 2011-05-25 17:42:25.000000000 +0400
22 @@ -27,6 +27,218 @@
23 # include <unistd.h>
24 #endif
25@@ -230,6 +232,15 @@
26
27 struct tar_dev
28 {
29+@@ -69,7 +281,7 @@
30+ (savename ? savename : "[NULL]"));
31+ #endif
32+
33+- if (lstat(realname, &s) != 0)
34++ if (stat(realname, &s) != 0)
35+ {
36+ #ifdef DEBUG
37+ perror("lstat()");
38 @@ -210,11 +422,14 @@
39 int
40 tar_append_regfile(TAR *t, char *realname)
41@@ -324,8 +335,9 @@
42 }
43
44 close(filefd);
45---- a/lib/extract.c 2011-02-21 08:15:39.000000000 -0800
46-+++ b/lib/extract.c 2011-02-21 08:17:37.000000000 -0800
47+diff -ruN a/lib/extract.c b/lib/extract.c
48+--- a/lib/extract.c 2011-05-25 16:46:41.000000000 +0400
49++++ b/lib/extract.c 2011-05-25 16:47:54.000000000 +0400
50 @@ -158,11 +158,11 @@
51 tar_extract_regfile(TAR *t, char *realname)
52 {
53@@ -340,8 +352,9 @@
54 char buf[T_BLOCKSIZE];
55 char *filename;
56
57---- a/lib/libtar.h 2011-02-21 08:15:39.000000000 -0800
58-+++ b/lib/libtar.h 2011-02-21 08:17:37.000000000 -0800
59+diff -ruN a/lib/libtar.h b/lib/libtar.h
60+--- a/lib/libtar.h 2011-05-25 16:46:41.000000000 +0400
61++++ b/lib/libtar.h 2011-05-25 16:47:54.000000000 +0400
62 @@ -180,7 +180,7 @@
63
64 /* decode tar header info */
65@@ -381,8 +394,9 @@
66
67
68 /***** wrapper.c **********************************************************/
69---- a/lib/util.c 2011-02-21 08:15:39.000000000 -0800
70-+++ b/lib/util.c 2011-02-21 08:17:37.000000000 -0800
71+diff -ruN a/lib/util.c b/lib/util.c
72+--- a/lib/util.c 2011-05-25 16:46:41.000000000 +0400
73++++ b/lib/util.c 2011-05-25 16:47:54.000000000 +0400
74 @@ -138,6 +138,14 @@
75 return i;
76 }
77@@ -445,8 +459,9 @@
78 + }
79 + return i;
80 +}
81---- a/libtar/Makefile.in 2011-02-21 08:15:39.000000000 -0800
82-+++ b/libtar/Makefile.in 2011-02-23 06:44:41.000000000 -0800
83+diff -ruN a/libtar/Makefile.in b/libtar/Makefile.in
84+--- a/libtar/Makefile.in 2011-05-25 16:46:41.000000000 +0400
85++++ b/libtar/Makefile.in 2011-05-25 16:47:54.000000000 +0400
86 @@ -29,7 +29,7 @@
87 -I${top_srcdir}/lib \
88 -I${top_srcdir}/compat \
89@@ -482,8 +497,9 @@
90 - ${INSTALL_PROGRAM} libtar ${DESTDIR}${bindir}
91 + ${INSTALL_PROGRAM} tar4ibd ${DESTDIR}${bindir}
92
93---- a/libtar/libtar.c 2011-02-21 08:15:39.000000000 -0800
94-+++ b/libtar/libtar.c 2011-02-23 06:56:56.000000000 -0800
95+diff -ruN a/libtar/libtar.c b/libtar/libtar.c
96+--- a/libtar/libtar.c 2011-05-25 16:46:41.000000000 +0400
97++++ b/libtar/libtar.c 2011-05-25 16:47:54.000000000 +0400
98 @@ -14,6 +14,7 @@
99 #include <libtar.h>
100
101
102=== modified file 'test/inc/common.sh'
103--- test/inc/common.sh 2011-04-15 18:38:43 +0000
104+++ test/inc/common.sh 2011-05-25 15:05:40 +0000
105@@ -6,6 +6,13 @@
106 mysql_port="3306"
107 mysql_socket=${mysql_socket:-"/tmp/xtrabackup.mysql.sock"}
108
109+if gnutar --version > /dev/null 2>&1
110+then
111+ TAR=gnutar
112+else
113+ TAR=tar
114+fi
115+
116 OUTFILE=results/`basename $0`_innobackupex.out
117
118 function vlog
119@@ -64,9 +71,9 @@
120 MYSQL_INSTALL_DB=mysql_install_db
121 MYSQL_ARGS="--no-defaults --socket=${mysql_socket} --user=root"
122 MYSQLD=mysqld
123- MYSQL_BASEDIR="/usr"
124+ MYSQL_BASEDIR=${MYSQL_BASEDIR:-"/usr"}
125 MYSQLD_ARGS="--no-defaults --basedir=${MYSQL_BASEDIR} --socket=${mysql_socket} --datadir=$mysql_datadir"
126- IB_BIN="innobackupex --defaults-file=$topdir/my.cnf"
127+ IB_BIN="innobackupex --defaults-file=$topdir/my.cnf --user=root"
128 XB_BIN=xtrabackup
129 ;;
130 5.0)
131@@ -82,7 +89,7 @@
132 MYSQL_BASEDIR=$topdir/mysql-$version
133 MYSQLD_ARGS="--no-defaults --basedir=${MYSQL_BASEDIR} --socket=${mysql_socket} --datadir=$mysql_datadir"
134 MYSQL_ARGS="--no-defaults --socket=${mysql_socket} --user=root"
135- IB_BIN="innobackupex --defaults-file=$topdir/my.cnf"
136+ IB_BIN="innobackupex --defaults-file=$topdir/my.cnf --user=root"
137 XB_BIN=xtrabackup_51
138 cd -
139 ;;
140@@ -99,7 +106,7 @@
141 MYSQL_BASEDIR=$topdir/mysql-$version
142 MYSQLD_ARGS="--no-defaults --basedir=${MYSQL_BASEDIR} --socket=${mysql_socket} --datadir=$mysql_datadir"
143 MYSQL_ARGS="--no-defaults --socket=${mysql_socket} --user=root"
144- IB_BIN="innobackupex --defaults-file=$topdir/my.cnf"
145+ IB_BIN="innobackupex --defaults-file=$topdir/my.cnf --user=root"
146 XB_BIN=xtrabackup
147 cd -
148 ;;
149@@ -116,7 +123,7 @@
150 MYSQL_BASEDIR=$topdir/mysql-$version
151 MYSQLD_ARGS="--no-defaults --basedir=${MYSQL_BASEDIR} --socket=${mysql_socket} --datadir=$mysql_datadir"
152 MYSQL_ARGS="--no-defaults --socket=${mysql_socket} --user=root"
153- IB_BIN="innobackupex --defaults-file=$topdir/my.cnf"
154+ IB_BIN="innobackupex --defaults-file=$topdir/my.cnf --user=root"
155 XB_BIN=xtrabackup_55
156 cd -
157 ;;
158@@ -136,7 +143,7 @@
159 set +u
160 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$topdir/Percona-Server-$version/lib/mysql
161 set -u
162- IB_BIN="innobackupex --defaults-file=$topdir/my.cnf"
163+ IB_BIN="innobackupex --defaults-file=$topdir/my.cnf --user=root"
164 XB_BIN=xtrabackup
165
166 cd -
167
168=== modified file 'test/t/bug606981.sh'
169--- test/t/bug606981.sh 2011-02-24 05:43:22 +0000
170+++ test/t/bug606981.sh 2011-05-25 15:05:40 +0000
171@@ -29,7 +29,7 @@
172 vlog "Applying log"
173 backup_dir=$topdir/backup
174 cd $backup_dir
175-tar -ixvf out.tar
176+$TAR -ixvf out.tar
177 cd - >/dev/null 2>&1
178 run_cmd innobackupex --apply-log --defaults-file=$topdir/my.cnf $backup_dir
179 vlog "Restoring MySQL datadir"
180
181=== modified file 'test/t/bug723318.sh'
182--- test/t/bug723318.sh 2011-04-17 23:40:32 +0000
183+++ test/t/bug723318.sh 2011-05-25 15:05:40 +0000
184@@ -12,7 +12,7 @@
185
186 stop_mysqld
187 cd $topdir/backup/stream/
188-tar -ixvf out.tar
189+$TAR -ixvf out.tar
190
191 if [ -f $topdir/backup/stream/xtrabackup_binary ]
192 then
193
194=== added file 'test/t/tar4ibd_symlink.sh'
195--- test/t/tar4ibd_symlink.sh 1970-01-01 00:00:00 +0000
196+++ test/t/tar4ibd_symlink.sh 2011-05-25 15:05:40 +0000
197@@ -0,0 +1,55 @@
198+########################################################################
199+# Tests for tar4ibd + symlinks (bug #387587)
200+########################################################################
201+
202+. inc/common.sh
203+
204+init
205+run_mysqld --innodb_file_per_table
206+load_dbase_schema sakila
207+load_dbase_data sakila
208+
209+# Copy some .ibd files to a temporary location and replace them with symlinks
210+
211+mv $topdir/mysql/sakila/actor.ibd $topdir
212+ln -s $topdir/actor.ibd $topdir/mysql/sakila
213+
214+mv $topdir/mysql/sakila/customer.ibd $topdir
215+ln -s $topdir/customer.ibd $topdir/customer_link.ibd
216+ln -s $topdir/customer_link.ibd $topdir/mysql/sakila/customer.ibd
217+
218+# Take backup
219+mkdir -p $topdir/backup
220+run_cmd ${IB_BIN} --socket=$mysql_socket --stream=tar $topdir/backup > $topdir/backup/out.tar 2> $OUTFILE
221+
222+stop_mysqld
223+
224+# Remove datadir
225+rm -r $mysql_datadir
226+
227+# Remove the temporary files referenced by symlinks
228+rm -f $topdir/actor.ibd
229+rm -f $topdir/customer.ibd
230+rm -f $topdir/customer_link.ibd
231+
232+# Restore sakila
233+vlog "Applying log"
234+backup_dir=$topdir/backup
235+cd $backup_dir
236+$TAR -ixvf out.tar
237+cd - >/dev/null 2>&1
238+
239+run_cmd ${IB_BIN} --apply-log $backup_dir >> $OUTFILE 2>&1
240+
241+vlog "Restoring MySQL datadir"
242+mkdir -p $mysql_datadir
243+
244+run_cmd ${IB_BIN} --copy-back $backup_dir >> $OUTFILE 2>&1
245+
246+run_mysqld
247+
248+# Check sakila
249+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT COUNT(*) FROM actor" sakila
250+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT COUNT(*) FROM customer" sakila
251+stop_mysqld
252+clean
253
254=== modified file 'test/t/xb_stream.sh'
255--- test/t/xb_stream.sh 2011-04-15 18:38:43 +0000
256+++ test/t/xb_stream.sh 2011-05-25 15:05:40 +0000
257@@ -16,7 +16,7 @@
258 vlog "Applying log"
259 backup_dir=$topdir/backup
260 cd $backup_dir
261-tar -ixvf out.tar
262+$TAR -ixvf out.tar
263 cd - >/dev/null 2>&1
264 echo "###########" >> $OUTFILE
265 echo "# PREPARE #" >> $OUTFILE

Subscribers

People subscribed via source and target branches