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
=== modified file 'storage/innobase/fil/fil0fil.cc'
--- storage/innobase/fil/fil0fil.cc 2014-01-09 11:48:43 +0000
+++ storage/innobase/fil/fil0fil.cc 2014-01-17 17:25:10 +0000
@@ -148,10 +148,11 @@
148148
149/** Determine if user has explicitly disabled fsync(). */149/** Determine if user has explicitly disabled fsync(). */
150#ifndef __WIN__150#ifndef __WIN__
151# define fil_buffering_disabled(s) \151# define fil_buffering_disabled(s) \
152 ((s)->purpose == FIL_TABLESPACE \152 (((s)->purpose == FIL_TABLESPACE \
153 && srv_unix_file_flush_method \153 && srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)\
154 == SRV_UNIX_O_DIRECT_NO_FSYNC)154 || ((s)->purpose == FIL_LOG \
155 && srv_unix_file_flush_method == SRV_UNIX_ALL_O_DIRECT))
155#else /* __WIN__ */156#else /* __WIN__ */
156# define fil_buffering_disabled(s) (0)157# define fil_buffering_disabled(s) (0)
157#endif /* __WIN__ */158#endif /* __WIN__ */
158159
=== modified file 'storage/innobase/include/srv0srv.h'
--- storage/innobase/include/srv0srv.h 2013-11-26 10:44:44 +0000
+++ storage/innobase/include/srv0srv.h 2014-01-17 17:25:10 +0000
@@ -505,13 +505,17 @@
505 the reason for which is that some FS505 the reason for which is that some FS
506 do not flush meta-data when506 do not flush meta-data when
507 unbuffered IO happens */507 unbuffered IO happens */
508 SRV_UNIX_O_DIRECT_NO_FSYNC508 SRV_UNIX_O_DIRECT_NO_FSYNC,
509 /*!< do not use fsync() when using509 /*!< do not use fsync() when using
510 direct IO i.e.: it can be set to avoid510 direct IO i.e.: it can be set to avoid
511 the fsync() call that we make when511 the fsync() call that we make when
512 using SRV_UNIX_O_DIRECT. However, in512 using SRV_UNIX_O_DIRECT. However, in
513 this case user/DBA should be sure about513 this case user/DBA should be sure about
514 the integrity of the meta-data */514 the integrity of the meta-data */
515 SRV_UNIX_ALL_O_DIRECT /*!< similar to O_DIRECT, invokes
516 os_file_set_nocache() on data and log files.
517 This implies using non-buffered IO but still
518 using fsync for data but not log files. */
515};519};
516520
517/** Alternatives for file i/o in Windows */521/** Alternatives for file i/o in Windows */
518522
=== modified file 'storage/innobase/log/log0log.cc'
--- storage/innobase/log/log0log.cc 2014-01-09 11:48:43 +0000
+++ storage/innobase/log/log0log.cc 2014-01-17 17:25:10 +0000
@@ -1183,6 +1183,7 @@
1183 group = (log_group_t*)((ulint) group - 1);1183 group = (log_group_t*)((ulint) group - 1);
11841184
1185 if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC1185 if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC
1186 && srv_unix_file_flush_method != SRV_UNIX_ALL_O_DIRECT
1186 && srv_unix_file_flush_method != SRV_UNIX_NOSYNC) {1187 && srv_unix_file_flush_method != SRV_UNIX_NOSYNC) {
11871188
1188 fil_flush(group->space_id);1189 fil_flush(group->space_id);
@@ -1204,6 +1205,7 @@
1204 logs and cannot end up here! */1205 logs and cannot end up here! */
12051206
1206 if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC1207 if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC
1208 && srv_unix_file_flush_method != SRV_UNIX_ALL_O_DIRECT
1207 && srv_unix_file_flush_method != SRV_UNIX_NOSYNC1209 && srv_unix_file_flush_method != SRV_UNIX_NOSYNC
1208 && srv_flush_log_at_trx_commit != 2) {1210 && srv_flush_log_at_trx_commit != 2) {
12091211
@@ -1605,9 +1607,11 @@
16051607
1606 mutex_exit(&(log_sys->mutex));1608 mutex_exit(&(log_sys->mutex));
16071609
1608 if (srv_unix_file_flush_method == SRV_UNIX_O_DSYNC) {1610 if (srv_unix_file_flush_method == SRV_UNIX_O_DSYNC ||
1609 /* O_DSYNC means the OS did not buffer the log file at all:1611 srv_unix_file_flush_method != SRV_UNIX_ALL_O_DIRECT) {
1610 so we have also flushed to disk what we have written */1612 /* O_DSYNC or SRV_UNIX_ALL_O_DIRECT means the OS did not buffer
1613 the log file at all: so we have also flushed to disk what we
1614 have written */
16111615
1612 log_sys->flushed_to_disk_lsn = log_sys->write_lsn;1616 log_sys->flushed_to_disk_lsn = log_sys->write_lsn;
16131617
@@ -2090,7 +2094,8 @@
2090 recv_apply_hashed_log_recs(TRUE);2094 recv_apply_hashed_log_recs(TRUE);
2091 }2095 }
20922096
2093 if (srv_unix_file_flush_method != SRV_UNIX_NOSYNC) {2097 if (srv_unix_file_flush_method != SRV_UNIX_NOSYNC
2098 && srv_unix_file_flush_method != SRV_UNIX_ALL_O_DIRECT) {
2094 fil_flush_file_spaces(FIL_TABLESPACE);2099 fil_flush_file_spaces(FIL_TABLESPACE);
2095 }2100 }
20962101
20972102
=== modified file 'storage/innobase/log/log0recv.cc'
--- storage/innobase/log/log0recv.cc 2013-11-27 08:36:11 +0000
+++ storage/innobase/log/log0recv.cc 2014-01-17 17:25:10 +0000
@@ -3103,9 +3103,13 @@
3103 lsn_t archived_lsn;3103 lsn_t archived_lsn;
3104#endif /* UNIV_LOG_ARCHIVE */3104#endif /* UNIV_LOG_ARCHIVE */
3105 byte* buf;3105 byte* buf;
3106 byte log_hdr_buf[LOG_FILE_HDR_SIZE];3106 byte* log_hdr_buf;
3107 byte log_hdr_buf_base[LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE];
3107 dberr_t err;3108 dberr_t err;
31083109
3110 log_hdr_buf = static_cast<byte *>
3111 (ut_align(log_hdr_buf_base, OS_FILE_LOG_BLOCK_SIZE));
3112
3109#ifdef UNIV_LOG_ARCHIVE3113#ifdef UNIV_LOG_ARCHIVE
3110 ut_ad(type != LOG_CHECKPOINT || limit_lsn == LSN_MAX);3114 ut_ad(type != LOG_CHECKPOINT || limit_lsn == LSN_MAX);
3111/** TRUE when recovering from a checkpoint */3115/** TRUE when recovering from a checkpoint */
31123116
=== modified file 'storage/innobase/os/os0file.cc'
--- storage/innobase/os/os0file.cc 2014-01-09 11:48:43 +0000
+++ storage/innobase/os/os0file.cc 2014-01-17 17:25:10 +0000
@@ -1750,8 +1750,6 @@
17501750
1751 } while (retry);1751 } while (retry);
17521752
1753 /* We disable OS caching (O_DIRECT) only on data files */
1754
1755 if (!srv_read_only_mode1753 if (!srv_read_only_mode
1756 && *success1754 && *success
1757 && type != OS_LOG_FILE1755 && type != OS_LOG_FILE
@@ -1759,6 +1757,11 @@
1759 || srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)) {1757 || srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)) {
17601758
1761 os_file_set_nocache(file, name, mode_str);1759 os_file_set_nocache(file, name, mode_str);
1760 } else if (!srv_read_only_mode
1761 && *success
1762 && srv_unix_file_flush_method == SRV_UNIX_ALL_O_DIRECT) {
1763
1764 os_file_set_nocache(file, name, mode_str);
1762 }1765 }
17631766
1764#ifdef USE_FILE_LOCK1767#ifdef USE_FILE_LOCK
17651768
=== modified file 'storage/innobase/srv/srv0start.cc'
--- storage/innobase/srv/srv0start.cc 2014-01-09 11:48:43 +0000
+++ storage/innobase/srv/srv0start.cc 2014-01-17 17:25:10 +0000
@@ -1709,6 +1709,9 @@
1709 } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT")) {1709 } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT")) {
1710 srv_unix_file_flush_method = SRV_UNIX_O_DIRECT;1710 srv_unix_file_flush_method = SRV_UNIX_O_DIRECT;
17111711
1712 } else if (0 == ut_strcmp(srv_file_flush_method_str, "ALL_O_DIRECT")) {
1713 srv_unix_file_flush_method = SRV_UNIX_ALL_O_DIRECT;
1714
1712 } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT_NO_FSYNC")) {1715 } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT_NO_FSYNC")) {
1713 srv_unix_file_flush_method = SRV_UNIX_O_DIRECT_NO_FSYNC;1716 srv_unix_file_flush_method = SRV_UNIX_O_DIRECT_NO_FSYNC;
17141717
17151718
=== modified file 'storage/innobase/xtrabackup/src/xtrabackup.cc'
--- storage/innobase/xtrabackup/src/xtrabackup.cc 2014-01-12 12:50:44 +0000
+++ storage/innobase/xtrabackup/src/xtrabackup.cc 2014-01-17 17:25:10 +0000
@@ -2928,9 +2928,8 @@
2928 } else if (0 == ut_strcmp(srv_file_flush_method_str, "nosync")) {2928 } else if (0 == ut_strcmp(srv_file_flush_method_str, "nosync")) {
2929 srv_unix_file_flush_method = SRV_UNIX_NOSYNC;2929 srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
2930 } else if (0 == ut_strcmp(srv_file_flush_method_str, "ALL_O_DIRECT")) {2930 } else if (0 == ut_strcmp(srv_file_flush_method_str, "ALL_O_DIRECT")) {
2931 /* ALL_O_DIRECT is currently accepted, but ignored by2931 srv_unix_file_flush_method = SRV_UNIX_ALL_O_DIRECT;
2932 XtraBackup */2932 msg("xtrabackup: using ALL_O_DIRECT\n");
2933 msg("xtrabackup: ignoring innodb_flush_method=ALL_O_DIRECT\n");
2934 } else if (0 == ut_strcmp(srv_file_flush_method_str,2933 } else if (0 == ut_strcmp(srv_file_flush_method_str,
2935 "O_DIRECT_NO_FSYNC")) {2934 "O_DIRECT_NO_FSYNC")) {
2936 srv_unix_file_flush_method = SRV_UNIX_O_DIRECT_NO_FSYNC;2935 srv_unix_file_flush_method = SRV_UNIX_O_DIRECT_NO_FSYNC;
29372936
=== modified file 'storage/innobase/xtrabackup/test/t/bug759225.sh'
--- storage/innobase/xtrabackup/test/t/bug759225.sh 2013-11-26 10:44:44 +0000
+++ storage/innobase/xtrabackup/test/t/bug759225.sh 2014-01-17 17:25:10 +0000
@@ -12,9 +12,6 @@
1212
13require_xtradb13require_xtradb
1414
15# ALL_O_DIRECT is not supported in XtraDB 5.6 ATM.
16require_server_version_lower_than 5.6.1
17
18MYSQLD_EXTRA_MY_CNF_OPTS="15MYSQLD_EXTRA_MY_CNF_OPTS="
19innodb_flush_method=ALL_O_DIRECT16innodb_flush_method=ALL_O_DIRECT
20"17"

Subscribers

People subscribed via source and target branches

to all changes: