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

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 418
Proposed branch: lp:~laurynas-biveinis/percona-xtrabackup/bug1021249-2.1
Merge into: lp:percona-xtrabackup/2.1
Prerequisite: lp:~laurynas-biveinis/percona-xtrabackup/bug1028949-2.1
Diff against target: 251 lines (+82/-35)
3 files modified
test/t/ib_incremental.sh (+19/-8)
test/t/xb_incremental.sh (+21/-9)
test/t/xb_incremental_compressed.sh (+42/-18)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-xtrabackup/bug1021249-2.1
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+117614@code.launchpad.net

Description of the change

Automerge bug 1021249 fix from 2.0

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Setting to approved because the 2.0 fix has been approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'test/t/ib_incremental.sh'
--- test/t/ib_incremental.sh 2012-06-05 12:35:33 +0000
+++ test/t/ib_incremental.sh 2012-08-01 11:11:23 +0000
@@ -26,18 +26,22 @@
26# Changing data26# Changing data
2727
28vlog "Making changes to database"28vlog "Making changes to database"
29${MYSQL} ${MYSQL_ARGS} -e "create table t2 (a int(11) default null, number int(11) default null) engine=innodb" incremental_sample
29let "count=numrow+1"30let "count=numrow+1"
30let "numrow=500"31let "numrow=1000"
31while [ "$numrow" -gt "$count" ]32while [ "$numrow" -gt "$count" ]
32do33do
33 ${MYSQL} ${MYSQL_ARGS} -e "insert into test values ($count, $numrow);" incremental_sample34 ${MYSQL} ${MYSQL_ARGS} -e "insert into test values ($count, $numrow);" incremental_sample
35 ${MYSQL} ${MYSQL_ARGS} -e "insert into t2 values ($count, $numrow);" incremental_sample
34 let "count=count+1"36 let "count=count+1"
35done37done
36vlog "Changes done"38vlog "Changes done"
3739
38# Saving the checksum of original table40# Saving the checksum of original table
39checksum_a=`checksum_table incremental_sample test`41checksum_test_a=`checksum_table incremental_sample test`
40vlog "Table checksum is $checksum_a"42checksum_t2_a=`checksum_table incremental_sample t2`
43vlog "Table 'test' checksum is $checksum_test_a"
44vlog "Table 't2' checksum is $checksum_t2_a"
4145
42vlog "Making incremental backup"46vlog "Making incremental backup"
4347
@@ -86,11 +90,18 @@
86start_server --innodb_file_per_table90start_server --innodb_file_per_table
8791
88vlog "Checking checksums"92vlog "Checking checksums"
89checksum_b=`checksum_table incremental_sample test`93checksum_test_b=`checksum_table incremental_sample test`
9094checksum_t2_b=`checksum_table incremental_sample t2`
91if [ "$checksum_a" != "$checksum_b" ]95
92then 96if [ "$checksum_test_a" != "$checksum_test_b" ]
93 vlog "Checksums are not equal"97then
98 vlog "Checksums for table 'test' are not equal"
99 exit -1
100fi
101
102if [ "$checksum_t2_a" != "$checksum_t2_b" ]
103then
104 vlog "Checksums for table 't2' are not equal"
94 exit -1105 exit -1
95fi106fi
96107
97108
=== modified file 'test/t/xb_incremental.sh'
--- test/t/xb_incremental.sh 2012-06-05 12:35:33 +0000
+++ test/t/xb_incremental.sh 2012-08-01 11:11:23 +0000
@@ -36,20 +36,24 @@
3636
37vlog "Making changes to database"37vlog "Making changes to database"
3838
39${MYSQL} ${MYSQL_ARGS} -e "create table t2 (a int(11) default null, number int(11) default null) engine=innodb" incremental_sample
39let "count=numrow+1"40let "count=numrow+1"
40let "numrow=500"41let "numrow=1000"
41while [ "$numrow" -gt "$count" ]42while [ "$numrow" -gt "$count" ]
42do43do
43 ${MYSQL} ${MYSQL_ARGS} -e "insert into test values ($count, $numrow);" incremental_sample44 ${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
44 let "count=count+1"46 let "count=count+1"
45done47done
4648
47vlog "Changes done"49vlog "Changes done"
4850
49# Saving the checksum of original table51# Saving the checksum of original table
50checksum_a=`checksum_table incremental_sample test`52checksum_test_a=`checksum_table incremental_sample test`
53checksum_t2_a=`checksum_table incremental_sample t2`
5154
52vlog "Table checksum is $checksum_a"55vlog "Table 'test' checksum is $checksum_test_a"
56vlog "Table 't2' checksum is $checksum_t2_a"
53vlog "Making incremental backup"57vlog "Making incremental backup"
5458
55# Incremental backup59# Incremental backup
@@ -69,8 +73,9 @@
69vlog "Data prepared for restore"73vlog "Data prepared for restore"
7074
71# removing rows75# removing rows
72vlog "Table cleared"
73run_cmd ${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample76run_cmd ${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample
77run_cmd ${MYSQL} ${MYSQL_ARGS} -e "delete from t2;" incremental_sample
78vlog "Tables cleared"
7479
75# Restore backup80# Restore backup
76stop_server81stop_server
@@ -83,11 +88,18 @@
83start_server --innodb_file_per_table88start_server --innodb_file_per_table
8489
85vlog "Checking checksums"90vlog "Checking checksums"
86checksum_b=`checksum_table incremental_sample test`91checksum_test_b=`checksum_table incremental_sample test`
8792checksum_t2_b=`checksum_table incremental_sample t2`
88if [ "$checksum_a" != "$checksum_b" ]93
89then 94if [ "$checksum_test_a" != "$checksum_test_b" ]
90 vlog "Checksums are not equal"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"
91 exit -1103 exit -1
92fi104fi
93105
94106
=== modified file 'test/t/xb_incremental_compressed.sh'
--- test/t/xb_incremental_compressed.sh 2012-06-05 12:35:33 +0000
+++ test/t/xb_incremental_compressed.sh 2012-08-01 11:11:23 +0000
@@ -23,7 +23,8 @@
23 # Use innodb_strict_mode so that failure to use compression results in an 23 # Use innodb_strict_mode so that failure to use compression results in an
24 # error rather than a warning24 # error rather than a warning
25 mysqld_additional_args="--innodb_strict_mode --innodb_file_per_table \25 mysqld_additional_args="--innodb_strict_mode --innodb_file_per_table \
26 --innodb_file_format=Barracuda"26 --innodb_file_format=Barracuda --innodb_max_dirty_pages_pct=0 \
27 --innodb_log_file_size=1M"
27 28
28 start_server ${mysqld_additional_args}29 start_server ${mysqld_additional_args}
2930
@@ -71,7 +72,7 @@
7172
72 vlog "Starting backup"73 vlog "Starting backup"
7374
74 xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/data/full75 xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/data/full ${mysqld_additional_args}
7576
76 vlog "Full backup done"77 vlog "Full backup done"
7778
@@ -79,56 +80,72 @@
7980
80 vlog "Making changes to database"81 vlog "Making changes to database"
8182
83 ${MYSQL} ${MYSQL_ARGS} -e "CREATE TABLE t2 (a INT(11) DEFAULT NULL, \
84number INT(11) DEFAULT NULL) ENGINE=INNODB \
85ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=$page_size" incremental_sample
86
82 let "count=numrow+1"87 let "count=numrow+1"
83 let "numrow=15000"88 let "numrow=15000"
84 while [ "$numrow" -gt "$count" ]; do89 while [ "$numrow" -gt "$count" ]; do
85 sql="INSERT INTO test VALUES ($count, $numrow)"90 sql="VALUES ($count, $numrow)"
86 let "count=count+1"91 let "count=count+1"
87 for ((i=0; $i<99; i++)); do92 for ((i=0; $i<99; i++)); do
88 sql="${sql},($count, $numrow)"93 sql="${sql},($count, $numrow)"
89 let "count=count+1"94 let "count=count+1"
90 done95 done
91 ${MYSQL} ${MYSQL_ARGS} -e "$sql" incremental_sample96 ${MYSQL} ${MYSQL_ARGS} -e "INSERT INTO test $sql" incremental_sample
97 ${MYSQL} ${MYSQL_ARGS} -e "INSERT INTO t2 $sql" incremental_sample
92 done98 done
9399
94 rows=`${MYSQL} ${MYSQL_ARGS} -Ns -e "SELECT COUNT(*) FROM test" \100 rows=`${MYSQL} ${MYSQL_ARGS} -Ns -e "SELECT COUNT(*) FROM test" \
95incremental_sample`101incremental_sample`
96 if [ "$rows" != "15000" ]; then102 if [ "$rows" != "15000" ]; then
97 vlog "Failed to add more rows"103 vlog "Failed to add more rows to 'test'"
98 exit -1104 exit -1
99 fi105 fi
100106
107 rows=`${MYSQL} ${MYSQL_ARGS} -Ns -e "SELECT COUNT(*) FROM t2" \
108incremental_sample`
109 if [ "$rows" != "5000" ]; then
110 vlog "Failed to add more rows to 't2'"
111 exit -1
112 fi
113
101 vlog "Changes done"114 vlog "Changes done"
102115
103 # Saving the checksum of original table116 # Saving the checksum of original table
104 checksum_a=`checksum_table incremental_sample test`117 checksum_test_a=`checksum_table incremental_sample test`
118 checksum_t2_a=`checksum_table incremental_sample t2`
105119
106 vlog "Table checksum is $checksum_a"120 vlog "Table 'test' checksum is $checksum_test_a"
121 vlog "Table 't2' checksum is $checksum_t2_a"
107122
108 vlog "Making incremental backup"123 vlog "Making incremental backup"
109124
110 # Incremental backup125 # Incremental backup
111 xtrabackup --datadir=$mysql_datadir --backup \126 xtrabackup --datadir=$mysql_datadir --backup \
112 --target-dir=$topdir/data/delta --incremental-basedir=$topdir/data/full127 --target-dir=$topdir/data/delta --incremental-basedir=$topdir/data/full \
128 ${mysqld_additional_args}
113129
114 vlog "Incremental backup done"130 vlog "Incremental backup done"
115 vlog "Preparing backup"131 vlog "Preparing backup"
116132
117 # Prepare backup133 # Prepare backup
118 xtrabackup --datadir=$mysql_datadir --prepare \134 xtrabackup --datadir=$mysql_datadir --prepare \
119 --apply-log-only --target-dir=$topdir/data/full135 --apply-log-only --target-dir=$topdir/data/full ${mysqld_additional_args}
120 vlog "Log applied to backup"136 vlog "Log applied to backup"
121 xtrabackup --datadir=$mysql_datadir --prepare \137 xtrabackup --datadir=$mysql_datadir --prepare \
122 --apply-log-only --target-dir=$topdir/data/full \138 --apply-log-only --target-dir=$topdir/data/full \
123 --incremental-dir=$topdir/data/delta139 --incremental-dir=$topdir/data/delta ${mysqld_additional_args}
124 vlog "Delta applied to backup"140 vlog "Delta applied to backup"
125 xtrabackup --datadir=$mysql_datadir --prepare \141 xtrabackup --datadir=$mysql_datadir --prepare \
126 --target-dir=$topdir/data/full142 --target-dir=$topdir/data/full ${mysqld_additional_args}
127 vlog "Data prepared for restore"143 vlog "Data prepared for restore"
128144
129 # removing rows145 # removing rows
130 vlog "Table cleared"
131 ${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample146 ${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample
147 ${MYSQL} ${MYSQL_ARGS} -e "delete from t2;" incremental_sample
148 vlog "Tables cleared"
132149
133 # Restore backup150 # Restore backup
134151
@@ -144,12 +161,19 @@
144161
145 start_server ${mysqld_additional_args}162 start_server ${mysqld_additional_args}
146163
147 vlog "Cheking checksums"164 vlog "Checking checksums"
148 checksum_b=`checksum_table incremental_sample test`165 checksum_test_b=`checksum_table incremental_sample test`
149166 checksum_t2_b=`checksum_table incremental_sample t2`
150 if [ "$checksum_a" != "$checksum_b" ]167
151 then 168 if [ "$checksum_test_a" != "$checksum_test_b" ]
152 vlog "Checksums are not equal"169 then
170 vlog "Checksums of table 'test' are not equal"
171 exit -1
172 fi
173
174 if [ "$checksum_t2_a" != "$checksum_t2_b" ]
175 then
176 vlog "Checksums of table 't2' are not equal"
153 exit -1177 exit -1
154 fi178 fi
155179

Subscribers

People subscribed via source and target branches