Merge lp:~akopytov/percona-xtrabackup/innodb_checksum_algorithm-2.0 into lp:percona-xtrabackup/2.0

Proposed by Alexey Kopytov on 2013-11-05
Status: Merged
Approved by: Alexey Kopytov on 2013-11-11
Approved revision: 588
Merged at revision: 588
Proposed branch: lp:~akopytov/percona-xtrabackup/innodb_checksum_algorithm-2.0
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 113 lines (+74/-1)
4 files modified
innobackupex (+1/-0)
src/xtrabackup.cc (+4/-1)
test/t/bug1247586.sh (+16/-0)
test/t/bug1248065.sh (+53/-0)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/innodb_checksum_algorithm-2.0
Reviewer Review Type Date Requested Status
George Ormond Lorch III g2 2013-11-05 Approve on 2013-11-08
Review via email: mp+193910@code.launchpad.net

Description of the change

Bug #1247586: xtrabackup_56 defaults to innodb_checksum_algorithm=crc32

Fixed by changing the default value from 0 to
SRV_CHECKSUM_ALGORITHM_INNODB.

Bug #1248065: innodb_checksum_algorithm should be stored in
backup-my.cnf

Modified both innobackupex and the xtrabackup binary so that
innodb_checksum_algorithm is stored in backup-my.cnf

http://jenkins.percona.com/view/XtraBackup/job/percona-xtrabackup-2.0-param/508/

To post a comment you must log in.
review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innobackupex'
2--- innobackupex 2013-08-30 08:52:03 +0000
3+++ innobackupex 2013-11-05 11:54:45 +0000
4@@ -1935,6 +1935,7 @@
5 }
6
7 my @option_names = (
8+ "innodb_checksum_algorithm",
9 "innodb_data_file_path",
10 "innodb_log_files_in_group",
11 "innodb_log_file_size",
12
13=== modified file 'src/xtrabackup.cc'
14--- src/xtrabackup.cc 2013-08-18 06:53:11 +0000
15+++ src/xtrabackup.cc 2013-11-05 11:54:45 +0000
16@@ -2042,7 +2042,7 @@
17 "The algorithm InnoDB uses for page checksumming. [CRC32, STRICT_CRC32, "
18 "INNODB, STRICT_INNODB, NONE, STRICT_NONE]", &srv_checksum_algorithm,
19 &srv_checksum_algorithm, &innodb_checksum_algorithm_typelib, GET_ENUM,
20- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
21+ REQUIRED_ARG, SRV_CHECKSUM_ALGORITHM_INNODB, 0, 0, 0, 0, 0},
22 {"innodb_undo_directory", OPT_INNODB_UNDO_DIRECTORY,
23 "Directory where undo tablespace files live, this path can be absolute.",
24 (G_PTR*) &srv_undo_dir, (G_PTR*) &srv_undo_dir,
25@@ -8600,6 +8600,9 @@
26 srv_undo_dir);
27 }
28 printf("innodb_undo_tablespaces = %lu\n", srv_undo_tablespaces);
29+ printf("innodb_checksum_algorithm = %s\n",
30+ innodb_checksum_algorithm_names[srv_checksum_algorithm]
31+ );
32 #endif
33 printf("innodb_buffer_pool_filename = \"%s\"\n",
34 innobase_buffer_pool_filename ?
35
36=== added file 'test/t/bug1247586.sh'
37--- test/t/bug1247586.sh 1970-01-01 00:00:00 +0000
38+++ test/t/bug1247586.sh 2013-11-05 11:54:45 +0000
39@@ -0,0 +1,16 @@
40+##########################################################################
41+# Bug #1247586: xtrabackup_56 defaults to innodb_checksum_algorithm=crc32
42+##########################################################################
43+
44+if [ ${MYSQL_VERSION:0:3} != "5.6" ]
45+then
46+ echo "Requires a 5.6 server" > $SKIPPED_REASON
47+ exit $SKIPPED_EXIT_CODE
48+fi
49+
50+if ! xtrabackup --help 2>&1 |
51+ egrep '^innodb-checksum-algorithm[[:space:]]+innodb$'
52+then
53+ die "XtraBackup is using an incorrect default value for \
54+--innodb-checksum-algorithm"
55+fi
56
57=== added file 'test/t/bug1248065.sh'
58--- test/t/bug1248065.sh 1970-01-01 00:00:00 +0000
59+++ test/t/bug1248065.sh 2013-11-05 11:54:45 +0000
60@@ -0,0 +1,53 @@
61+############################################################################
62+# Bug #1248065: innodb_checksum_algorithm should be stored in backup-my.cnf
63+############################################################################
64+
65+if [ ${MYSQL_VERSION:0:3} != "5.6" ]
66+then
67+ echo "Requires a 5.6 server" > $SKIPPED_REASON
68+ exit $SKIPPED_EXIT_CODE
69+fi
70+
71+function test_with_checksum_algo()
72+{
73+ vlog "**************************************"
74+ vlog "Testing with innodb_checksum_algorithm=$1"
75+ vlog "**************************************"
76+
77+ MYSQLD_EXTRA_MY_CNF_OPTS="
78+innodb_checksum_algorithm=$1
79+"
80+
81+ start_server
82+ load_sakila
83+
84+ record_db_state sakila
85+
86+ innobackupex --no-timestamp $topdir/backup
87+
88+ egrep '^innodb_checksum_algorithm='$1'$' $topdir/backup/backup-my.cnf
89+
90+ stop_server
91+ rm -rf $MYSQLD_DATADIR/*
92+
93+ innobackupex --apply-log --defaults-file=$topdir/backup/backup-my.cnf \
94+ $topdir/backup
95+
96+ innobackupex --copy-back $topdir/backup
97+
98+ rm -rf $topdir/backup
99+
100+ start_server
101+
102+ verify_db_state sakila
103+
104+ stop_server
105+
106+ rm -rf $MYSQLD_VARDIR
107+}
108+
109+# Test with strict_* values to force errors on algorithm mismatch
110+
111+test_with_checksum_algo strict_none
112+test_with_checksum_algo strict_crc32
113+test_with_checksum_algo strict_innodb

Subscribers

People subscribed via source and target branches