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

Proposed by Alexey Kopytov
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 440
Proposed branch: lp:~akopytov/percona-xtrabackup/bug977652-2.0
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 88 lines (+45/-4)
4 files modified
src/compress.c (+11/-0)
src/compress.h (+3/-0)
src/xtrabackup.c (+9/-4)
test/t/bug977652.sh (+22/-0)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug977652-2.0
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Review via email: mp+110313@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :
Revision history for this message
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 'src/compress.c'
2--- src/compress.c 2012-02-10 20:05:56 +0000
3+++ src/compress.c 2012-06-14 12:35:31 +0000
4@@ -489,3 +489,14 @@
5
6 return NULL;
7 }
8+
9+/* Return a target datasink for the specified compress datasink */
10+ds_ctxt_t *
11+compress_get_dest_ctxt(ds_ctxt_t *ctxt)
12+{
13+ ds_compress_ctxt_t *comp_ctxt;
14+
15+ comp_ctxt = (ds_compress_ctxt_t *) ctxt->ptr;
16+
17+ return comp_ctxt->dest_ctxt;
18+}
19
20=== modified file 'src/compress.h'
21--- src/compress.h 2012-02-10 20:05:56 +0000
22+++ src/compress.h 2012-06-14 12:35:31 +0000
23@@ -25,4 +25,7 @@
24
25 extern datasink_t datasink_compress;
26
27+/* Return a target datasink for the specified compress datasink */
28+ds_ctxt_t *compress_get_dest_ctxt(ds_ctxt_t *);
29+
30 #endif
31
32=== modified file 'src/xtrabackup.c'
33--- src/xtrabackup.c 2012-05-28 16:44:13 +0000
34+++ src/xtrabackup.c 2012-06-14 12:35:31 +0000
35@@ -3903,6 +3903,7 @@
36 char logfile_temp_path[FN_REFLEN];
37 datasink_t *ds;
38 ds_ctxt_t *ds_ctxt = NULL;
39+ ds_ctxt_t *meta_ds_ctxt;
40
41 #ifdef USE_POSIX_FADVISE
42 msg("xtrabackup: uses posix_fadvise().\n");
43@@ -4496,10 +4497,14 @@
44 metadata_to_lsn = latest_cp;
45 metadata_last_lsn = log_copy_scanned_lsn;
46
47- if (!xtrabackup_stream_metadata(ds_ctxt))
48- msg("xtrabackup: error: "
49- "xtrabackup_stream_metadata() failed.\n"
50- );
51+ /* Write xtrabackup_checkpoint without compression, if it was used for
52+ backup. */
53+ meta_ds_ctxt = xtrabackup_compress ?
54+ compress_get_dest_ctxt(ds_ctxt) : ds_ctxt;
55+ if (!xtrabackup_stream_metadata(meta_ds_ctxt))
56+ msg("xtrabackup: error:"
57+ "xtrabackup_stream_metadata() failed.\n");
58+
59 if (xtrabackup_extra_lsndir) {
60 char filename[FN_REFLEN];
61
62
63=== added file 'test/t/bug977652.sh'
64--- test/t/bug977652.sh 1970-01-01 00:00:00 +0000
65+++ test/t/bug977652.sh 2012-06-14 12:35:31 +0000
66@@ -0,0 +1,22 @@
67+#############################################################################
68+# Bug #977652: Compressed/Uncompressed incremental backup fails on compressed
69+# full backup in Xtrabackup 2.0.0
70+#############################################################################
71+
72+if ! which qpress > /dev/null 2>&1 ; then
73+ echo "Requires qpress to be installed" > $SKIPPED_REASON
74+ exit $SKIPPED_EXIT_CODE
75+fi
76+
77+. inc/common.sh
78+
79+start_server --innodb_file_per_table
80+
81+load_sakila
82+
83+# Take a full compressed backup
84+innobackupex --compress --no-timestamp $topdir/full
85+
86+# Test that incremental backups work without uncompressing the full one
87+innobackupex --compress --no-timestamp --incremental \
88+ --incremental-basedir=$topdir/full $topdir/incremental

Subscribers

People subscribed via source and target branches