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

Proposed by Valentine Gostev
Status: Merged
Approved by: Vadim Tkachenko
Approved revision: no longer in the source branch.
Merged at revision: 229
Proposed branch: lp:~percona-dev/percona-xtrabackup/ib_csm_csv
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 700 lines (+208/-107)
11 files modified
innobackupex (+7/-7)
test/inc/common.sh (+15/-0)
test/t/ib_csm_csv.sh (+63/-0)
test/t/ib_include.sh (+46/-0)
test/t/ib_incremental.sh (+12/-16)
test/t/ib_specialchar.sh (+13/-13)
test/t/xb_basic.sh (+12/-12)
test/t/xb_incremental.sh (+9/-15)
test/t/xb_parallel.sh (+14/-14)
test/t/xb_partial.sh (+5/-19)
test/t/xb_stream.sh (+12/-11)
To merge this branch: bzr merge lp:~percona-dev/percona-xtrabackup/ib_csm_csv
Reviewer Review Type Date Requested Status
Vadim Tkachenko Approve
Alexey Kopytov (community) Approve
Review via email: mp+52290@code.launchpad.net

This proposal supersedes a proposal from 2011-02-21.

Description of the change

1. Added fix for bug 420181
2. Added test for bug 420181
3. Added test for bug 597384

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote : Posted in a previous version of this proposal
Download full text (8.9 KiB)

Hi Valentine,

Some comments on the patch:

On 18.02.11 23:20, Valentine Gostev wrote:
> Valentine Gostev has proposed merging lp:~percona-dev/percona-xtrabackup/ib_csm_csv into lp:percona-xtrabackup.
>
> Requested reviews:
> Vadim Tkachenko (vadim-tk)
> Alexey Kopytov (akopytov)
> Related bugs:
> #420181 innobackupex fails to backup CSV tables causing mysql_upgrade to fail
> https://bugs.launchpad.net/bugs/420181
> #597384 innobackupex --include does not apply to the non-InnoDB tables
> https://bugs.launchpad.net/bugs/597384
>
> For more details, see:
> https://code.launchpad.net/~percona-dev/percona-xtrabackup/ib_csm_csv/+merge/50390
>
> 1. Added fix for bug 420181
> 2. Added test for bug 420181
> 3. Added test for bug 597384

>
> === modified file 'innobackupex'
> --- innobackupex 2011-02-12 06:14:27 +0000
> +++ innobackupex 2011-02-18 20:19:33 +0000
> @@ -322,7 +322,7 @@
> command makes a complete backup of all MyISAM and InnoDB tables and
> indexes in all databases or in all of the databases specified with the
> --databases option. The created backup contains .frm, .MRG, .MYD,
> -.MYI, .TRG, .TRN, .ARM, .ARZ, .opt, .par, and InnoDB data and log files.
> +.MYI, .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV, .opt, .par, and InnoDB data and log files.
> The MY.CNF options file defines the location of the database. This command
> connects to the MySQL server using mysql client program, and runs
> ibbackup (InnoDB Hot Backup program) as a child process.
> @@ -599,7 +599,7 @@
>
> }
>
> - # backup .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ and .opt files
> + # backup .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV and .opt files
> backup_files();
>
> # resume ibbackup and wait till it has finished
> @@ -775,7 +775,7 @@
> opendir(DIR, $backup_dir)
> || Die "Can't open directory '$backup_dir': $!\n";
> print STDERR "$prefix Starting to copy MyISAM tables, indexes,\n";
> - print STDERR "$prefix .MRG, .TRG, .TRN, .ARM, .ARZ, .opt, and .frm files\n";
> + print STDERR "$prefix .MRG, .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV, .opt, and .frm files\n";
> print STDERR "$prefix in '$backup_dir'\n";
> print STDERR "$prefix back to original data directory '$orig_datadir'\n";
> while (defined($file = readdir(DIR))) {
> @@ -2009,13 +2009,13 @@
> my @list;
> my $file;
> my $database;
> - my $wildcard = '*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,opt,par}';
> + my $wildcard = '*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}';
>
> opendir(DIR, $source_dir)
> || Die "Can't open directory '$source_dir': $!\n";
> $now = current_time();
> print STDERR "\n$now $prefix Starting to backup .frm, .MRG, .MYD, .MYI,\n";
> - print STDERR "$prefix .TRG, .TRN, .ARM, .ARZ and .opt files in\n";
> + print STDERR "$prefix .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV and .opt files in\n";
> print STDERR "$prefix subdirectories of '$source_dir'\n";
> # loop through all database directories
> while (defined($database = readdir(DIR))) {
> @@ -2042,7 +2042,7 @@
>
> # copy files of this database
> opendir(DBDIR, "$source_dir/$dat...

Read more...

Revision history for this message
Alexey Kopytov (akopytov) : Posted in a previous version of this proposal
review: Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) wrote : Posted in a previous version of this proposal

Hi Valentine,

Thanks for doing some cleanups. Some comments on a few minor issues:

On 21.02.11 12:36, Valentine Gostev wrote:
> === added file 'test/t/ib_csm_csv.sh'
> --- test/t/ib_csm_csv.sh 1970-01-01 00:00:00 +0000
> +++ test/t/ib_csm_csv.sh 2011-02-21 09:36:29 +0000
> @@ -0,0 +1,60 @@
> +. inc/common.sh
> +OUTFILE=results/ib_csm_csv_innobackupex.out

Why not use the same `basename $0` method as used in other tests? Better
yet, why not move this definition into inc/common.sh and solve this
problem once and for all?

> +init
> +run_mysqld --innodb_file_per_table
> +run_cmd ${MYSQL} ${MYSQL_ARGS} -e "create database csv"
> +run_cmd ${MYSQL} ${MYSQL_ARGS} -e "create table csm (a int NOT NULL ) ENGINE=CSV" csv
> +# Adding initial rows
> +vlog "Adding initial rows to database..."
> +numrow=100
> +count=0
> +while [ "$numrow" -gt "$count" ]
> +do
> + ${MYSQL} ${MYSQL_ARGS} -e "insert into csm values ($count);" csv
> + let "count=count+1"
> +done
> +vlog "Initial rows added"
> +
> +# Full backup
> +# backup root directory
> +mkdir -p $topdir/backup
> +
> +vlog "Starting backup"
> +run_cmd ${IB_BIN} --user=root --socket=$mysql_socket $topdir/backup > $OUTFILE 2>&1 || die "innobackupex died with exit code $?"

You don't need to check the return code if you use run_cmd. The same
applies to many other lines in the patch.

Also, I wonder what was the reason for mass blank line removal in this
patch. For example:

> @@ -50,42 +50,37 @@
> checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`
>
> vlog "Table checksum is $checksum_a"
> -
> vlog "Making incremental backup"
>

or

> # Restore backup
> -
> stop_mysqld
> -
> vlog "Copying files"
> -
> cd $topdir/data/full/
> cp -r * $mysql_datadir
> cd $topdir
>
> vlog "Data restored"
> -
> -run_mysqld
> -

or

> @@ -95,6 +90,5 @@
> fi
>
> vlog "Checksums are OK"
> -
> stop_mysqld
> clean
>

or

> # Adding 10k rows
> -
> vlog "Adding initial rows to database..."
> -
> numrow=1000
> count=0
> while [ "$numrow" -gt "$count" ]
> @@ -15,45 +13,34 @@
> ${MYSQL} ${MYSQL_ARGS} -e "insert into test values ($count, $numrow);" incremental_sample
> let "count=count+1"
> done
> -
> -
> vlog "Initial rows added"
> -
> checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`
> vlog "Table checksum is $checksum_a"

or

>
> # Restore backup
> -
> stop_mysqld
> -
> vlog "Copying files"
> -
> cd $topdir/data/parted/
> cp -r * $mysql_datadir
> cd $topdir
> -
> vlog "Data restored"
> -
> run_mysqld --innodb_file_per_table
> -

or

> vlog "Checksums are OK"
> -
> stop_mysqld
> clean
>

Revision history for this message
Alexey Kopytov (akopytov) : Posted in a previous version of this proposal
review: Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve
Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

good for me

review: Approve
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Valentine,

As it turns out this MP breaks innobackupex tests when they are run as a non-root user:

110315 00:06:19 innobackupex: Starting to lock all tables...
innobackupex: Error: mysql child process has died: ERROR 1044 (42000) at line 3: Access denied for user ''@'localhost' to database 'mysql'
 while waiting for reply to MySQL request: 'USE mysql;' at /.../percona-xtrabackup/innobackupex line 565.
2011-03-15 00:06:21: xb_parallel.sh: ===> innobackupex failed with exit code 0

I think the reason for it is that you forgot '--user=root' in the IB_BIN definition.

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Also, ib_include.sh fails for me like as follows:

mysqld: Table 'mysql.plugin' doesn't exist
110315 0:21:50 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
110315 0:21:50 InnoDB: Initializing buffer pool, size = 128.0M
110315 0:21:50 InnoDB: Completed initialization of buffer pool
110315 0:21:50 InnoDB: highest supported file format is Barracuda.
110315 0:21:50 Percona XtraDB (http://www.percona.com) 1.0.14-12.5 started; log sequence number 47116
110315 0:21:50 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
110315 0:21:50 [Note] Got signal 15 to shutdown mysqld
2011-03-15 00:23:31: ib_include.sh: Can't run MySQL!
2011-03-15 00:23:31: ib_include.sh: Exit on error

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

Alexey,

Regarding ib_include.sh - it is still an open question. https://bugs.launchpad.net/percona-xtrabackup/+bug/723110

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Valentine,

So right now we have 2 tests in the test suite which are known to be broken. What's even worse, they were known to be broken even before they were pushed. That doesn't look right to me. Generally, a test case should not be pushed if it doesn't pass.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innobackupex'
2--- innobackupex 2011-02-24 05:43:22 +0000
3+++ innobackupex 2011-03-05 08:23:01 +0000
4@@ -322,7 +322,7 @@
5 command makes a complete backup of all MyISAM and InnoDB tables and
6 indexes in all databases or in all of the databases specified with the
7 --databases option. The created backup contains .frm, .MRG, .MYD,
8-.MYI, .TRG, .TRN, .ARM, .ARZ, .opt, .par, and InnoDB data and log files.
9+.MYI, .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV, .opt, .par, and InnoDB data and log files.
10 The MY.CNF options file defines the location of the database. This command
11 connects to the MySQL server using mysql client program, and runs
12 ibbackup (InnoDB Hot Backup program) as a child process.
13@@ -599,7 +599,7 @@
14
15 }
16
17- # backup .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ and .opt files
18+ # backup .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV and .opt files
19 backup_files();
20
21 # resume ibbackup and wait till it has finished
22@@ -775,7 +775,7 @@
23 opendir(DIR, $backup_dir)
24 || Die "Can't open directory '$backup_dir': $!\n";
25 print STDERR "$prefix Starting to copy MyISAM tables, indexes,\n";
26- print STDERR "$prefix .MRG, .TRG, .TRN, .ARM, .ARZ, .opt, and .frm files\n";
27+ print STDERR "$prefix .MRG, .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV, .opt, and .frm files\n";
28 print STDERR "$prefix in '$backup_dir'\n";
29 print STDERR "$prefix back to original data directory '$orig_datadir'\n";
30 while (defined($file = readdir(DIR))) {
31@@ -2020,13 +2020,13 @@
32 my @list;
33 my $file;
34 my $database;
35- my $wildcard = '*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,opt,par}';
36+ my $wildcard = '*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}';
37
38 opendir(DIR, $source_dir)
39 || Die "Can't open directory '$source_dir': $!\n";
40 $now = current_time();
41 print STDERR "\n$now $prefix Starting to backup .frm, .MRG, .MYD, .MYI,\n";
42- print STDERR "$prefix .TRG, .TRN, .ARM, .ARZ and .opt files in\n";
43+ print STDERR "$prefix .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV and .opt files in\n";
44 print STDERR "$prefix subdirectories of '$source_dir'\n";
45 # loop through all database directories
46 while (defined($database = readdir(DIR))) {
47@@ -2053,7 +2053,7 @@
48
49 # copy files of this database
50 opendir(DBDIR, "$source_dir/$database");
51- @list = grep(/\.(frm)|(MYD)|(MYI)|(MRG)|(TRG)|(TRN)|(ARM)|(ARZ)|(opt)|(par)$/, readdir(DBDIR));
52+ @list = grep(/\.(frm)|(MYD)|(MYI)|(MRG)|(TRG)|(TRN)|(ARM)|(ARZ)|(CSM)|(CSV)|(opt)|(par)$/, readdir(DBDIR));
53 closedir DBDIR;
54 $file_c = @list;
55 if ($file_c <= $backup_file_print_limit) {
56@@ -2109,7 +2109,7 @@
57 closedir(DIR);
58
59 $now = current_time();
60- print STDERR "$now $prefix Finished backing up .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ and .opt files\n\n";
61+ print STDERR "$now $prefix Finished backing up .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ, .CSV, .CSM and .opt files\n\n";
62 }
63
64
65
66=== modified file 'test/inc/common.sh'
67--- test/inc/common.sh 2011-03-01 16:59:27 +0000
68+++ test/inc/common.sh 2011-03-05 08:23:01 +0000
69@@ -6,6 +6,8 @@
70 mysql_port="3306"
71 mysql_socket="/tmp/xtrabackup.mysql.sock"
72
73+OUTFILE=results/`basename $0`_innobackupex.out
74+
75 function vlog
76 {
77 echo "`date +"%F %T"`: `basename "$0"`: $@"
78@@ -55,6 +57,8 @@
79 MYSQLD=mysqld
80 MYSQL_BASEDIR="/usr"
81 MYSQLD_ARGS="--no-defaults --basedir=${MYSQL_BASEDIR} --socket=${mysql_socket} --datadir=$mysql_datadir"
82+ IB_BIN="innobackupex --defaults-file=$topdir/my.cnf"
83+ XB_BIN=xtrabackup
84 ;;
85 5.0)
86 echo "Using MySQL 5.0"
87@@ -69,6 +73,8 @@
88 MYSQL_BASEDIR=$topdir/mysql-$version
89 MYSQLD_ARGS="--no-defaults --basedir=${MYSQL_BASEDIR} --socket=${mysql_socket} --datadir=$mysql_datadir"
90 MYSQL_ARGS="--no-defaults --socket=${mysql_socket} --user=root"
91+ IB_BIN="innobackupex --defaults-file=$topdir/my.cnf"
92+ XB_BIN=xtrabackup_51
93 cd -
94 ;;
95 5.1)
96@@ -84,6 +90,8 @@
97 MYSQL_BASEDIR=$topdir/mysql-$version
98 MYSQLD_ARGS="--no-defaults --basedir=${MYSQL_BASEDIR} --socket=${mysql_socket} --datadir=$mysql_datadir"
99 MYSQL_ARGS="--no-defaults --socket=${mysql_socket} --user=root"
100+ IB_BIN="innobackupex --defaults-file=$topdir/my.cnf"
101+ XB_BIN=xtrabackup
102 cd -
103 ;;
104 5.5)
105@@ -99,6 +107,8 @@
106 MYSQL_BASEDIR=$topdir/mysql-$version
107 MYSQLD_ARGS="--no-defaults --basedir=${MYSQL_BASEDIR} --socket=${mysql_socket} --datadir=$mysql_datadir"
108 MYSQL_ARGS="--no-defaults --socket=${mysql_socket} --user=root"
109+ IB_BIN="innobackupex --defaults-file=$topdir/my.cnf"
110+ XB_BIN=xtrabackup_55
111 cd -
112 ;;
113 percona)
114@@ -117,6 +127,8 @@
115 set +u
116 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$topdir/Percona-Server-$version/lib/mysql
117 set -u
118+ IB_BIN="innobackupex --defaults-file=$topdir/my.cnf"
119+ XB_BIN=xtrabackup
120
121 cd -
122 ;;
123@@ -236,6 +248,9 @@
124 init_mysql
125 init_mysql_dir
126 set_mysl_port
127+echo "
128+[mysqld]
129+datadir=$mysql_datadir" > $topdir/my.cnf
130 }
131
132 function race_create_drop()
133
134=== added file 'test/t/ib_csm_csv.sh'
135--- test/t/ib_csm_csv.sh 1970-01-01 00:00:00 +0000
136+++ test/t/ib_csm_csv.sh 2011-03-05 08:23:01 +0000
137@@ -0,0 +1,63 @@
138+. inc/common.sh
139+
140+init
141+run_mysqld --innodb_file_per_table
142+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "create database csv"
143+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "create table csm (a int NOT NULL ) ENGINE=CSV" csv
144+# Adding initial rows
145+vlog "Adding initial rows to database..."
146+numrow=100
147+count=0
148+while [ "$numrow" -gt "$count" ]
149+do
150+ ${MYSQL} ${MYSQL_ARGS} -e "insert into csm values ($count);" csv
151+ let "count=count+1"
152+done
153+vlog "Initial rows added"
154+
155+# Full backup
156+# backup root directory
157+mkdir -p $topdir/backup
158+
159+vlog "Starting backup"
160+run_cmd ${IB_BIN} --user=root --socket=$mysql_socket $topdir/backup > $OUTFILE 2>&1
161+full_backup_dir=`grep "innobackupex: Backup created in directory" $OUTFILE | awk -F\' '{print $2}'`
162+vlog "Full backup done to directory $full_backup_dir"
163+
164+# Saving the checksum of original table
165+checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table csm;" csv | awk '{print $2}'`
166+vlog "Table checksum is $checksum_a"
167+
168+vlog "Preparing backup"
169+# Prepare backup
170+echo "###########" >> $OUTFILE
171+echo "# PREPARE #" >> $OUTFILE
172+echo "###########" >> $OUTFILE
173+run_cmd ${IB_BIN} --apply-log $full_backup_dir >> $OUTFILE 2>&1
174+vlog "Data prepared for restore"
175+
176+# Destroying mysql data
177+stop_mysqld
178+rm -rf $mysql_datadir/*
179+vlog "Data destroyed"
180+
181+# Restore backup
182+vlog "Copying files"
183+echo "###########" >> $OUTFILE
184+echo "# RESTORE #" >> $OUTFILE
185+echo "###########" >> $OUTFILE
186+run_cmd ${IB_BIN} --copy-back $full_backup_dir >> $OUTFILE 2>&1
187+vlog "Data restored"
188+
189+run_mysqld --innodb_file_per_table
190+vlog "Checking checksums"
191+checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table csm" incremental_sample | awk '{print $2}'`
192+
193+if [ $checksum_a -ne $checksum_b ]
194+then
195+ vlog "Checksums are not equal"
196+ exit -1
197+fi
198+vlog "Checksums are OK"
199+stop_mysqld
200+clean
201
202=== added file 'test/t/ib_include.sh'
203--- test/t/ib_include.sh 1970-01-01 00:00:00 +0000
204+++ test/t/ib_include.sh 2011-03-05 08:23:01 +0000
205@@ -0,0 +1,46 @@
206+. inc/common.sh
207+
208+init
209+run_mysqld
210+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "create database include;"
211+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "create table t1 (a int) ENGINE=MyISAM;" include
212+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "create table t2 (a int) ENGINE=InnoDB;" include
213+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "insert into t1 values (1),(2),(3);" include
214+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "insert into t2 values (1),(2),(3);" include
215+# Take backup
216+mkdir -p $topdir/backup
217+checksum_t1=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table t1" include | awk '{print $2}'`
218+checksum_t2=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table t2" include | awk '{print $2}'`
219+vlog "checksum_t1 is $checksum_t1"
220+vlog "checksum_t2 is $checksum_t2"
221+run_cmd ${IB_BIN} --user=root --socket=$mysql_socket --include="^include[.]t" $topdir/backup > $OUTFILE 2>&1
222+backup_dir=`grep "innobackupex: Backup created in directory" $OUTFILE | awk -F\' '{ print $2}'`
223+stop_mysqld
224+# Remove datadir
225+rm -r $mysql_datadir
226+# Restore data
227+vlog "Applying log"
228+echo "###########" >> $OUTFILE
229+echo "# PREPARE #" >> $OUTFILE
230+echo "###########" >> $OUTFILE
231+run_cmd ${IB_BIN} --apply-log $backup_dir >> $OUTFILE 2>&1
232+vlog "Restoring MySQL datadir"
233+mkdir -p $mysql_datadir
234+echo "###########" >> $OUTFILE
235+echo "# RESTORE #" >> $OUTFILE
236+echo "###########" >> $OUTFILE
237+run_cmd ${IB_BIN} --copy-back $backup_dir >> $OUTFILE 2>&1
238+run_mysqld
239+checksum_tt1=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table t1" include | awk '{print $2}'`
240+checksum_tt2=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table t2" include | awk '{print $2}'`
241+vlog "checksum_tt1 is $checksum_tt1"
242+vlog "checksum_tt2 is $checksum_tt2"
243+if [ (( ($checksum_t2 -eq $checksum_tt2) || ($checksum_t1 -eq $checksum_tt1) )) ]
244+then
245+ vlog "Checksums are OK"
246+else
247+ vlog "Checksums are not equal"
248+ exit -1
249+fi
250+stop_mysqld
251+clean
252
253=== modified file 'test/t/ib_incremental.sh'
254--- test/t/ib_incremental.sh 2011-02-13 18:28:08 +0000
255+++ test/t/ib_incremental.sh 2011-03-05 08:23:01 +0000
256@@ -1,16 +1,9 @@
257 . inc/common.sh
258
259-OUTFILE=results/ib_incremental_innobackupex.out
260-
261 init
262 run_mysqld --innodb_file_per_table
263 load_dbase_schema incremental_sample
264
265-# creating my.cnf for innobackupex
266-echo "
267-[mysqld]
268-datadir=$mysql_datadir" > $topdir/my.cnf
269-
270 # Adding initial rows
271 vlog "Adding initial rows to database..."
272 numrow=100
273@@ -27,9 +20,9 @@
274 mkdir -p $topdir/backup
275
276 vlog "Starting backup"
277-innobackupex --user=root --socket=$mysql_socket --defaults-file=$topdir/my.cnf $topdir/backup > $OUTFILE 2>&1 || die "innobackupex died with exit code $?"
278+run_cmd ${IB_BIN} --user=root --socket=$mysql_socket $topdir/backup > $OUTFILE 2>&1
279 full_backup_dir=`grep "innobackupex: Backup created in directory" $OUTFILE | awk -F\' '{print $2}'`
280-vlog "Full backup done to folder $full_backup_dir"
281+vlog "Full backup done to directory $full_backup_dir"
282
283 # Changing data
284
285@@ -54,26 +47,26 @@
286 echo "###############" >> $OUTFILE
287
288 # Incremental backup
289-innobackupex --user=root --socket=$mysql_socket --defaults-file=$topdir/my.cnf --incremental --incremental-basedir=$full_backup_dir $topdir/backup >> $OUTFILE 2>&1 || die "innobackupex died with exit code $?"
290+run_cmd ${IB_BIN} --socket=$mysql_socket --incremental --incremental-basedir=$full_backup_dir $topdir/backup >> $OUTFILE 2>&1
291 inc_backup_dir=`grep "innobackupex: Backup created in directory" $OUTFILE | tail -n 1 | awk -F\' '{print $2}'`
292-vlog "Incremental backup done to filder $inc_backup_dir"
293+vlog "Incremental backup done to directory $inc_backup_dir"
294
295 vlog "Preparing backup"
296 # Prepare backup
297 echo "##############" >> $OUTFILE
298 echo "# PREPARE #1 #" >> $OUTFILE
299 echo "##############" >> $OUTFILE
300-innobackupex --defaults-file=$topdir/my.cnf --apply-log --redo-only $full_backup_dir >> $OUTFILE 2>&1 || die "innobackupex died with exit code $?"
301+run_cmd ${IB_BIN} --apply-log --redo-only $full_backup_dir >> $OUTFILE 2>&1
302 vlog "Log applied to full backup"
303 echo "##############" >> $OUTFILE
304 echo "# PREPARE #2 #" >> $OUTFILE
305 echo "##############" >> $OUTFILE
306-innobackupex --defaults-file=$topdir/my.cnf --apply-log --redo-only --incremental-dir=$inc_backup_dir $full_backup_dir >> $OUTFILE 2>&1 || die "innobackupex died with exit code $?"
307+run_cmd ${IB_BIN} --apply-log --redo-only --incremental-dir=$inc_backup_dir $full_backup_dir >> $OUTFILE 2>&1
308 vlog "Delta applied to full backup"
309 echo "##############" >> $OUTFILE
310 echo "# PREPARE #3 #" >> $OUTFILE
311 echo "##############" >> $OUTFILE
312-innobackupex --defaults-file=$topdir/my.cnf --apply-log $full_backup_dir >> $OUTFILE 2>&1 || die "innobackupex died with exit code $?"
313+run_cmd ${IB_BIN} --apply-log $full_backup_dir >> $OUTFILE 2>&1
314 vlog "Data prepared for restore"
315
316 # Destroying mysql data
317@@ -83,12 +76,15 @@
318
319 # Restore backup
320 vlog "Copying files"
321-run_cmd innobackupex --defaults-file=$topdir/my.cnf --copy-back $full_backup_dir
322+echo "###########" >> $OUTFILE
323+echo "# RESTORE #" >> $OUTFILE
324+echo "###########" >> $OUTFILE
325+run_cmd ${IB_BIN} --copy-back $full_backup_dir >> $OUTFILE 2>&1
326 vlog "Data restored"
327
328 run_mysqld --innodb_file_per_table
329
330-vlog "Cheking checksums"
331+vlog "Checking checksums"
332 checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`
333
334 if [ $checksum_a -ne $checksum_b ]
335
336=== modified file 'test/t/ib_specialchar.sh'
337--- test/t/ib_specialchar.sh 2011-01-02 03:52:58 +0000
338+++ test/t/ib_specialchar.sh 2011-03-05 08:23:01 +0000
339@@ -1,7 +1,5 @@
340 . inc/common.sh
341
342-OUTFILE=results/xb_basic_innobackupex_out
343-
344 init
345 run_mysqld
346 load_dbase_schema sakila
347@@ -10,20 +8,16 @@
348 PASSWD="123&123"
349 vlog "Password is $PASSWD"
350
351-# Take backup
352-echo "
353-[mysqld]
354-datadir=$mysql_datadir" > $topdir/my.cnf
355 mkdir -p $topdir/backup
356
357-${MYSQLADMIN} ${MYSQL_ARGS} password '$PASSWD'
358+run_cmd ${MYSQLADMIN} ${MYSQL_ARGS} password '$PASSWD'
359 vlog "mysql password has been changed to contain special char"
360
361 vlog "Starting innobackupex wrapper"
362-innobackupex-1.5.1 --user=root --password='$PASSWD' --socket=$mysql_socket --defaults-file=$topdir/my.cnf $topdir/backup > $OUTFILE 2>&1 || die "innobackupex-1.5.1 died with exit code $?"
363-backup_dir=`grep "innobackupex-1.5.1: Backup created in directory" $OUTFILE | awk -F\' '{ print $2}'`
364+run_cmd ${IB_BIN} --user=root --password='$PASSWD' --socket=$mysql_socket $topdir/backup > $OUTFILE 2>&1
365+backup_dir=`grep "innobackupex: Backup created in directory" $OUTFILE | awk -F\' '{ print $2}'`
366
367-${MYSQLADMIN} ${MYSQL_ARGS} -p'$PASSWD' password ''
368+run_cmd ${MYSQLADMIN} ${MYSQL_ARGS} -p'$PASSWD' password ''
369
370 vlog "Stopping database server"
371 stop_mysqld
372@@ -32,18 +26,24 @@
373 rm -r $mysql_datadir
374 # Restore sakila
375 vlog "Applying log"
376-innobackupex-1.5.1 --apply-log --defaults-file=$topdir/my.cnf $backup_dir
377+echo "###########" >> $OUTFILE
378+echo "# PREPARE #" >> $OUTFILE
379+echo "###########" >> $OUTFILE
380+run_cmd ${IB_BIN} --apply-log $backup_dir >> $OUTFILE 2>&1
381 vlog "Restoring MySQL datadir"
382 mkdir -p $mysql_datadir
383 vlog "Performing copyback"
384-innobackupex-1.5.1 --copy-back --defaults-file=$topdir/my.cnf $backup_dir
385+echo "###########" >> $OUTFILE
386+echo "# PREPARE #" >> $OUTFILE
387+echo "###########" >> $OUTFILE
388+run_cmd ${IB_BIN} --copy-back $backup_dir >> $OUTFILE 2>&1
389
390 vlog "Starting database server"
391 # using --skip-grant-tables to override root password restored from backup
392 run_mysqld --skip-grant-tables
393 vlog "Database server started"
394 # Check sakila
395-${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila
396+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila
397 vlog "Stopping database server"
398 stop_mysqld
399 clean
400
401=== modified file 'test/t/xb_basic.sh'
402--- test/t/xb_basic.sh 2010-12-09 09:37:20 +0000
403+++ test/t/xb_basic.sh 2011-03-05 08:23:01 +0000
404@@ -1,20 +1,14 @@
405 . inc/common.sh
406
407-OUTFILE=results/xb_basic_innobackupex_out
408-
409 init
410 run_mysqld
411 load_dbase_schema sakila
412 load_dbase_data sakila
413
414-# Take backup
415-echo "
416-[mysqld]
417-datadir=$mysql_datadir" > $topdir/my.cnf
418 mkdir -p $topdir/backup
419-innobackupex-1.5.1 --user=root --socket=$mysql_socket --defaults-file=$topdir/my.cnf $topdir/backup > $OUTFILE 2>&1 || die "innobackupex-1.5.1 died with exit code $?"
420-backup_dir=`grep "innobackupex-1.5.1: Backup created in directory" $OUTFILE | awk -F\' '{ print $2}'`
421-#echo "Backup dir in $backup_dir"
422+run_cmd ${IB_BIN} --socket=$mysql_socket $topdir/backup > $OUTFILE 2>&1
423+backup_dir=`grep "innobackupex: Backup created in directory" $OUTFILE | awk -F\' '{ print $2}'`
424+vlog "Backup created in directory $backup_dir"
425
426 stop_mysqld
427 # Remove datadir
428@@ -22,13 +16,19 @@
429 #init_mysql_dir
430 # Restore sakila
431 vlog "Applying log"
432-innobackupex-1.5.1 --apply-log --defaults-file=$topdir/my.cnf $backup_dir
433+echo "###########" >> $OUTFILE
434+echo "# PREPARE #" >> $OUTFILE
435+echo "###########" >> $OUTFILE
436+run_cmd ${IB_BIN} --apply-log $backup_dir >> $OUTFILE 2>&1
437 vlog "Restoring MySQL datadir"
438 mkdir -p $mysql_datadir
439-innobackupex-1.5.1 --copy-back --defaults-file=$topdir/my.cnf $backup_dir
440+echo "###########" >> $OUTFILE
441+echo "# RESTORE #" >> $OUTFILE
442+echo "###########" >> $OUTFILE
443+run_cmd ${IB_BIN} --copy-back $backup_dir >> $OUTFILE 2>&1
444
445 run_mysqld
446 # Check sakila
447-${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila
448+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila
449 stop_mysqld
450 clean
451
452=== modified file 'test/t/xb_incremental.sh'
453--- test/t/xb_incremental.sh 2010-12-09 09:37:20 +0000
454+++ test/t/xb_incremental.sh 2011-03-05 08:23:01 +0000
455@@ -28,7 +28,7 @@
456
457 vlog "Starting backup"
458
459-xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/data/full
460+run_cmd ${XB_BIN} --datadir=$mysql_datadir --backup --target-dir=$topdir/data/full
461
462 vlog "Full backup done"
463
464@@ -50,42 +50,37 @@
465 checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`
466
467 vlog "Table checksum is $checksum_a"
468-
469 vlog "Making incremental backup"
470
471 # Incremental backup
472-xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/data/delta --incremental-basedir=$topdir/data/full
473+run_cmd ${XB_BIN} --datadir=$mysql_datadir --backup --target-dir=$topdir/data/delta --incremental-basedir=$topdir/data/full
474
475 vlog "Incremental backup done"
476 vlog "Preparing backup"
477
478 # Prepare backup
479-xtrabackup --datadir=$mysql_datadir --prepare --apply-log-only --target-dir=$topdir/data/full
480+run_cmd ${XB_BIN} --datadir=$mysql_datadir --prepare --apply-log-only --target-dir=$topdir/data/full
481 vlog "Log applied to backup"
482-xtrabackup --datadir=$mysql_datadir --prepare --apply-log-only --target-dir=$topdir/data/full --incremental-dir=$topdir/data/delta
483+run_cmd ${XB_BIN} --datadir=$mysql_datadir --prepare --apply-log-only --target-dir=$topdir/data/full --incremental-dir=$topdir/data/delta
484 vlog "Delta applied to backup"
485-xtrabackup --datadir=$mysql_datadir --prepare --target-dir=$topdir/data/full
486+run_cmd ${XB_BIN} --datadir=$mysql_datadir --prepare --target-dir=$topdir/data/full
487 vlog "Data prepared for restore"
488
489 # removing rows
490 vlog "Table cleared"
491-${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample
492+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample
493
494 # Restore backup
495-
496 stop_mysqld
497-
498 vlog "Copying files"
499-
500 cd $topdir/data/full/
501 cp -r * $mysql_datadir
502 cd $topdir
503
504 vlog "Data restored"
505-
506-run_mysqld
507-
508-vlog "Cheking checksums"
509+run_mysqld --innodb_file_per_table
510+
511+vlog "Checking checksums"
512 checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`
513
514 if [ $checksum_a -ne $checksum_b ]
515@@ -95,6 +90,5 @@
516 fi
517
518 vlog "Checksums are OK"
519-
520 stop_mysqld
521 clean
522
523=== modified file 'test/t/xb_parallel.sh'
524--- test/t/xb_parallel.sh 2010-11-29 17:29:58 +0000
525+++ test/t/xb_parallel.sh 2011-03-05 08:23:01 +0000
526@@ -1,36 +1,36 @@
527 . inc/common.sh
528
529-OUTFILE=results/xb_parallel_innobackupex_out
530-
531 init
532-run_mysqld --innodb_file_per_table
533-load_sakila
534+run_mysqld
535+load_dbase_schema sakila
536+load_dbase_data sakila
537
538 # Take backup
539-echo "
540-[mysqld]
541-datadir=$mysql_datadir" > $topdir/my.cnf
542 vlog "Creating the backup directory: $topdir/backup"
543 mkdir -p $topdir/backup
544-vlog "Running innobackupex-1.5.1 as innobackupex-1.5.1 --user=root --socket=$mysql_socket --defaults-file=$topdir/my.cnf $topdir/backup --parallel=8"
545-innobackupex-1.5.1 --user=root --socket=$mysql_socket --defaults-file=$topdir/my.cnf $topdir/backup --parallel=8 > $OUTFILE 2>&1 || die "innobackupex-1.5.1 died with exit code $?"
546-backup_dir=`grep "innobackupex-1.5.1: Backup created in directory" $OUTFILE | awk -F\' '{ print $2}'`
547+run_cmd ${IB_BIN} --socket=$mysql_socket $topdir/backup --parallel=8 > $OUTFILE 2>&1
548+backup_dir=`grep "innobackupex: Backup created in directory" $OUTFILE | awk -F\' '{ print $2}'`
549
550 #echo "Backup dir in $backup_dir"
551
552 stop_mysqld
553 # Remove datadir
554 rm -r $mysql_datadir
555-#init_mysql_dir
556 # Restore sakila
557 vlog "Applying log"
558-innobackupex-1.5.1 --apply-log --defaults-file=$topdir/my.cnf $backup_dir
559+echo "###########" >> $OUTFILE
560+echo "# PREPARE #" >> $OUTFILE
561+echo "###########" >> $OUTFILE
562+run_cmd ${IB_BIN} --apply-log $backup_dir >> $OUTFILE 2>&1
563 vlog "Restoring MySQL datadir"
564 mkdir -p $mysql_datadir
565-innobackupex-1.5.1 --copy-back --defaults-file=$topdir/my.cnf $backup_dir
566+echo "###########" >> $OUTFILE
567+echo "# RESTORE #" >> $OUTFILE
568+echo "###########" >> $OUTFILE
569+run_cmd ${IB_BIN} --copy-back $backup_dir >> $OUTFILE 2>&1
570
571 run_mysqld
572 # Check sakila
573-${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila
574+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila
575 stop_mysqld
576 clean
577
578=== modified file 'test/t/xb_partial.sh'
579--- test/t/xb_partial.sh 2010-12-09 09:37:20 +0000
580+++ test/t/xb_partial.sh 2011-03-05 08:23:01 +0000
581@@ -5,9 +5,7 @@
582 load_dbase_schema incremental_sample
583
584 # Adding 10k rows
585-
586 vlog "Adding initial rows to database..."
587-
588 numrow=1000
589 count=0
590 while [ "$numrow" -gt "$count" ]
591@@ -15,45 +13,34 @@
592 ${MYSQL} ${MYSQL_ARGS} -e "insert into test values ($count, $numrow);" incremental_sample
593 let "count=count+1"
594 done
595-
596-
597 vlog "Initial rows added"
598-
599 checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`
600 vlog "Table checksum is $checksum_a"
601
602-# Partial backup
603-
604-# Backup folder
605+# Backup directory
606 mkdir -p $topdir/data/parted
607
608 vlog "Starting backup"
609-xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/data/parted --tables="^incremental_sample[.]test"
610+run_cmd ${XB_BIN} --datadir=$mysql_datadir --backup --target-dir=$topdir/data/parted --tables="^incremental_sample[.]test"
611 vlog "Partial backup done"
612
613 # Prepare backup
614-xtrabackup --datadir=$mysql_datadir --prepare --target-dir=$topdir/data/parted
615+run_cmd ${XB_BIN} --datadir=$mysql_datadir --prepare --target-dir=$topdir/data/parted
616 vlog "Data prepared for restore"
617
618 # removing rows
619-${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample
620+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample
621 vlog "Table cleared"
622
623 # Restore backup
624-
625 stop_mysqld
626-
627 vlog "Copying files"
628-
629 cd $topdir/data/parted/
630 cp -r * $mysql_datadir
631 cd $topdir
632-
633 vlog "Data restored"
634-
635 run_mysqld --innodb_file_per_table
636-
637-vlog "Cheking checksums"
638+vlog "Checking checksums"
639 checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`
640
641 if [ $checksum_a -ne $checksum_b ]
642@@ -63,6 +50,5 @@
643 fi
644
645 vlog "Checksums are OK"
646-
647 stop_mysqld
648 clean
649
650=== modified file 'test/t/xb_stream.sh'
651--- test/t/xb_stream.sh 2010-11-29 17:29:58 +0000
652+++ test/t/xb_stream.sh 2011-03-05 08:23:01 +0000
653@@ -1,35 +1,36 @@
654 . inc/common.sh
655
656-OUTFILE=results/xb_stream_innobackupex_out
657-
658 init
659 run_mysqld
660-load_sakila
661+load_dbase_schema sakila
662+load_dbase_data sakila
663
664 # Take backup
665-echo "
666-[mysqld]
667-datadir=$mysql_datadir" > $topdir/my.cnf
668 mkdir -p $topdir/backup
669-innobackupex-1.5.1 --user=root --socket=$mysql_socket --defaults-file=$topdir/my.cnf --stream=tar $topdir/backup > $topdir/backup/out.tar 2> $OUTFILE || die "innobackupex-1.5.1 died with exit code $?"
670+run_cmd ${IB_BIN} --socket=$mysql_socket --stream=tar $topdir/backup > $topdir/backup/out.tar 2> $OUTFILE
671
672 stop_mysqld
673 # Remove datadir
674 rm -r $mysql_datadir
675-#init_mysql_dir
676 # Restore sakila
677 vlog "Applying log"
678 backup_dir=$topdir/backup
679 cd $backup_dir
680 tar -ixvf out.tar
681 cd - >/dev/null 2>&1
682-innobackupex-1.5.1 --apply-log --defaults-file=$topdir/my.cnf $backup_dir
683+echo "###########" >> $OUTFILE
684+echo "# PREPARE #" >> $OUTFILE
685+echo "###########" >> $OUTFILE
686+run_cmd ${IB_BIN} --apply-log $backup_dir >> $OUTFILE 2>&1
687 vlog "Restoring MySQL datadir"
688 mkdir -p $mysql_datadir
689-innobackupex-1.5.1 --copy-back --defaults-file=$topdir/my.cnf $backup_dir
690+echo "###########" >> $OUTFILE
691+echo "# RESTORE #" >> $OUTFILE
692+echo "###########" >> $OUTFILE
693+run_cmd ${IB_BIN} --copy-back $backup_dir >> $OTFILE 2>&1
694
695 run_mysqld
696 # Check sakila
697-${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila
698+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila
699 stop_mysqld
700 clean

Subscribers

People subscribed via source and target branches