Merge lp:~laurynas-biveinis/percona-xtrabackup/bug1098498-1132763-2.1 into lp:percona-xtrabackup/2.1

Proposed by Laurynas Biveinis
Status: Superseded
Proposed branch: lp:~laurynas-biveinis/percona-xtrabackup/bug1098498-1132763-2.1
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 450 lines (+58/-201)
14 files modified
test/inc/common.sh (+23/-19)
test/inc/ib_part.sh (+16/-2)
test/t/bug766033.sh (+1/-1)
test/t/bug766607.sh (+9/-12)
test/t/ib_part_databases.sh (+2/-0)
test/t/ib_part_include.sh (+1/-4)
test/t/ib_part_include_stream.sh (+1/-1)
test/t/ib_part_tf_innodb.sh (+1/-0)
test/t/ib_part_tf_innodb_stream.sh (+1/-0)
test/t/ib_part_tf_myisam.sh (+1/-0)
test/t/xb_export.sh (+1/-1)
test/t/xb_incremental.sh (+0/-106)
test/t/xb_partial.sh (+0/-53)
test/testrun.sh (+1/-2)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-xtrabackup/bug1098498-1132763-2.1
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Needs Fixing
George Ormond Lorch III (community) g2 Approve
Review via email: mp+151544@code.launchpad.net

This proposal supersedes a proposal from 2013-02-25.

This proposal has been superseded by a proposal from 2013-03-07.

Description of the change

Take 2:
http://jenkins.percona.com/job/percona-xtrabackup-2.1-param/187/
Simple merge from 2.0.

Take 1:
No BT or ST but prerequisite for BT 28340 merge.

Merge bug 1098498 and bug 1132763 fix from 2.0.
Replace stop_server() with kill_server() in the relevant 2.1-only
testcases.

http://jenkins.percona.com/job/percona-xtrabackup-2.1-param/183/

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) : Posted in a previous version of this proposal
review: Approve (g2)
Revision history for this message
Alexey Kopytov (akopytov) wrote : Posted in a previous version of this proposal

Same comments as in the 2.0 MP.

review: Needs Fixing
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Actual BT 28340.

Revision history for this message
George Ormond Lorch III (gl-az) :
review: Approve (g2)
Revision history for this message
Alexey Kopytov (akopytov) wrote :

See the 2.0 MP.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'test/inc/common.sh'
--- test/inc/common.sh 2013-01-15 06:14:23 +0000
+++ test/inc/common.sh 2013-03-07 11:47:22 +0000
@@ -283,28 +283,22 @@
283}283}
284284
285########################################################################285########################################################################
286# Stop server with the id specified as the first argument and additional286# Stop server with the id specified as the first argument. The server
287# command line arguments (if specified)287# is stopped in the fastest possible way.
288########################################################################288########################################################################
289function stop_server_with_id()289function stop_server_with_id()
290{290{
291 local id=$1291 local id=$1
292 switch_server $id292 switch_server $id
293293
294 vlog "Stopping server with id=$id..."294 vlog "Killing server with id=$id..."
295295
296 if [ -f "${MYSQLD_PIDFILE}" ]296 if [ -f "${MYSQLD_PIDFILE}" ]
297 then297 then
298 ${MYSQLADMIN} ${MYSQL_ARGS} --shutdown-timeout=60 shutdown298 kill -9 `cat ${MYSQLD_PIDFILE}`
299 if [ -f "${MYSQLD_PIDFILE}" ]299 rm -f ${MYSQLD_PIDFILE}
300 then
301 vlog "Could not stop the server with id=$id, using kill -9"
302 kill -9 `cat ${MYSQLD_PIDFILE}`
303 rm -f ${MYSQLD_PIDFILE}
304 fi
305 vlog "Server with id=$id has been stopped"
306 else300 else
307 vlog "Server pid file '${MYSQLD_PIDFILE}' doesn't exist!"301 vlog "Server PID file '${MYSQLD_PIDFILE}' doesn't exist!"
308 fi302 fi
309303
310 # unlock the port number304 # unlock the port number
@@ -331,15 +325,25 @@
331}325}
332326
333########################################################################327########################################################################
334# Stop all running servers328# Shutdown server with id=1 cleanly
335########################################################################329########################################################################
336function stop_all_servers()330function shutdown_server()
337{331{
338 local id332 switch_server 1
339 for id in ${SRV_MYSQLD_IDS[*]}333
340 do334 vlog "Shutting down server with id=1..."
341 stop_server_with_id ${SRV_MYSQLD_IDS[$id]}335
342 done336 if [ -f "${MYSQLD_PIDFILE}" ]
337 then
338 ${MYSQLADMIN} ${MYSQL_ARGS} shutdown
339 else
340 vlog "Server PID file '${MYSQLD_PIDFILE}' doesn't exist!"
341 fi
342
343 # unlock the port number
344 free_reserved_port $MYSQLD_PORT
345
346 reset_server_variables 1
343}347}
344348
345########################################################################349########################################################################
346350
=== modified file 'test/inc/ib_part.sh'
--- test/inc/ib_part.sh 2013-01-02 15:52:13 +0000
+++ test/inc/ib_part.sh 2013-03-07 11:47:22 +0000
@@ -56,18 +56,32 @@
56 ib_part_data $topdir $engine | run_cmd $MYSQL $MYSQL_ARGS test56 ib_part_data $topdir $engine | run_cmd $MYSQL $MYSQL_ARGS test
57}57}
5858
59function ib_part_add_mandatory_tables()
60{
61 local mysql_datadir=$1
62 local tables_file=$2
63 for table in $mysql_datadir/mysql/*.frm
64 do
65 echo mysql.`basename $table` >> $tables_file
66 done
67 for table in $mysql_datadir/performance_schema/*.frm
68 do
69 echo performance_schema.`basename $table` >> $tables_file
70 done
71}
72
59function ib_part_restore()73function ib_part_restore()
60{74{
61 topdir=$175 topdir=$1
62 mysql_datadir=$276 mysql_datadir=$2
6377
64 # Remove database78 # Remove database
65 rm -rf $mysql_datadir/test/*79 rm -rf $mysql_datadir/*
66 rm -rf $topdir/ext/*80 rm -rf $topdir/ext/*
67 vlog "Original database removed"81 vlog "Original database removed"
6882
69 # Restore database from backup83 # Restore database from backup
70 cp -rv $topdir/backup/test/* $mysql_datadir/test84 cp -rv $topdir/backup/* $mysql_datadir
71 vlog "database restored from backup"85 vlog "database restored from backup"
7286
73}87}
7488
=== modified file 'test/t/bug766033.sh'
--- test/t/bug766033.sh 2012-06-05 17:32:17 +0000
+++ test/t/bug766033.sh 2013-03-07 11:47:22 +0000
@@ -13,7 +13,7 @@
13vlog "Starting backup"13vlog "Starting backup"
1414
15# corrupt database15# corrupt database
16dd if=/dev/zero of=$mysql_datadir/sakila/rental.ibd seek=1000 count=16384 bs=1 \16printf '\xAA\xAA\xAA\xAA' | dd of=$mysql_datadir/sakila/rental.ibd seek=16384 count=4 bs=1 \
17 conv=notrunc17 conv=notrunc
1818
19# we want xtrabackup to be failed on rental.ibd19# we want xtrabackup to be failed on rental.ibd
2020
=== modified file 'test/t/bug766607.sh'
--- test/t/bug766607.sh 2012-06-05 12:35:33 +0000
+++ test/t/bug766607.sh 2013-03-07 11:47:22 +0000
@@ -3,12 +3,10 @@
3start_server --innodb_file_per_table3start_server --innodb_file_per_table
4load_dbase_schema incremental_sample4load_dbase_schema incremental_sample
55
6# Full backup dir6# Backup dir
7mkdir -p $topdir/data/full7mkdir -p $topdir/backup
8# Incremental backup dir
9mkdir -p $topdir/data/delta
108
11xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/data/full9innobackupex --no-timestamp $topdir/backup/full
1210
13vlog "Creating and filling a new table"11vlog "Creating and filling a new table"
14run_cmd $MYSQL $MYSQL_ARGS test <<EOF12run_cmd $MYSQL $MYSQL_ARGS test <<EOF
@@ -21,26 +19,25 @@
21start_server --innodb_file_per_table19start_server --innodb_file_per_table
2220
23vlog "Making incremental backup"21vlog "Making incremental backup"
24xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/data/delta --incremental-basedir=$topdir/data/full22innobackupex --incremental --no-timestamp --incremental-basedir=$topdir/backup/full $topdir/backup/delta
2523
26vlog "Preparing full backup"24vlog "Preparing full backup"
27xtrabackup --datadir=$mysql_datadir --prepare --apply-log-only \25innobackupex --apply-log --redo-only $topdir/backup/full
28 --target-dir=$topdir/data/full
2926
30# The following would fail before the bugfix27# The following would fail before the bugfix
31vlog "Applying incremental delta"28vlog "Applying incremental delta"
32xtrabackup --datadir=$mysql_datadir --prepare --apply-log-only \29innobackupex --apply-log --redo-only --incremental-dir=$topdir/backup/delta $topdir/backup/full
33 --target-dir=$topdir/data/full --incremental-dir=$topdir/data/delta
3430
35vlog "Preparing full backup"31vlog "Preparing full backup"
36xtrabackup --datadir=$mysql_datadir --prepare --target-dir=$topdir/data/full32innobackupex --apply-log $topdir/backup/full
37vlog "Data prepared for restore"33vlog "Data prepared for restore"
3834
39stop_server35stop_server
36rm -r $mysql_datadir/*
4037
41vlog "Copying files"38vlog "Copying files"
4239
43cd $topdir/data/full/40cd $topdir/backup/full/
44cp -r * $mysql_datadir41cp -r * $mysql_datadir
45cd $topdir42cd $topdir
4643
4744
=== modified file 'test/t/ib_part_databases.sh'
--- test/t/ib_part_databases.sh 2013-01-02 15:52:13 +0000
+++ test/t/ib_part_databases.sh 2013-03-07 11:47:22 +0000
@@ -22,6 +22,8 @@
2222
23# Take a backup23# Take a backup
24cat >$topdir/databases_file <<EOF24cat >$topdir/databases_file <<EOF
25mysql
26performance_schema
25test.test27test.test
26EOF28EOF
27innobackupex --no-timestamp --databases=$topdir/databases_file $topdir/backup29innobackupex --no-timestamp --databases=$topdir/databases_file $topdir/backup
2830
=== modified file 'test/t/ib_part_include.sh'
--- test/t/ib_part_include.sh 2013-01-02 15:52:13 +0000
+++ test/t/ib_part_include.sh 2013-03-07 11:47:22 +0000
@@ -21,10 +21,7 @@
2121
22# Take a backup22# Take a backup
23# Only backup of test.test table will be taken23# Only backup of test.test table will be taken
24cat >$topdir/tables <<EOF24innobackupex --no-timestamp --include='^(mysql.*|performance_schema.*|test.test)$' $topdir/backup
25test.test
26EOF
27innobackupex --no-timestamp --include='test.test$' $topdir/backup
28innobackupex --apply-log $topdir/backup25innobackupex --apply-log $topdir/backup
29vlog "Backup taken"26vlog "Backup taken"
3027
3128
=== modified file 'test/t/ib_part_include_stream.sh'
--- test/t/ib_part_include_stream.sh 2013-01-02 15:52:13 +0000
+++ test/t/ib_part_include_stream.sh 2013-03-07 11:47:22 +0000
@@ -21,7 +21,7 @@
2121
22# Take a backup22# Take a backup
23mkdir -p $topdir/backup23mkdir -p $topdir/backup
24innobackupex --stream=tar --include='test.test$' $topdir/backup > $topdir/backup/backup.tar24innobackupex --stream=tar --include='^(mysql.*|performance_schema.*|test.test)$' $topdir/backup > $topdir/backup/backup.tar
25$TAR ixvf $topdir/backup/backup.tar -C $topdir/backup 25$TAR ixvf $topdir/backup/backup.tar -C $topdir/backup
26$TAR cvhf $topdir/backup/backup11.tar $mysql_datadir/test/*26$TAR cvhf $topdir/backup/backup11.tar $mysql_datadir/test/*
2727
2828
=== modified file 'test/t/ib_part_tf_innodb.sh'
--- test/t/ib_part_tf_innodb.sh 2013-01-02 15:52:13 +0000
+++ test/t/ib_part_tf_innodb.sh 2013-03-07 11:47:22 +0000
@@ -24,6 +24,7 @@
24cat >$topdir/tables <<EOF24cat >$topdir/tables <<EOF
25test.test25test.test
26EOF26EOF
27ib_part_add_mandatory_tables $mysql_datadir $topdir/tables
27innobackupex --no-timestamp --tables-file=$topdir/tables $topdir/backup28innobackupex --no-timestamp --tables-file=$topdir/tables $topdir/backup
28innobackupex --apply-log $topdir/backup29innobackupex --apply-log $topdir/backup
29vlog "Backup taken"30vlog "Backup taken"
3031
=== modified file 'test/t/ib_part_tf_innodb_stream.sh'
--- test/t/ib_part_tf_innodb_stream.sh 2013-01-02 15:52:13 +0000
+++ test/t/ib_part_tf_innodb_stream.sh 2013-03-07 11:47:22 +0000
@@ -24,6 +24,7 @@
24cat >$topdir/tables <<EOF24cat >$topdir/tables <<EOF
25test.test25test.test
26EOF26EOF
27ib_part_add_mandatory_tables $mysql_datadir $topdir/tables
27mkdir -p $topdir/backup28mkdir -p $topdir/backup
28innobackupex --stream=tar --no-timestamp --tables-file=$topdir/tables $topdir/backup > $topdir/backup/backup.tar29innobackupex --stream=tar --no-timestamp --tables-file=$topdir/tables $topdir/backup > $topdir/backup/backup.tar
29$TAR ixvf $topdir/backup/backup.tar -C $topdir/backup 30$TAR ixvf $topdir/backup/backup.tar -C $topdir/backup
3031
=== modified file 'test/t/ib_part_tf_myisam.sh'
--- test/t/ib_part_tf_myisam.sh 2013-01-02 15:52:13 +0000
+++ test/t/ib_part_tf_myisam.sh 2013-03-07 11:47:22 +0000
@@ -25,6 +25,7 @@
25cat >$topdir/tables <<EOF25cat >$topdir/tables <<EOF
26test.test26test.test
27EOF27EOF
28ib_part_add_mandatory_tables $mysql_datadir $topdir/tables
28innobackupex --no-timestamp --tables-file=$topdir/tables $topdir/backup29innobackupex --no-timestamp --tables-file=$topdir/tables $topdir/backup
29innobackupex --apply-log $topdir/backup30innobackupex --apply-log $topdir/backup
30vlog "Backup taken"31vlog "Backup taken"
3132
=== modified file 'test/t/xb_export.sh'
--- test/t/xb_export.sh 2012-10-15 16:14:59 +0000
+++ test/t/xb_export.sh 2013-03-07 11:47:22 +0000
@@ -88,7 +88,7 @@
88# consistent backup results. Otherwise we risk ending up with no test.ibd88# consistent backup results. Otherwise we risk ending up with no test.ibd
89# in the backup in case importing has not finished before taking backup89# in the backup in case importing has not finished before taking backup
9090
91stop_server91shutdown_server
92start_server $mysql_extra_args92start_server $mysql_extra_args
9393
94# Some testing queries94# Some testing queries
9595
=== removed file 'test/t/xb_incremental.sh'
--- test/t/xb_incremental.sh 2012-10-15 16:14:59 +0000
+++ test/t/xb_incremental.sh 1970-01-01 00:00:00 +0000
@@ -1,106 +0,0 @@
1. inc/common.sh
2
3start_server --innodb_file_per_table
4
5load_dbase_schema incremental_sample
6
7# Adding 10k rows
8
9vlog "Adding initial rows to database..."
10
11numrow=100
12count=0
13while [ "$numrow" -gt "$count" ]
14do
15 ${MYSQL} ${MYSQL_ARGS} -e "insert into test values ($count, $numrow);" incremental_sample
16 let "count=count+1"
17done
18
19
20vlog "Initial rows added"
21
22# Full backup
23
24# Full backup folder
25mkdir -p $topdir/data/full
26# Incremental data
27mkdir -p $topdir/data/delta
28
29vlog "Starting backup"
30
31xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/data/full
32
33vlog "Full backup done"
34
35# Changing data in sakila
36
37vlog "Making changes to database"
38
39${MYSQL} ${MYSQL_ARGS} -e "create table t2 (a int(11) default null, number int(11) default null) engine=innodb" incremental_sample
40let "count=numrow+1"
41let "numrow=1000"
42while [ "$numrow" -gt "$count" ]
43do
44 ${MYSQL} ${MYSQL_ARGS} -e "insert into test values ($count, $numrow);" incremental_sample
45 ${MYSQL} ${MYSQL_ARGS} -e "insert into t2 values ($count, $numrow);" incremental_sample
46 let "count=count+1"
47done
48
49vlog "Changes done"
50
51# Saving the checksum of original table
52checksum_test_a=`checksum_table incremental_sample test`
53checksum_t2_a=`checksum_table incremental_sample t2`
54
55vlog "Table 'test' checksum is $checksum_test_a"
56vlog "Table 't2' checksum is $checksum_t2_a"
57vlog "Making incremental backup"
58
59# Incremental backup
60xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/data/delta --incremental-basedir=$topdir/data/full
61
62vlog "Incremental backup done"
63vlog "Preparing backup"
64
65# Prepare backup
66xtrabackup --datadir=$mysql_datadir --prepare --apply-log-only \
67 --target-dir=$topdir/data/full
68vlog "Log applied to backup"
69xtrabackup --datadir=$mysql_datadir --prepare --apply-log-only \
70 --target-dir=$topdir/data/full --incremental-dir=$topdir/data/delta
71vlog "Delta applied to backup"
72xtrabackup --datadir=$mysql_datadir --prepare --target-dir=$topdir/data/full
73vlog "Data prepared for restore"
74
75# removing rows
76run_cmd ${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample
77run_cmd ${MYSQL} ${MYSQL_ARGS} -e "delete from t2;" incremental_sample
78vlog "Tables cleared"
79
80# Restore backup
81stop_server
82vlog "Copying files"
83cd $topdir/data/full/
84cp -r * $mysql_datadir
85cd $topdir
86
87vlog "Data restored"
88start_server --innodb_file_per_table
89
90vlog "Checking checksums"
91checksum_test_b=`checksum_table incremental_sample test`
92checksum_t2_b=`checksum_table incremental_sample t2`
93
94if [ "$checksum_test_a" != "$checksum_test_b" ]
95then
96 vlog "Checksums of table 'test' are not equal"
97 exit -1
98fi
99
100if [ "$checksum_t2_a" != "$checksum_t2_b" ]
101then
102 vlog "Checksums of table 't2' are not equal"
103 exit -1
104fi
105
106vlog "Checksums are OK"
1070
=== removed file 'test/t/xb_partial.sh'
--- test/t/xb_partial.sh 2012-10-15 16:14:59 +0000
+++ test/t/xb_partial.sh 1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
1. inc/common.sh
2
3start_server --innodb_file_per_table
4
5load_dbase_schema incremental_sample
6
7# Adding 10k rows
8vlog "Adding initial rows to database..."
9numrow=1000
10count=0
11while [ "$numrow" -gt "$count" ]
12do
13 ${MYSQL} ${MYSQL_ARGS} -e "insert into test values ($count, $numrow);" incremental_sample
14 let "count=count+1"
15done
16vlog "Initial rows added"
17checksum_a=`checksum_table incremental_sample test`
18vlog "Table checksum is $checksum_a"
19
20# Backup directory
21mkdir -p $topdir/data/parted
22
23vlog "Starting backup"
24xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/data/parted \
25 --tables="^incremental_sample[.]test"
26vlog "Partial backup done"
27
28# Prepare backup
29xtrabackup --datadir=$mysql_datadir --prepare --target-dir=$topdir/data/parted
30vlog "Data prepared for restore"
31
32# removing rows
33run_cmd ${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample
34vlog "Table cleared"
35
36# Restore backup
37stop_server
38vlog "Copying files"
39cd $topdir/data/parted/
40cp -r * $mysql_datadir
41cd $topdir
42vlog "Data restored"
43start_server --innodb_file_per_table
44vlog "Checking checksums"
45checksum_b=`checksum_table incremental_sample test`
46
47if [ "$checksum_a" != "$checksum_b" ]
48then
49 vlog "Checksums are not equal"
50 exit -1
51fi
52
53vlog "Checksums are OK"
540
=== modified file 'test/testrun.sh'
--- test/testrun.sh 2013-01-14 11:02:59 +0000
+++ test/testrun.sh 2013-03-07 11:47:22 +0000
@@ -170,8 +170,7 @@
170 else170 else
171 XB_BIN="xtrabackup" # InnoDB 5.1 plugin or Percona Server 5.1171 XB_BIN="xtrabackup" # InnoDB 5.1 plugin or Percona Server 5.1
172 fi172 fi
173 elif [ "${MYSQL_VERSION:0:3}" = "5.2" -o173 elif [ "${MYSQL_VERSION:0:3}" = "5.2" -o "${MYSQL_VERSION:0:3}" = "5.3" ]
174 "${MYSQL_VERSION:0:3}" = "5.3"]
175 then174 then
176 XB_BIN="xtrabackup"175 XB_BIN="xtrabackup"
177 elif [ "${MYSQL_VERSION:0:3}" = "5.5" ]176 elif [ "${MYSQL_VERSION:0:3}" = "5.5" ]

Subscribers

People subscribed via source and target branches