Incorrect posix_fadvise in stream_one_file

Bug #1096828 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
Triaged
Medium
Unassigned
2.0
Triaged
Medium
Unassigned
2.1
Triaged
Medium
Unassigned
2.2
Triaged
Medium
Unassigned

Bug Description

Earlier reported in lp:1095249

a)
stream_one_file(File file, xb_wstream_file_t *xbfile)
{
 uchar buf[XBSTREAM_BUFFER_SIZE];
 size_t bytes;

 posix_fadvise(file, 0, 0, POSIX_FADV_SEQUENTIAL);

 while ((bytes = my_read(file, buf, XBSTREAM_BUFFER_SIZE,
    MYF(MY_WME))) > 0) {
  if (xb_stream_write_data(xbfile, buf, bytes)) {
   msg("%s: xb_stream_write_data() failed.\n",
       my_progname);
   return 1;
  }
  posix_fadvise(file, 0, 0, POSIX_FADV_DONTNEED);

 }
......
.....

here, it is doing fadvise POSIX_FADV_SEQ which doubles the
readahead but in the loop it discards it everytime. It should
either do POSIX_FADV_DONTNEED at the end (outside the loop) or
use ranges with POSIX_FADV_DONTNEED in the loop.

b) There are many other places where it is used which will need to be checked (since with O_DIRECT used all of the posix_fadvise serve no purpose)

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

See also bug #1067485.

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

This was fixed along with bug #1093385 in 2.1.8. It is essentially a duplicate of that bug.

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-35

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.