Merge lp:~sergei.glushchenko/percona-xtrabackup/BT-26901-2.1 into lp:percona-xtrabackup/2.1

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 454
Proposed branch: lp:~sergei.glushchenko/percona-xtrabackup/BT-26901-2.1
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 200 lines (+144/-2)
3 files modified
innobackupex (+14/-1)
src/xtrabackup.c (+10/-1)
test/t/ib_doublewrite.sh (+120/-0)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-xtrabackup/BT-26901-2.1
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Laurynas Biveinis Pending
Review via email: mp+134516@code.launchpad.net

This proposal supersedes a proposal from 2012-10-18.

Description of the change

To post a comment you must log in.
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote : Posted in a previous version of this proposal

#26901

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal

There is a conflict in innobackupex.

(Just a heads-up, not a full review)

review: Needs Fixing
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal

Ah, wrong target branch.

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote : Posted in a previous version of this proposal

Resubmitted to 2.1

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal

Same comments as for 2.0 (in 2.1 please use innodb_int for the wrapper).

review: Needs Fixing
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote : Posted in a previous version of this proposal
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal

OK with innodb_int.h changes following the style used in the rest in that file.

review: Approve
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal

Please re-push and set to "Approved" then, thanks.

Revision history for this message
Alexey Kopytov (akopytov) wrote : Posted in a previous version of this proposal

See comments in the 2.0 MP.

review: Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'innobackupex'
--- innobackupex 2012-11-07 06:45:28 +0000
+++ innobackupex 2012-11-15 16:55:39 +0000
@@ -700,6 +700,13 @@
700 my $file;700 my $file;
701 my $backup_innodb_data_file_path;701 my $backup_innodb_data_file_path;
702702
703 if (has_option(\%config, $option_defaults_group, 'innodb_doublewrite_file')) {
704 my $doublewrite_file =
705 get_option(\%config, $option_defaults_group,
706 'innodb_doublewrite_file');
707 $excluded_files = $excluded_files . '|' . $doublewrite_file;
708 }
709
703 # check whether files should be copied or moved to dest directory710 # check whether files should be copied or moved to dest directory
704 my $move_or_copy_file = $move_flag ? \&move_file : \&copy_file;711 my $move_or_copy_file = $move_flag ? \&move_file : \&copy_file;
705 my $move_or_copy_dir = $move_flag ?712 my $move_or_copy_dir = $move_flag ?
@@ -1590,7 +1597,7 @@
1590 "innodb_log_file_size",1597 "innodb_log_file_size",
1591 "innodb_fast_checksum",1598 "innodb_fast_checksum",
1592 "innodb_page_size",1599 "innodb_page_size",
1593 "innodb_log_block_size",1600 "innodb_log_block_size"
1594 );1601 );
15951602
1596 my $options_dump = "# This MySQL options file was generated by $innobackup_script.\n\n" .1603 my $options_dump = "# This MySQL options file was generated by $innobackup_script.\n\n" .
@@ -1604,6 +1611,12 @@
1604 $options_dump .= "$option_name=$option_value\n";1611 $options_dump .= "$option_name=$option_value\n";
1605 }1612 }
1606 }1613 }
1614 if (has_option(\%config,
1615 $option_defaults_group, "innodb_doublewrite_file")) {
1616 $options_dump .= "innodb_doublewrite_file=" . (split(/\/+/,
1617 get_option(\%config, $option_defaults_group,
1618 'innodb_doublewrite_file')))[-1] . "\n";
1619 }
16071620
1608 print FILE $options_dump;1621 print FILE $options_dump;
1609 close(FILE);1622 close(FILE);
16101623
=== modified file 'src/xtrabackup.c'
--- src/xtrabackup.c 2012-11-08 23:42:20 +0000
+++ src/xtrabackup.c 2012-11-15 16:55:39 +0000
@@ -3879,7 +3879,9 @@
3879 os_file_t file = 0;3879 os_file_t file = 0;
3880 ulint tablespace_flags;3880 ulint tablespace_flags;
38813881
3882 ut_a(dbname != NULL || space_id == 0 || space_id == ULINT_UNDEFINED);3882 ut_a(dbname != NULL ||
3883 trx_sys_sys_space(space_id) ||
3884 space_id == ULINT_UNDEFINED);
38833885
3884 *success = FALSE;3886 *success = FALSE;
38853887
@@ -3908,6 +3910,10 @@
3908 return file;3910 return file;
3909 }3911 }
39103912
3913 if (trx_sys_sys_space(space_id)) {
3914 goto found;
3915 }
3916
3911 mutex_enter(&fil_system->mutex);3917 mutex_enter(&fil_system->mutex);
3912 fil_space = xb_space_get_by_name(dest_space_name);3918 fil_space = xb_space_get_by_name(dest_space_name);
3913 mutex_exit(&fil_system->mutex);3919 mutex_exit(&fil_system->mutex);
@@ -5156,6 +5162,9 @@
5156 printf("innodb_fast_checksum = %d\n", innobase_fast_checksum);5162 printf("innodb_fast_checksum = %d\n", innobase_fast_checksum);
5157 printf("innodb_page_size = %ld\n", innobase_page_size);5163 printf("innodb_page_size = %ld\n", innobase_page_size);
5158 printf("innodb_log_block_size = %lu\n", innobase_log_block_size);5164 printf("innodb_log_block_size = %lu\n", innobase_log_block_size);
5165 if (innobase_doublewrite_file != NULL) {
5166 printf("innodb_doublewrite_file = %s\n", innobase_doublewrite_file);
5167 }
5159#endif5168#endif
5160 exit(EXIT_SUCCESS);5169 exit(EXIT_SUCCESS);
5161 }5170 }
51625171
=== added file 'test/t/ib_doublewrite.sh'
--- test/t/ib_doublewrite.sh 1970-01-01 00:00:00 +0000
+++ test/t/ib_doublewrite.sh 2012-11-15 16:55:39 +0000
@@ -0,0 +1,120 @@
1########################################################################
2# Bug #1066843: Fix for bug #932623 does not take separate doublewrite
3# tablespace into account
4# Bug #1068470: XtraBackup handles separate doublewrite buffer file
5# incorrectly
6# We testing full and incremental backup and restore to check that
7# separate doublewrite buffer file handled correctly
8########################################################################
9
10. inc/common.sh
11
12if [ -z "$XTRADB_VERSION" ]; then
13 echo "Requires XtraDB" > $SKIPPED_REASON
14 exit $SKIPPED_EXIT_CODE
15fi
16
17DBLWR=${TEST_BASEDIR}/var1/data/dblwr.ibd
18start_server --innodb_file_per_table --innodb_doublewrite_file=${DBLWR}
19load_dbase_schema incremental_sample
20
21# Workaround for bug #1072695
22IB_ARGS_NO_DEFAULTS_FILE=`echo $IB_ARGS | sed -e 's/--defaults-file=[^ ]* / /'`
23function innobackupex_no_defaults_file ()
24{
25 run_cmd $IB_BIN $IB_ARGS_NO_DEFAULTS_FILE $*
26}
27
28echo "innodb_doublewrite_file=${DBLWR}" >>$topdir/my.cnf
29
30# Adding initial rows
31vlog "Adding initial rows to database..."
32${MYSQL} ${MYSQL_ARGS} -e "insert into test values (1, 1);" incremental_sample
33
34# Full backup
35# backup root directory
36mkdir -p $topdir/backup
37
38vlog "Starting backup"
39full_backup_dir=$topdir/backup/full
40innobackupex --no-timestamp $full_backup_dir
41vlog "Full backup done to directory $full_backup_dir"
42cat $full_backup_dir/backup-my.cnf
43
44# Changing data
45
46vlog "Making changes to database"
47${MYSQL} ${MYSQL_ARGS} -e "create table t2 (a int(11) default null, number int(11) default null) engine=innodb" incremental_sample
48${MYSQL} ${MYSQL_ARGS} -e "insert into test values (10, 1);" incremental_sample
49${MYSQL} ${MYSQL_ARGS} -e "insert into t2 values (10, 1);" incremental_sample
50vlog "Changes done"
51
52# Saving the checksum of original table
53checksum_test_a=`checksum_table incremental_sample test`
54checksum_t2_a=`checksum_table incremental_sample t2`
55vlog "Table 'test' checksum is $checksum_test_a"
56vlog "Table 't2' checksum is $checksum_t2_a"
57
58vlog "Making incremental backup"
59
60vlog "###############"
61vlog "# INCREMENTAL #"
62vlog "###############"
63
64# Incremental backup
65inc_backup_dir=$topdir/backup/inc
66innobackupex --no-timestamp --incremental --incremental-basedir=$full_backup_dir \
67 $inc_backup_dir
68vlog "Incremental backup done to directory $inc_backup_dir"
69
70vlog "Preparing backup"
71# Prepare backup
72vlog "##############"
73vlog "# PREPARE #1 #"
74vlog "##############"
75innobackupex_no_defaults_file --apply-log --redo-only $full_backup_dir
76vlog "Log applied to full backup"
77vlog "##############"
78vlog "# PREPARE #2 #"
79vlog "##############"
80innobackupex_no_defaults_file --apply-log --redo-only --incremental-dir=$inc_backup_dir \
81 $full_backup_dir
82vlog "Delta applied to full backup"
83vlog "##############"
84vlog "# PREPARE #3 #"
85vlog "##############"
86innobackupex_no_defaults_file --apply-log $full_backup_dir
87vlog "Data prepared for restore"
88
89# Destroying mysql data
90stop_server
91rm -rf $mysql_datadir/*
92vlog "Data destroyed"
93
94# Restore backup
95vlog "Copying files"
96vlog "###########"
97vlog "# RESTORE #"
98vlog "###########"
99innobackupex --copy-back $full_backup_dir
100vlog "Data restored"
101
102start_server --innodb_file_per_table --innodb_doublewrite_file=${DBLWR}
103
104vlog "Checking checksums"
105checksum_test_b=`checksum_table incremental_sample test`
106checksum_t2_b=`checksum_table incremental_sample t2`
107
108if [ "$checksum_test_a" != "$checksum_test_b" ]
109then
110 vlog "Checksums for table 'test' are not equal"
111 exit -1
112fi
113
114if [ "$checksum_t2_a" != "$checksum_t2_b" ]
115then
116 vlog "Checksums for table 't2' are not equal"
117 exit -1
118fi
119
120vlog "Checksums are OK"

Subscribers

People subscribed via source and target branches