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

Proposed by Laurynas Biveinis on 2012-07-31
Status: Merged
Approved by: Stewart Smith on 2012-08-01
Approved revision: 450
Merged at revision: 455
Proposed branch: lp:~laurynas-biveinis/percona-xtrabackup/bug1021249-2.0
Merge into: lp:percona-xtrabackup/2.0
Prerequisite: lp:~laurynas-biveinis/percona-xtrabackup/bug1028949-2.0
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.0
Reviewer Review Type Date Requested Status
Stewart Smith (community) 2012-07-31 Approve on 2012-08-01
Review via email: mp+117383@code.launchpad.net

Description of the Change

Fix bug 1011249 (Incremental backup data page copy is not tested by
any of the incremental backup tests).

The issue is that neither of the incremental backup feature tests
(xb_incremental, ib_incremental, xb_incremental_compressed) apply
enough write workload on the server between the full and incremental
backups to advance the last checkpoint. Thus the incremental backup
then becomes just an additional log copy while the data files stay the
same as they were during the full backup.

Fixed by providing additional write workload between the full and
incremental backups. Also this additional workload creates a new
table to ensure that new tablespaces are handled correctly for
incremental backups.

Jenkins: http://jenkins.percona.com/job/percona-xtrabackup-2.0-param/236/
Issue #16274

To post a comment you must log in.
Stewart Smith (stewart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'test/t/ib_incremental.sh'
2--- test/t/ib_incremental.sh 2012-06-05 12:35:33 +0000
3+++ test/t/ib_incremental.sh 2012-07-31 07:19:24 +0000
4@@ -26,18 +26,22 @@
5 # Changing data
6
7 vlog "Making changes to database"
8+${MYSQL} ${MYSQL_ARGS} -e "create table t2 (a int(11) default null, number int(11) default null) engine=innodb" incremental_sample
9 let "count=numrow+1"
10-let "numrow=500"
11+let "numrow=1000"
12 while [ "$numrow" -gt "$count" ]
13 do
14 ${MYSQL} ${MYSQL_ARGS} -e "insert into test values ($count, $numrow);" incremental_sample
15+ ${MYSQL} ${MYSQL_ARGS} -e "insert into t2 values ($count, $numrow);" incremental_sample
16 let "count=count+1"
17 done
18 vlog "Changes done"
19
20 # Saving the checksum of original table
21-checksum_a=`checksum_table incremental_sample test`
22-vlog "Table checksum is $checksum_a"
23+checksum_test_a=`checksum_table incremental_sample test`
24+checksum_t2_a=`checksum_table incremental_sample t2`
25+vlog "Table 'test' checksum is $checksum_test_a"
26+vlog "Table 't2' checksum is $checksum_t2_a"
27
28 vlog "Making incremental backup"
29
30@@ -86,11 +90,18 @@
31 start_server --innodb_file_per_table
32
33 vlog "Checking checksums"
34-checksum_b=`checksum_table incremental_sample test`
35-
36-if [ "$checksum_a" != "$checksum_b" ]
37-then
38- vlog "Checksums are not equal"
39+checksum_test_b=`checksum_table incremental_sample test`
40+checksum_t2_b=`checksum_table incremental_sample t2`
41+
42+if [ "$checksum_test_a" != "$checksum_test_b" ]
43+then
44+ vlog "Checksums for table 'test' are not equal"
45+ exit -1
46+fi
47+
48+if [ "$checksum_t2_a" != "$checksum_t2_b" ]
49+then
50+ vlog "Checksums for table 't2' are not equal"
51 exit -1
52 fi
53
54
55=== modified file 'test/t/xb_incremental.sh'
56--- test/t/xb_incremental.sh 2012-06-05 12:35:33 +0000
57+++ test/t/xb_incremental.sh 2012-07-31 07:19:24 +0000
58@@ -36,20 +36,24 @@
59
60 vlog "Making changes to database"
61
62+${MYSQL} ${MYSQL_ARGS} -e "create table t2 (a int(11) default null, number int(11) default null) engine=innodb" incremental_sample
63 let "count=numrow+1"
64-let "numrow=500"
65+let "numrow=1000"
66 while [ "$numrow" -gt "$count" ]
67 do
68 ${MYSQL} ${MYSQL_ARGS} -e "insert into test values ($count, $numrow);" incremental_sample
69+ ${MYSQL} ${MYSQL_ARGS} -e "insert into t2 values ($count, $numrow);" incremental_sample
70 let "count=count+1"
71 done
72
73 vlog "Changes done"
74
75 # Saving the checksum of original table
76-checksum_a=`checksum_table incremental_sample test`
77+checksum_test_a=`checksum_table incremental_sample test`
78+checksum_t2_a=`checksum_table incremental_sample t2`
79
80-vlog "Table checksum is $checksum_a"
81+vlog "Table 'test' checksum is $checksum_test_a"
82+vlog "Table 't2' checksum is $checksum_t2_a"
83 vlog "Making incremental backup"
84
85 # Incremental backup
86@@ -69,8 +73,9 @@
87 vlog "Data prepared for restore"
88
89 # removing rows
90-vlog "Table cleared"
91 run_cmd ${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample
92+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "delete from t2;" incremental_sample
93+vlog "Tables cleared"
94
95 # Restore backup
96 stop_server
97@@ -83,11 +88,18 @@
98 start_server --innodb_file_per_table
99
100 vlog "Checking checksums"
101-checksum_b=`checksum_table incremental_sample test`
102-
103-if [ "$checksum_a" != "$checksum_b" ]
104-then
105- vlog "Checksums are not equal"
106+checksum_test_b=`checksum_table incremental_sample test`
107+checksum_t2_b=`checksum_table incremental_sample t2`
108+
109+if [ "$checksum_test_a" != "$checksum_test_b" ]
110+then
111+ vlog "Checksums of table 'test' are not equal"
112+ exit -1
113+fi
114+
115+if [ "$checksum_t2_a" != "$checksum_t2_b" ]
116+then
117+ vlog "Checksums of table 't2' are not equal"
118 exit -1
119 fi
120
121
122=== modified file 'test/t/xb_incremental_compressed.sh'
123--- test/t/xb_incremental_compressed.sh 2012-06-05 12:35:33 +0000
124+++ test/t/xb_incremental_compressed.sh 2012-07-31 07:19:24 +0000
125@@ -23,7 +23,8 @@
126 # Use innodb_strict_mode so that failure to use compression results in an
127 # error rather than a warning
128 mysqld_additional_args="--innodb_strict_mode --innodb_file_per_table \
129- --innodb_file_format=Barracuda"
130+ --innodb_file_format=Barracuda --innodb_max_dirty_pages_pct=0 \
131+ --innodb_log_file_size=1M"
132
133 start_server ${mysqld_additional_args}
134
135@@ -71,7 +72,7 @@
136
137 vlog "Starting backup"
138
139- xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/data/full
140+ xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/data/full ${mysqld_additional_args}
141
142 vlog "Full backup done"
143
144@@ -79,56 +80,72 @@
145
146 vlog "Making changes to database"
147
148+ ${MYSQL} ${MYSQL_ARGS} -e "CREATE TABLE t2 (a INT(11) DEFAULT NULL, \
149+number INT(11) DEFAULT NULL) ENGINE=INNODB \
150+ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=$page_size" incremental_sample
151+
152 let "count=numrow+1"
153 let "numrow=15000"
154 while [ "$numrow" -gt "$count" ]; do
155- sql="INSERT INTO test VALUES ($count, $numrow)"
156+ sql="VALUES ($count, $numrow)"
157 let "count=count+1"
158 for ((i=0; $i<99; i++)); do
159 sql="${sql},($count, $numrow)"
160 let "count=count+1"
161 done
162- ${MYSQL} ${MYSQL_ARGS} -e "$sql" incremental_sample
163+ ${MYSQL} ${MYSQL_ARGS} -e "INSERT INTO test $sql" incremental_sample
164+ ${MYSQL} ${MYSQL_ARGS} -e "INSERT INTO t2 $sql" incremental_sample
165 done
166
167 rows=`${MYSQL} ${MYSQL_ARGS} -Ns -e "SELECT COUNT(*) FROM test" \
168 incremental_sample`
169 if [ "$rows" != "15000" ]; then
170- vlog "Failed to add more rows"
171+ vlog "Failed to add more rows to 'test'"
172 exit -1
173 fi
174
175+ rows=`${MYSQL} ${MYSQL_ARGS} -Ns -e "SELECT COUNT(*) FROM t2" \
176+incremental_sample`
177+ if [ "$rows" != "5000" ]; then
178+ vlog "Failed to add more rows to 't2'"
179+ exit -1
180+ fi
181+
182 vlog "Changes done"
183
184 # Saving the checksum of original table
185- checksum_a=`checksum_table incremental_sample test`
186+ checksum_test_a=`checksum_table incremental_sample test`
187+ checksum_t2_a=`checksum_table incremental_sample t2`
188
189- vlog "Table checksum is $checksum_a"
190+ vlog "Table 'test' checksum is $checksum_test_a"
191+ vlog "Table 't2' checksum is $checksum_t2_a"
192
193 vlog "Making incremental backup"
194
195 # Incremental backup
196 xtrabackup --datadir=$mysql_datadir --backup \
197- --target-dir=$topdir/data/delta --incremental-basedir=$topdir/data/full
198+ --target-dir=$topdir/data/delta --incremental-basedir=$topdir/data/full \
199+ ${mysqld_additional_args}
200
201 vlog "Incremental backup done"
202 vlog "Preparing backup"
203
204 # Prepare backup
205 xtrabackup --datadir=$mysql_datadir --prepare \
206- --apply-log-only --target-dir=$topdir/data/full
207+ --apply-log-only --target-dir=$topdir/data/full ${mysqld_additional_args}
208 vlog "Log applied to backup"
209 xtrabackup --datadir=$mysql_datadir --prepare \
210 --apply-log-only --target-dir=$topdir/data/full \
211- --incremental-dir=$topdir/data/delta
212+ --incremental-dir=$topdir/data/delta ${mysqld_additional_args}
213 vlog "Delta applied to backup"
214 xtrabackup --datadir=$mysql_datadir --prepare \
215- --target-dir=$topdir/data/full
216+ --target-dir=$topdir/data/full ${mysqld_additional_args}
217 vlog "Data prepared for restore"
218
219 # removing rows
220- vlog "Table cleared"
221 ${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample
222+ ${MYSQL} ${MYSQL_ARGS} -e "delete from t2;" incremental_sample
223+ vlog "Tables cleared"
224
225 # Restore backup
226
227@@ -144,12 +161,19 @@
228
229 start_server ${mysqld_additional_args}
230
231- vlog "Cheking checksums"
232- checksum_b=`checksum_table incremental_sample test`
233-
234- if [ "$checksum_a" != "$checksum_b" ]
235- then
236- vlog "Checksums are not equal"
237+ vlog "Checking checksums"
238+ checksum_test_b=`checksum_table incremental_sample test`
239+ checksum_t2_b=`checksum_table incremental_sample t2`
240+
241+ if [ "$checksum_test_a" != "$checksum_test_b" ]
242+ then
243+ vlog "Checksums of table 'test' are not equal"
244+ exit -1
245+ fi
246+
247+ if [ "$checksum_t2_a" != "$checksum_t2_b" ]
248+ then
249+ vlog "Checksums of table 't2' are not equal"
250 exit -1
251 fi
252

Subscribers

People subscribed via source and target branches