Commit c2dc72c0 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

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.
parent 15071226
......@@ -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++;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment