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

Proposed by Laurynas Biveinis on 2012-09-07
Status: Work in progress
Proposed branch: lp:~laurynas-biveinis/percona-xtrabackup/bug1044398-2.1
Merge into: lp:percona-xtrabackup/2.1
Prerequisite: lp:~sergei.glushchenko/percona-xtrabackup/xb21-bug1038127
Diff against target: 124 lines (+53/-6)
4 files modified
src/write_filt.c (+1/-0)
src/xtrabackup.c (+12/-4)
src/xtrabackup.h (+3/-2)
test/t/bug1044398.sh (+37/-0)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-xtrabackup/bug1044398-2.1
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) 2012-09-07 Needs Fixing on 2012-09-07
Review via email: mp+123236@code.launchpad.net

Description of the change

To post a comment you must log in.
430. By Alexey Kopytov on 2012-09-07

Automerge from 2.0.

Alexey Kopytov (akopytov) wrote :

Same comments as for the 2.0 version.

review: Needs Fixing
431. By Stewart Smith on 2012-09-10

merge fix for Bug #1038127: XtraBackup 2.0.2 is not backwards compatible

432. By Stewart Smith on 2012-09-10

null merge 2.0

433. By Laurynas Biveinis on 2012-09-11

Merge fix for bug 1044398 from 2.0.

Unmerged revisions

433. By Laurynas Biveinis on 2012-09-11

Merge fix for bug 1044398 from 2.0.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/write_filt.c'
2--- src/write_filt.c 2012-08-01 10:10:44 +0000
3+++ src/write_filt.c 2012-09-11 11:02:20 +0000
4@@ -118,6 +118,7 @@
5 snprintf(meta_name, sizeof(meta_name), "%s%s", dst_name,
6 XB_DELTA_INFO_SUFFIX);
7 info.page_size = cursor->page_size;
8+ info.zip_size = cursor->zip_size;
9 info.space_id = cursor->space_id;
10 if (!xb_write_delta_metadata(meta_name, &info)) {
11 msg("[%02lu] xtrabackup: Error: "
12
13=== modified file 'src/xtrabackup.c'
14--- src/xtrabackup.c 2012-09-05 08:35:45 +0000
15+++ src/xtrabackup.c 2012-09-11 11:02:20 +0000
16@@ -1506,6 +1506,7 @@
17
18 /* set defaults */
19 info->page_size = ULINT_UNDEFINED;
20+ info->zip_size = ULINT_UNDEFINED;
21 info->space_id = ULINT_UNDEFINED;
22
23 fp = fopen(filepath, "r");
24@@ -1518,6 +1519,8 @@
25 if (fscanf(fp, "%50s = %50s\n", key, value) == 2) {
26 if (strcmp(key, "page_size") == 0) {
27 info->page_size = strtoul(value, NULL, 10);
28+ } else if (strcmp(key, "zip_size") == 0) {
29+ info->zip_size = strtoul(value, NULL, 10);
30 } else if (strcmp(key, "space_id") == 0) {
31 info->space_id = strtoul(value, NULL, 10);
32 }
33@@ -1530,6 +1533,10 @@
34 msg("xtrabackup: page_size is required in %s\n", filepath);
35 r = FALSE;
36 }
37+ if (info->zip_size == ULINT_UNDEFINED) {
38+ msg("xtrabackup: zip_size is required in %s\n", filepath);
39+ r = FALSE;
40+ }
41 if (info->space_id == ULINT_UNDEFINED) {
42 msg("xtrabackup: Warning: This backup was taken with XtraBackup 2.0.1 "
43 "or earlier, some DDL operations between full and incremental "
44@@ -1552,8 +1559,10 @@
45 MY_STAT mystat;
46
47 snprintf(buf, sizeof(buf),
48- "page_size = %lu\nspace_id = %lu\n",
49- info->page_size, info->space_id);
50+ "page_size = %lu\n"
51+ "zip_size = %lu\n"
52+ "space_id = %lu\n",
53+ info->page_size, info->zip_size, info->space_id);
54 len = strlen(buf);
55
56 mystat.st_size = len;
57@@ -4088,8 +4097,7 @@
58 xb_file_set_nocache(src_file, src_path, "OPEN");
59
60 dst_file = xb_delta_open_matching_space(
61- dbname, space_name, info.space_id,
62- info.page_size == UNIV_PAGE_SIZE ? 0 : info.page_size,
63+ dbname, space_name, info.space_id, info.zip_size,
64 dst_path, sizeof(dst_path), &success);
65 if (!success) {
66 msg("xtrabackup: error: cannot open %s\n", dst_path);
67
68=== modified file 'src/xtrabackup.h'
69--- src/xtrabackup.h 2012-07-11 07:55:58 +0000
70+++ src/xtrabackup.h 2012-09-11 11:02:20 +0000
71@@ -22,8 +22,9 @@
72 #define XB_XTRABACKUP_H
73
74 typedef struct {
75- ulint page_size;
76- ulint space_id;
77+ ulint page_size;
78+ ulint zip_size;
79+ ulint space_id;
80 } xb_delta_info_t;
81
82 typedef enum {
83
84=== added file 'test/t/bug1044398.sh'
85--- test/t/bug1044398.sh 1970-01-01 00:00:00 +0000
86+++ test/t/bug1044398.sh 2012-09-11 11:02:20 +0000
87@@ -0,0 +1,37 @@
88+# Test compatibility for pre-bug 1044398 incremental meta files.
89+
90+. inc/common.sh
91+
92+if [ -z "$INNODB_VERSION" ]; then
93+ echo "Requires InnoDB plugin or XtraDB" >$SKIPPED_REASON
94+ exit $SKIPPED_EXIT_CODE
95+fi
96+
97+start_server --innodb_file_per_table
98+
99+vlog "Creating full backup"
100+innobackupex --no-timestamp $topdir/full
101+
102+vlog "Creating new tablespace"
103+run_cmd ${MYSQL} ${MYSQL_ARGS} -e \
104+ "CREATE TABLE t1(a INT) ENGINE=InnoDB" test
105+
106+run_cmd ${MYSQL} ${MYSQL_ARGS} -e \
107+ "INSERT INTO t1 VALUES (1)" test
108+
109+vlog "Creating incremental backup"
110+innobackupex --incremental --no-timestamp \
111+ --incremental-basedir=$topdir/full $topdir/inc
112+
113+# Remove zip_size = $page_size line from .meta file
114+sed -ie '/zip_size/ d' $topdir/inc/test/t1.ibd.meta
115+
116+vlog "Preparing backup, applying log"
117+innobackupex --apply-log -redo-only $topdir/full
118+
119+vlog "Preparing backup, applying delta, should fail with missing zip_size error"
120+run_cmd_expect_failure $IB_BIN $IB_ARGS --apply-log --redo-only --incremental-dir=$topdir/inc $topdir/full
121+
122+grep -q "xtrabackup: zip_size is required " $OUTFILE
123+
124+stop_server

Subscribers

People subscribed via source and target branches