Merge lp:~akopytov/percona-xtrabackup/bug1261877-2.2 into lp:percona-xtrabackup/2.2

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 4933
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1261877-2.2
Merge into: lp:percona-xtrabackup/2.2
Diff against target: 175 lines (+34/-18)
8 files modified
storage/innobase/fil/fil0fil.cc (+5/-4)
storage/innobase/include/srv0srv.h (+5/-1)
storage/innobase/log/log0log.cc (+9/-4)
storage/innobase/log/log0recv.cc (+5/-1)
storage/innobase/os/os0file.cc (+5/-2)
storage/innobase/srv/srv0start.cc (+3/-0)
storage/innobase/xtrabackup/src/xtrabackup.cc (+2/-3)
storage/innobase/xtrabackup/test/t/bug759225.sh (+0/-3)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1261877-2.2
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+202146@code.launchpad.net
To post a comment you must log in.
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
1=== modified file 'storage/innobase/fil/fil0fil.cc'
2--- storage/innobase/fil/fil0fil.cc 2014-01-09 11:48:43 +0000
3+++ storage/innobase/fil/fil0fil.cc 2014-01-17 17:25:10 +0000
4@@ -148,10 +148,11 @@
5
6 /** Determine if user has explicitly disabled fsync(). */
7 #ifndef __WIN__
8-# define fil_buffering_disabled(s) \
9- ((s)->purpose == FIL_TABLESPACE \
10- && srv_unix_file_flush_method \
11- == SRV_UNIX_O_DIRECT_NO_FSYNC)
12+# define fil_buffering_disabled(s) \
13+ (((s)->purpose == FIL_TABLESPACE \
14+ && srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)\
15+ || ((s)->purpose == FIL_LOG \
16+ && srv_unix_file_flush_method == SRV_UNIX_ALL_O_DIRECT))
17 #else /* __WIN__ */
18 # define fil_buffering_disabled(s) (0)
19 #endif /* __WIN__ */
20
21=== modified file 'storage/innobase/include/srv0srv.h'
22--- storage/innobase/include/srv0srv.h 2013-11-26 10:44:44 +0000
23+++ storage/innobase/include/srv0srv.h 2014-01-17 17:25:10 +0000
24@@ -505,13 +505,17 @@
25 the reason for which is that some FS
26 do not flush meta-data when
27 unbuffered IO happens */
28- SRV_UNIX_O_DIRECT_NO_FSYNC
29+ SRV_UNIX_O_DIRECT_NO_FSYNC,
30 /*!< do not use fsync() when using
31 direct IO i.e.: it can be set to avoid
32 the fsync() call that we make when
33 using SRV_UNIX_O_DIRECT. However, in
34 this case user/DBA should be sure about
35 the integrity of the meta-data */
36+ SRV_UNIX_ALL_O_DIRECT /*!< similar to O_DIRECT, invokes
37+ os_file_set_nocache() on data and log files.
38+ This implies using non-buffered IO but still
39+ using fsync for data but not log files. */
40 };
41
42 /** Alternatives for file i/o in Windows */
43
44=== modified file 'storage/innobase/log/log0log.cc'
45--- storage/innobase/log/log0log.cc 2014-01-09 11:48:43 +0000
46+++ storage/innobase/log/log0log.cc 2014-01-17 17:25:10 +0000
47@@ -1183,6 +1183,7 @@
48 group = (log_group_t*)((ulint) group - 1);
49
50 if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC
51+ && srv_unix_file_flush_method != SRV_UNIX_ALL_O_DIRECT
52 && srv_unix_file_flush_method != SRV_UNIX_NOSYNC) {
53
54 fil_flush(group->space_id);
55@@ -1204,6 +1205,7 @@
56 logs and cannot end up here! */
57
58 if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC
59+ && srv_unix_file_flush_method != SRV_UNIX_ALL_O_DIRECT
60 && srv_unix_file_flush_method != SRV_UNIX_NOSYNC
61 && srv_flush_log_at_trx_commit != 2) {
62
63@@ -1605,9 +1607,11 @@
64
65 mutex_exit(&(log_sys->mutex));
66
67- if (srv_unix_file_flush_method == SRV_UNIX_O_DSYNC) {
68- /* O_DSYNC means the OS did not buffer the log file at all:
69- so we have also flushed to disk what we have written */
70+ if (srv_unix_file_flush_method == SRV_UNIX_O_DSYNC ||
71+ srv_unix_file_flush_method != SRV_UNIX_ALL_O_DIRECT) {
72+ /* O_DSYNC or SRV_UNIX_ALL_O_DIRECT means the OS did not buffer
73+ the log file at all: so we have also flushed to disk what we
74+ have written */
75
76 log_sys->flushed_to_disk_lsn = log_sys->write_lsn;
77
78@@ -2090,7 +2094,8 @@
79 recv_apply_hashed_log_recs(TRUE);
80 }
81
82- if (srv_unix_file_flush_method != SRV_UNIX_NOSYNC) {
83+ if (srv_unix_file_flush_method != SRV_UNIX_NOSYNC
84+ && srv_unix_file_flush_method != SRV_UNIX_ALL_O_DIRECT) {
85 fil_flush_file_spaces(FIL_TABLESPACE);
86 }
87
88
89=== modified file 'storage/innobase/log/log0recv.cc'
90--- storage/innobase/log/log0recv.cc 2013-11-27 08:36:11 +0000
91+++ storage/innobase/log/log0recv.cc 2014-01-17 17:25:10 +0000
92@@ -3103,9 +3103,13 @@
93 lsn_t archived_lsn;
94 #endif /* UNIV_LOG_ARCHIVE */
95 byte* buf;
96- byte log_hdr_buf[LOG_FILE_HDR_SIZE];
97+ byte* log_hdr_buf;
98+ byte log_hdr_buf_base[LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE];
99 dberr_t err;
100
101+ log_hdr_buf = static_cast<byte *>
102+ (ut_align(log_hdr_buf_base, OS_FILE_LOG_BLOCK_SIZE));
103+
104 #ifdef UNIV_LOG_ARCHIVE
105 ut_ad(type != LOG_CHECKPOINT || limit_lsn == LSN_MAX);
106 /** TRUE when recovering from a checkpoint */
107
108=== modified file 'storage/innobase/os/os0file.cc'
109--- storage/innobase/os/os0file.cc 2014-01-09 11:48:43 +0000
110+++ storage/innobase/os/os0file.cc 2014-01-17 17:25:10 +0000
111@@ -1750,8 +1750,6 @@
112
113 } while (retry);
114
115- /* We disable OS caching (O_DIRECT) only on data files */
116-
117 if (!srv_read_only_mode
118 && *success
119 && type != OS_LOG_FILE
120@@ -1759,6 +1757,11 @@
121 || srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)) {
122
123 os_file_set_nocache(file, name, mode_str);
124+ } else if (!srv_read_only_mode
125+ && *success
126+ && srv_unix_file_flush_method == SRV_UNIX_ALL_O_DIRECT) {
127+
128+ os_file_set_nocache(file, name, mode_str);
129 }
130
131 #ifdef USE_FILE_LOCK
132
133=== modified file 'storage/innobase/srv/srv0start.cc'
134--- storage/innobase/srv/srv0start.cc 2014-01-09 11:48:43 +0000
135+++ storage/innobase/srv/srv0start.cc 2014-01-17 17:25:10 +0000
136@@ -1709,6 +1709,9 @@
137 } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT")) {
138 srv_unix_file_flush_method = SRV_UNIX_O_DIRECT;
139
140+ } else if (0 == ut_strcmp(srv_file_flush_method_str, "ALL_O_DIRECT")) {
141+ srv_unix_file_flush_method = SRV_UNIX_ALL_O_DIRECT;
142+
143 } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT_NO_FSYNC")) {
144 srv_unix_file_flush_method = SRV_UNIX_O_DIRECT_NO_FSYNC;
145
146
147=== modified file 'storage/innobase/xtrabackup/src/xtrabackup.cc'
148--- storage/innobase/xtrabackup/src/xtrabackup.cc 2014-01-12 12:50:44 +0000
149+++ storage/innobase/xtrabackup/src/xtrabackup.cc 2014-01-17 17:25:10 +0000
150@@ -2928,9 +2928,8 @@
151 } else if (0 == ut_strcmp(srv_file_flush_method_str, "nosync")) {
152 srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
153 } else if (0 == ut_strcmp(srv_file_flush_method_str, "ALL_O_DIRECT")) {
154- /* ALL_O_DIRECT is currently accepted, but ignored by
155- XtraBackup */
156- msg("xtrabackup: ignoring innodb_flush_method=ALL_O_DIRECT\n");
157+ srv_unix_file_flush_method = SRV_UNIX_ALL_O_DIRECT;
158+ msg("xtrabackup: using ALL_O_DIRECT\n");
159 } else if (0 == ut_strcmp(srv_file_flush_method_str,
160 "O_DIRECT_NO_FSYNC")) {
161 srv_unix_file_flush_method = SRV_UNIX_O_DIRECT_NO_FSYNC;
162
163=== modified file 'storage/innobase/xtrabackup/test/t/bug759225.sh'
164--- storage/innobase/xtrabackup/test/t/bug759225.sh 2013-11-26 10:44:44 +0000
165+++ storage/innobase/xtrabackup/test/t/bug759225.sh 2014-01-17 17:25:10 +0000
166@@ -12,9 +12,6 @@
167
168 require_xtradb
169
170-# ALL_O_DIRECT is not supported in XtraDB 5.6 ATM.
171-require_server_version_lower_than 5.6.1
172-
173 MYSQLD_EXTRA_MY_CNF_OPTS="
174 innodb_flush_method=ALL_O_DIRECT
175 "

Subscribers

People subscribed via source and target branches

to all changes: