Merge lp:~akopytov/percona-xtrabackup/bug826632-1.6 into lp:percona-xtrabackup/1.6

Proposed by Alexey Kopytov
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 321
Proposed branch: lp:~akopytov/percona-xtrabackup/bug826632-1.6
Merge into: lp:percona-xtrabackup/1.6
Diff against target: 316 lines (+108/-49)
5 files modified
test/inc/sakila-db/sakila-data.sql (+1/-22)
test/inc/sakila-db/sakila-schema.sql (+22/-0)
test/t/xb_parallel.sh (+1/-1)
test/t/xb_parallel_incremental.sh (+58/-0)
xtrabackup.c (+26/-26)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug826632-1.6
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Review via email: mp+87011@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
=== modified file 'test/inc/sakila-db/sakila-data.sql'
--- test/inc/sakila-db/sakila-data.sql 2010-06-02 13:05:00 +0000
+++ test/inc/sakila-db/sakila-data.sql 2011-12-28 14:00:30 +0000
@@ -67,13 +67,6 @@
67COMMIT;67COMMIT;
6868
69--69--
70-- Trigger to enforce create dates on INSERT
71--
72
73CREATE TRIGGER customer_create_date BEFORE INSERT ON customer
74 FOR EACH ROW SET NEW.create_date = NOW();
75
76--
77-- Dumping data for table film70-- Dumping data for table film
78--71--
7972
@@ -123,13 +116,6 @@
123COMMIT;116COMMIT;
124117
125--118--
126-- Trigger to enforce payment_date during INSERT
127--
128
129CREATE TRIGGER payment_date BEFORE INSERT ON payment
130 FOR EACH ROW SET NEW.payment_date = NOW();
131
132--
133-- Dumping data for table rental119-- Dumping data for table rental
134--120--
135121
@@ -139,13 +125,6 @@
139COMMIT;125COMMIT;
140126
141--127--
142-- Trigger to enforce rental_date on INSERT
143--
144
145CREATE TRIGGER rental_date BEFORE INSERT ON rental
146 FOR EACH ROW SET NEW.rental_date = NOW();
147
148--
149-- Dumping data for table staff128-- Dumping data for table staff
150--129--
151130
@@ -163,4 +142,4 @@
163142
164SET SQL_MODE=@OLD_SQL_MODE;143SET SQL_MODE=@OLD_SQL_MODE;
165SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;144SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
166SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
167\ No newline at end of file145\ No newline at end of file
146SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
168147
=== modified file 'test/inc/sakila-db/sakila-schema.sql'
--- test/inc/sakila-db/sakila-schema.sql 2010-06-02 13:05:00 +0000
+++ test/inc/sakila-db/sakila-schema.sql 2011-12-28 14:00:30 +0000
@@ -636,6 +636,28 @@
636636
637DELIMITER ;637DELIMITER ;
638638
639--
640-- Trigger to enforce payment_date during INSERT
641--
642
643CREATE TRIGGER payment_date BEFORE INSERT ON payment
644 FOR EACH ROW SET NEW.payment_date = NOW();
645
646--
647-- Trigger to enforce create dates on INSERT
648--
649
650CREATE TRIGGER customer_create_date BEFORE INSERT ON customer
651 FOR EACH ROW SET NEW.create_date = NOW();
652
653--
654-- Trigger to enforce rental_date on INSERT
655--
656
657CREATE TRIGGER rental_date BEFORE INSERT ON rental
658 FOR EACH ROW SET NEW.rental_date = NOW();
659
660
639SET SQL_MODE=@OLD_SQL_MODE;661SET SQL_MODE=@OLD_SQL_MODE;
640SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;662SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
641SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;663SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
642664
=== modified file 'test/t/xb_parallel.sh'
--- test/t/xb_parallel.sh 2011-12-07 13:28:47 +0000
+++ test/t/xb_parallel.sh 2011-12-28 14:00:30 +0000
@@ -1,7 +1,7 @@
1. inc/common.sh1. inc/common.sh
22
3init3init
4run_mysqld 4run_mysqld --innodb_file_per_table
5load_dbase_schema sakila5load_dbase_schema sakila
6load_dbase_data sakila6load_dbase_data sakila
77
88
=== added file 'test/t/xb_parallel_incremental.sh'
--- test/t/xb_parallel_incremental.sh 1970-01-01 00:00:00 +0000
+++ test/t/xb_parallel_incremental.sh 2011-12-28 14:00:30 +0000
@@ -0,0 +1,58 @@
1##########################################################################
2# Bug #826632: parallel option breaks incremental backups #
3##########################################################################
4
5. inc/common.sh
6
7init
8run_mysqld --innodb_file_per_table
9load_dbase_schema sakila
10load_dbase_data sakila
11
12# Take backup
13vlog "Creating the backup directory: $topdir/backup"
14backup_dir="$topdir/backup"
15innobackupex $topdir/full_backup --no-timestamp --parallel=8
16
17# Make some changes for incremental backup by truncating and reloading
18# tables. TRUNCATE cannot be used here, because that would be executed
19# as DROP + CREATE internally for InnoDB tables, so tablespace IDs
20# would change.
21
22table_list=`$MYSQL $MYSQL_ARGS -Ns -e \
23"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='sakila' \
24AND TABLE_TYPE='BASE TABLE'"`
25
26for t in $table_list
27do
28 run_cmd $MYSQL $MYSQL_ARGS -s sakila <<EOF
29SET foreign_key_checks=0;
30DELETE FROM $t;
31SET foreign_key_checks=1;
32EOF
33done
34
35load_dbase_data sakila
36
37# Do an incremental parallel backup
38innobackupex --incremental --no-timestamp --parallel=8 \
39 --incremental-basedir=$topdir/full_backup $topdir/inc_backup
40
41stop_mysqld
42# Remove datadir
43rm -r $mysql_datadir
44
45vlog "Applying log"
46innobackupex --apply-log --redo-only $topdir/full_backup
47innobackupex --apply-log --redo-only --incremental-dir=$topdir/inc_backup \
48 $topdir/full_backup
49innobackupex --apply-log $topdir/full_backup
50
51vlog "Restoring MySQL datadir"
52mkdir -p $mysql_datadir
53innobackupex --copy-back $topdir/full_backup
54
55run_mysqld
56
57# Check sakila
58run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila
059
=== modified file 'xtrabackup.c'
--- xtrabackup.c 2011-12-05 12:35:43 +0000
+++ xtrabackup.c 2011-12-28 14:00:30 +0000
@@ -610,8 +610,6 @@
610LSN64 incremental_lsn;610LSN64 incremental_lsn;
611LSN64 incremental_to_lsn;611LSN64 incremental_to_lsn;
612LSN64 incremental_last_lsn;612LSN64 incremental_last_lsn;
613byte* incremental_buffer = NULL;
614byte* incremental_buffer_base = NULL;
615613
616char *xtrabackup_incremental_basedir = NULL; /* for --backup */614char *xtrabackup_incremental_basedir = NULL; /* for --backup */
617char *xtrabackup_extra_lsndir = NULL; /* for --backup with --extra-lsndir */615char *xtrabackup_extra_lsndir = NULL; /* for --backup with --extra-lsndir */
@@ -2591,6 +2589,8 @@
2591 IB_INT64 offset;2589 IB_INT64 offset;
2592 ulint page_in_buffer;2590 ulint page_in_buffer;
2593 ulint incremental_buffers = 0;2591 ulint incremental_buffers = 0;
2592 byte* incremental_buffer;
2593 byte* incremental_buffer_base = NULL;
2594 ulint page_size;2594 ulint page_size;
2595 ulint page_size_shift;2595 ulint page_size_shift;
2596#ifdef INNODB_VERSION_SHORT2596#ifdef INNODB_VERSION_SHORT
@@ -2740,6 +2740,12 @@
2740 }2740 }
27412741
2742 if (xtrabackup_incremental) {2742 if (xtrabackup_incremental) {
2743 /* allocate buffer for incremental backup (4096 pages) */
2744 incremental_buffer_base = ut_malloc((UNIV_PAGE_SIZE_MAX / 4 + 1)
2745 * UNIV_PAGE_SIZE_MAX);
2746 incremental_buffer = ut_align(incremental_buffer_base,
2747 UNIV_PAGE_SIZE_MAX);
2748
2743 snprintf(meta_path, sizeof(meta_path),2749 snprintf(meta_path, sizeof(meta_path),
2744 "%s%s", dst_path, XB_DELTA_INFO_SUFFIX);2750 "%s%s", dst_path, XB_DELTA_INFO_SUFFIX);
2745 strcat(dst_path, ".delta");2751 strcat(dst_path, ".delta");
@@ -3003,6 +3009,8 @@
3003 os_file_close(src_file);3009 os_file_close(src_file);
3004 }3010 }
3005 os_file_close(dst_file);3011 os_file_close(dst_file);
3012 if (incremental_buffer_base)
3013 ut_free(incremental_buffer_base);
3006 ut_free(buf2);3014 ut_free(buf2);
3007 return(FALSE);3015 return(FALSE);
3008error:3016error:
@@ -3010,6 +3018,8 @@
3010 os_file_close(src_file);3018 os_file_close(src_file);
3011 if (dst_file != -1)3019 if (dst_file != -1)
3012 os_file_close(dst_file);3020 os_file_close(dst_file);
3021 if (incremental_buffer_base)
3022 ut_free(incremental_buffer_base);
3013 if (buf2)3023 if (buf2)
3014 ut_free(buf2);3024 ut_free(buf2);
3015 fprintf(stderr, "[%02u] xtrabackup: Error: "3025 fprintf(stderr, "[%02u] xtrabackup: Error: "
@@ -3021,6 +3031,8 @@
3021 os_file_close(src_file);3031 os_file_close(src_file);
3022 if (dst_file != -1)3032 if (dst_file != -1)
3023 os_file_close(dst_file);3033 os_file_close(dst_file);
3034 if (incremental_buffer_base)
3035 ut_free(incremental_buffer_base);
3024 if (buf2)3036 if (buf2)
3025 ut_free(buf2);3037 ut_free(buf2);
3026 fprintf(stderr, "[%02u] xtrabackup: Warning: skipping file %s.\n",3038 fprintf(stderr, "[%02u] xtrabackup: Warning: skipping file %s.\n",
@@ -5087,6 +5099,8 @@
5087 xb_delta_info_t info;5099 xb_delta_info_t info;
5088 ulint page_size;5100 ulint page_size;
5089 ulint page_size_shift;5101 ulint page_size_shift;
5102 byte* incremental_buffer_base = NULL;
5103 byte* incremental_buffer;
50905104
5091 ut_a(xtrabackup_incremental);5105 ut_a(xtrabackup_incremental);
50925106
@@ -5200,6 +5214,12 @@
5200 os_file_set_nocache(dst_file, dst_path, "OPEN");5214 os_file_set_nocache(dst_file, dst_path, "OPEN");
5201 }5215 }
52025216
5217 /* allocate buffer for incremental backup (4096 pages) */
5218 incremental_buffer_base = ut_malloc((UNIV_PAGE_SIZE_MAX / 4 + 1) *
5219 UNIV_PAGE_SIZE_MAX);
5220 incremental_buffer = ut_align(incremental_buffer_base,
5221 UNIV_PAGE_SIZE_MAX);
5222
5203 fprintf(stderr, "Applying %s ...\n", src_path);5223 fprintf(stderr, "Applying %s ...\n", src_path);
52045224
5205 while (!last_buffer) {5225 while (!last_buffer) {
@@ -5282,6 +5302,8 @@
5282 incremental_buffers++;5302 incremental_buffers++;
5283 }5303 }
52845304
5305 if (incremental_buffer_base)
5306 ut_free(incremental_buffer_base);
5285 if (src_file != -1)5307 if (src_file != -1)
5286 os_file_close(src_file);5308 os_file_close(src_file);
5287 if (dst_file != -1)5309 if (dst_file != -1)
@@ -5289,6 +5311,8 @@
5289 return TRUE;5311 return TRUE;
52905312
5291error:5313error:
5314 if (incremental_buffer_base)
5315 ut_free(incremental_buffer_base);
5292 if (src_file != -1)5316 if (src_file != -1)
5293 os_file_close(src_file);5317 os_file_close(src_file);
5294 if (dst_file != -1)5318 if (dst_file != -1)
@@ -6184,12 +6208,6 @@
6184 xtrabackup_incremental);6208 xtrabackup_incremental);
6185 exit(EXIT_FAILURE);6209 exit(EXIT_FAILURE);
6186 }6210 }
6187
6188 /* allocate buffer for incremental backup (4096 pages) */
6189 incremental_buffer_base = malloc((UNIV_PAGE_SIZE_MAX / 4 + 1) *
6190 UNIV_PAGE_SIZE_MAX);
6191 incremental_buffer = ut_align(incremental_buffer_base,
6192 UNIV_PAGE_SIZE_MAX);
6193 } else if (xtrabackup_backup && xtrabackup_incremental_basedir) {6211 } else if (xtrabackup_backup && xtrabackup_incremental_basedir) {
6194 char filename[FN_REFLEN];6212 char filename[FN_REFLEN];
61956213
@@ -6204,12 +6222,6 @@
62046222
6205 incremental_lsn = metadata_to_lsn;6223 incremental_lsn = metadata_to_lsn;
6206 xtrabackup_incremental = xtrabackup_incremental_basedir; //dummy6224 xtrabackup_incremental = xtrabackup_incremental_basedir; //dummy
6207
6208 /* allocate buffer for incremental backup (4096 pages) */
6209 incremental_buffer_base = malloc((UNIV_PAGE_SIZE_MAX / 4 + 1) *
6210 UNIV_PAGE_SIZE_MAX);
6211 incremental_buffer = ut_align(incremental_buffer_base,
6212 UNIV_PAGE_SIZE_MAX);
6213 } else if (xtrabackup_prepare && xtrabackup_incremental_dir) {6225 } else if (xtrabackup_prepare && xtrabackup_incremental_dir) {
6214 char filename[FN_REFLEN];6226 char filename[FN_REFLEN];
62156227
@@ -6227,17 +6239,7 @@
6227 incremental_last_lsn = metadata_last_lsn;6239 incremental_last_lsn = metadata_last_lsn;
6228 xtrabackup_incremental = xtrabackup_incremental_dir; //dummy6240 xtrabackup_incremental = xtrabackup_incremental_dir; //dummy
62296241
6230 /* allocate buffer for incremental backup (4096 pages) */
6231 incremental_buffer_base = malloc((UNIV_PAGE_SIZE / 4 + 1) *
6232 UNIV_PAGE_SIZE);
6233 incremental_buffer = ut_align(incremental_buffer_base,
6234 UNIV_PAGE_SIZE);
6235 } else {6242 } else {
6236 /* allocate buffer for applying incremental (for header page only) */
6237 incremental_buffer_base = malloc((1 + 1) * UNIV_PAGE_SIZE_MAX);
6238 incremental_buffer = ut_align(incremental_buffer_base,
6239 UNIV_PAGE_SIZE_MAX);
6240
6241 xtrabackup_incremental = NULL;6243 xtrabackup_incremental = NULL;
6242 }6244 }
62436245
@@ -6324,8 +6326,6 @@
6324 if (xtrabackup_prepare)6326 if (xtrabackup_prepare)
6325 xtrabackup_prepare_func();6327 xtrabackup_prepare_func();
63266328
6327 free(incremental_buffer_base);
6328
6329 if (xtrabackup_tables) {6329 if (xtrabackup_tables) {
6330 /* free regexp */6330 /* free regexp */
6331 int i;6331 int i;

Subscribers

People subscribed via source and target branches