Merge lp:~akopytov/percona-xtrabackup/bug759225-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: 288
Proposed branch: lp:~akopytov/percona-xtrabackup/bug759225-1.6
Merge into: lp:percona-xtrabackup/1.6
Diff against target: 83 lines (+56/-1)
3 files modified
innobackupex (+1/-1)
test/t/bug759225.sh (+51/-0)
xtrabackup.c (+4/-0)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug759225-1.6
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Review via email: mp+76366@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 'innobackupex'
2--- innobackupex 2011-09-16 07:02:15 +0000
3+++ innobackupex 2011-09-21 09:42:23 +0000
4@@ -801,7 +801,7 @@
5 my $innodb_flush_method =
6 get_option(\%config, 'mysqld', 'innodb_flush_method');
7 my $innodb_use_odirect;
8- $innodb_use_odirect = 1 if $innodb_flush_method =~ m/O_DIRECT/i;
9+ $innodb_use_odirect = 1 if $innodb_flush_method =~ m/^(ALL_)?O_DIRECT$/i;
10
11 my $subdir;
12 my @list;
13
14=== added file 'test/t/bug759225.sh'
15--- test/t/bug759225.sh 1970-01-01 00:00:00 +0000
16+++ test/t/bug759225.sh 2011-09-21 09:42:23 +0000
17@@ -0,0 +1,51 @@
18+########################################################################
19+# Bug #759225: xtrabackup does not support ALL_O_DIRECT for
20+# innodb_flush_method
21+########################################################################
22+
23+. inc/common.sh
24+
25+if test "`uname -s`" != "Linux"
26+then
27+ echo "Requires Linux" > $SKIPPED_REASON
28+ exit $SKIPPED_EXIT_CODE
29+fi
30+
31+if [ -z "$XTRADB_VERSION" ]; then
32+ echo "Requires XtraDB" > $SKIPPED_REASON
33+ exit $SKIPPED_EXIT_CODE
34+fi
35+
36+init
37+run_mysqld
38+load_sakila
39+
40+# Take backup
41+echo "innodb_flush_method=ALL_O_DIRECT" >> $topdir/my.cnf
42+mkdir -p $topdir/backup
43+innobackupex --stream=tar $topdir/backup > $topdir/backup/out.tar
44+stop_mysqld
45+
46+# See if tar4ibd was using O_DIRECT
47+if ! grep "tar4ibd: using O_DIRECT for the input file" $OUTFILE ;
48+then
49+ vlog "tar4ibd was not using O_DIRECT for the input file."
50+ exit -1
51+fi
52+
53+# Remove datadir
54+rm -r $mysql_datadir
55+# Restore sakila
56+vlog "Applying log"
57+backup_dir=$topdir/backup
58+cd $backup_dir
59+$TAR -ixvf out.tar
60+cd - >/dev/null 2>&1
61+innobackupex --apply-log --defaults-file=$topdir/my.cnf $backup_dir
62+vlog "Restoring MySQL datadir"
63+mkdir -p $mysql_datadir
64+innobackupex --copy-back --defaults-file=$topdir/my.cnf $backup_dir
65+
66+run_mysqld
67+# Check sakila
68+${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila
69
70=== modified file 'xtrabackup.c'
71--- xtrabackup.c 2011-09-14 12:48:27 +0000
72+++ xtrabackup.c 2011-09-21 09:42:23 +0000
73@@ -3508,6 +3508,10 @@
74 "async_unbuffered")) {
75 srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
76 #endif
77+#ifdef XTRADB_BASED
78+ } else if (0 == ut_strcmp(srv_file_flush_method_str, "ALL_O_DIRECT")) {
79+ srv_unix_file_flush_method = SRV_UNIX_ALL_O_DIRECT;
80+#endif
81 } else {
82 fprintf(stderr,
83 "xtrabackup: Unrecognized value %s for innodb_flush_method\n",

Subscribers

People subscribed via source and target branches