summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-04-12 12:09:32 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2018-04-12 12:09:32 +0100
commitc2dc72c0c3952a43e29b374de83ecd4bdfa58e74 (patch)
treeb19d6f97ba0e7f71b404a91d74b8bba98e3a6210 /extra
parent15071226a04125976e19a552103821eeb7227d75 (diff)
downloadmariadb-git-c2dc72c0c3952a43e29b374de83ecd4bdfa58e74.tar.gz
MDEV-15779 - mariabackup incremental prepare fails on CIFS mount.
CIFS does not like O_DIRECT flag (it is set successfully, but pread would fail). The fix is not to use O_DIRECT, there is not need for it. posix_fadvise() was used already that should prevent buffer cache pollution on Linux. As recommended by documentation of posix_fadvise(), we'll also fsync() tablespaces after a batch of writes.
Diffstat (limited to 'extra')
-rw-r--r--extra/mariabackup/xtrabackup.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 02432dbb5b1..c4d385fef5e 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -4966,8 +4966,6 @@ xtrabackup_apply_delta(
posix_fadvise(src_file, 0, 0, POSIX_FADV_SEQUENTIAL);
- os_file_set_nocache(src_file, src_path, "OPEN");
-
dst_file = xb_delta_open_matching_space(
dbname, space_name, info.space_id, info.zip_size,
dst_path, sizeof(dst_path), &success);
@@ -4978,8 +4976,6 @@ xtrabackup_apply_delta(
posix_fadvise(dst_file, 0, 0, POSIX_FADV_DONTNEED);
- os_file_set_nocache(dst_file, dst_path, "OPEN");
-
/* allocate buffer for incremental backup (4096 pages) */
incremental_buffer_base = static_cast<byte *>
(ut_malloc((page_size / 4 + 1) *
@@ -5079,6 +5075,13 @@ xtrabackup_apply_delta(
}
}
+ /* Free file system buffer cache after the batch was written. */
+#ifdef __linux__
+ os_file_flush_func(dst_file);
+#endif
+ posix_fadvise(dst_file, 0, 0, POSIX_FADV_DONTNEED);
+
+
incremental_buffers++;
}