Move posix_fadvise to xb_file_set_nocache

Bug #1067485 reported by Raghavendra D Prabhu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Invalid
Undecided
Unassigned

Bug Description

In xtrabackup code I noticed posix_fadvise being used in O_DIRECT context as well.

Mainly,
 posix_fadvise(src_file, 0, 0, POSIX_FADV_SEQUENTIAL);
 posix_fadvise(src_file, 0, 0, POSIX_FADV_DONTNEED);

POSIX_FADV_SEQUENTIAL is helpful only while doing non direct-io.

Regarding POSIX_FADV_DONTNEED, it doesn't harm but it is redundant since filesystem code will invalidate the cached pages in any case, before doing the direct-io. (it should to maintain consistency so all filesystems do that).

They can be moved to xb_file_set_nocache to the 'else' condition of

 if (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT) {
  os_file_set_nocache(fd, file_name, operation_name);
 }

Revision history for this message
Alexey Kopytov (akopytov) wrote :

See also bug #1096828.

Revision history for this message
Alexey Kopytov (akopytov) wrote :

I think we discussed elsewhere that this report assumes specific implementation and there is actually no negative impact if posix_fadvise() hints are used correctly.

no longer affects: percona-xtrabackup/2.2
no longer affects: percona-xtrabackup/2.1
no longer affects: percona-xtrabackup/2.0
Changed in percona-xtrabackup:
status: Triaged → Invalid
importance: Low → Undecided
milestone: future-2.2-releases → none
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-85

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.