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

Proposed by Laurynas Biveinis
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) Needs Fixing
Review via email: mp+123236@code.launchpad.net

Description of the change

To post a comment you must log in.
430. By Alexey Kopytov

Automerge from 2.0.

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Same comments as for the 2.0 version.

review: Needs Fixing
431. By Stewart Smith

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

432. By Stewart Smith

null merge 2.0

433. By Laurynas Biveinis

Merge fix for bug 1044398 from 2.0.

Unmerged revisions

433. By Laurynas Biveinis

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
=== modified file 'src/write_filt.c'
--- src/write_filt.c 2012-08-01 10:10:44 +0000
+++ src/write_filt.c 2012-09-11 11:02:20 +0000
@@ -118,6 +118,7 @@
118 snprintf(meta_name, sizeof(meta_name), "%s%s", dst_name,118 snprintf(meta_name, sizeof(meta_name), "%s%s", dst_name,
119 XB_DELTA_INFO_SUFFIX);119 XB_DELTA_INFO_SUFFIX);
120 info.page_size = cursor->page_size;120 info.page_size = cursor->page_size;
121 info.zip_size = cursor->zip_size;
121 info.space_id = cursor->space_id;122 info.space_id = cursor->space_id;
122 if (!xb_write_delta_metadata(meta_name, &info)) {123 if (!xb_write_delta_metadata(meta_name, &info)) {
123 msg("[%02lu] xtrabackup: Error: "124 msg("[%02lu] xtrabackup: Error: "
124125
=== modified file 'src/xtrabackup.c'
--- src/xtrabackup.c 2012-09-05 08:35:45 +0000
+++ src/xtrabackup.c 2012-09-11 11:02:20 +0000
@@ -1506,6 +1506,7 @@
15061506
1507 /* set defaults */1507 /* set defaults */
1508 info->page_size = ULINT_UNDEFINED;1508 info->page_size = ULINT_UNDEFINED;
1509 info->zip_size = ULINT_UNDEFINED;
1509 info->space_id = ULINT_UNDEFINED;1510 info->space_id = ULINT_UNDEFINED;
15101511
1511 fp = fopen(filepath, "r");1512 fp = fopen(filepath, "r");
@@ -1518,6 +1519,8 @@
1518 if (fscanf(fp, "%50s = %50s\n", key, value) == 2) {1519 if (fscanf(fp, "%50s = %50s\n", key, value) == 2) {
1519 if (strcmp(key, "page_size") == 0) {1520 if (strcmp(key, "page_size") == 0) {
1520 info->page_size = strtoul(value, NULL, 10);1521 info->page_size = strtoul(value, NULL, 10);
1522 } else if (strcmp(key, "zip_size") == 0) {
1523 info->zip_size = strtoul(value, NULL, 10);
1521 } else if (strcmp(key, "space_id") == 0) {1524 } else if (strcmp(key, "space_id") == 0) {
1522 info->space_id = strtoul(value, NULL, 10);1525 info->space_id = strtoul(value, NULL, 10);
1523 }1526 }
@@ -1530,6 +1533,10 @@
1530 msg("xtrabackup: page_size is required in %s\n", filepath);1533 msg("xtrabackup: page_size is required in %s\n", filepath);
1531 r = FALSE;1534 r = FALSE;
1532 }1535 }
1536 if (info->zip_size == ULINT_UNDEFINED) {
1537 msg("xtrabackup: zip_size is required in %s\n", filepath);
1538 r = FALSE;
1539 }
1533 if (info->space_id == ULINT_UNDEFINED) {1540 if (info->space_id == ULINT_UNDEFINED) {
1534 msg("xtrabackup: Warning: This backup was taken with XtraBackup 2.0.1 "1541 msg("xtrabackup: Warning: This backup was taken with XtraBackup 2.0.1 "
1535 "or earlier, some DDL operations between full and incremental "1542 "or earlier, some DDL operations between full and incremental "
@@ -1552,8 +1559,10 @@
1552 MY_STAT mystat;1559 MY_STAT mystat;
15531560
1554 snprintf(buf, sizeof(buf),1561 snprintf(buf, sizeof(buf),
1555 "page_size = %lu\nspace_id = %lu\n",1562 "page_size = %lu\n"
1556 info->page_size, info->space_id);1563 "zip_size = %lu\n"
1564 "space_id = %lu\n",
1565 info->page_size, info->zip_size, info->space_id);
1557 len = strlen(buf);1566 len = strlen(buf);
15581567
1559 mystat.st_size = len;1568 mystat.st_size = len;
@@ -4088,8 +4097,7 @@
4088 xb_file_set_nocache(src_file, src_path, "OPEN");4097 xb_file_set_nocache(src_file, src_path, "OPEN");
40894098
4090 dst_file = xb_delta_open_matching_space(4099 dst_file = xb_delta_open_matching_space(
4091 dbname, space_name, info.space_id,4100 dbname, space_name, info.space_id, info.zip_size,
4092 info.page_size == UNIV_PAGE_SIZE ? 0 : info.page_size,
4093 dst_path, sizeof(dst_path), &success);4101 dst_path, sizeof(dst_path), &success);
4094 if (!success) {4102 if (!success) {
4095 msg("xtrabackup: error: cannot open %s\n", dst_path);4103 msg("xtrabackup: error: cannot open %s\n", dst_path);
40964104
=== modified file 'src/xtrabackup.h'
--- src/xtrabackup.h 2012-07-11 07:55:58 +0000
+++ src/xtrabackup.h 2012-09-11 11:02:20 +0000
@@ -22,8 +22,9 @@
22#define XB_XTRABACKUP_H22#define XB_XTRABACKUP_H
2323
24typedef struct {24typedef struct {
25 ulint page_size;25 ulint page_size;
26 ulint space_id;26 ulint zip_size;
27 ulint space_id;
27} xb_delta_info_t;28} xb_delta_info_t;
2829
29typedef enum {30typedef enum {
3031
=== added file 'test/t/bug1044398.sh'
--- test/t/bug1044398.sh 1970-01-01 00:00:00 +0000
+++ test/t/bug1044398.sh 2012-09-11 11:02:20 +0000
@@ -0,0 +1,37 @@
1# Test compatibility for pre-bug 1044398 incremental meta files.
2
3. inc/common.sh
4
5if [ -z "$INNODB_VERSION" ]; then
6 echo "Requires InnoDB plugin or XtraDB" >$SKIPPED_REASON
7 exit $SKIPPED_EXIT_CODE
8fi
9
10start_server --innodb_file_per_table
11
12vlog "Creating full backup"
13innobackupex --no-timestamp $topdir/full
14
15vlog "Creating new tablespace"
16run_cmd ${MYSQL} ${MYSQL_ARGS} -e \
17 "CREATE TABLE t1(a INT) ENGINE=InnoDB" test
18
19run_cmd ${MYSQL} ${MYSQL_ARGS} -e \
20 "INSERT INTO t1 VALUES (1)" test
21
22vlog "Creating incremental backup"
23innobackupex --incremental --no-timestamp \
24 --incremental-basedir=$topdir/full $topdir/inc
25
26# Remove zip_size = $page_size line from .meta file
27sed -ie '/zip_size/ d' $topdir/inc/test/t1.ibd.meta
28
29vlog "Preparing backup, applying log"
30innobackupex --apply-log -redo-only $topdir/full
31
32vlog "Preparing backup, applying delta, should fail with missing zip_size error"
33run_cmd_expect_failure $IB_BIN $IB_ARGS --apply-log --redo-only --incremental-dir=$topdir/inc $topdir/full
34
35grep -q "xtrabackup: zip_size is required " $OUTFILE
36
37stop_server

Subscribers

People subscribed via source and target branches