Skip to content

Commit

Permalink
MDEV-15779 - mariabackup incremental prepare fails on CIFS mount.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vaintroub committed Apr 12, 2018
1 parent 1507122 commit c2dc72c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) *
Expand Down Expand Up @@ -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++;
}

Expand Down

0 comments on commit c2dc72c

Please sign in to comment.