Re: pread() and pwrite()

Jesper Pedersen <jesper.pedersen@redhat.com>

From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, Thomas Munro <thomas.munro@enterprisedb.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Magnus Hagander <magnus@hagander.net>, Oskari Saarenmaa <os@ohmu.fi>, Pg Hackers <pgsql-hackers@postgresql.org>, Tobias Oberstein <tobias.oberstein@gmail.com>
Date: 2018-11-07T15:05:02Z
Lists: pgsql-hackers

Attachments

Hi Tom,

On 11/7/18 9:30 AM, Tom Lane wrote:
> I'm confused by this.  Surely the pwrite-based code is writing exactly the
> same data as before.  Do we have to conclude that valgrind is complaining
> about passing uninitialized data to pwrite() when it did not complain
> about exactly the same thing for write()?
> 
> [ looks ... ]  No, what we have to conclude is that the write-related
> suppressions in src/tools/valgrind.supp need to be replaced or augmented
> with pwrite-related ones.
> 

The attached patch fixes this for me.

Unfortunately pwrite* doesn't work for the pwrite64(buf) line.

Best regards,
  Jesper

Commits

  1. Use pg_pread() and pg_pwrite() for data files and WAL.

  2. Provide pg_pread() and pg_pwrite() for random I/O.

  3. Convert some long lists in configure.in to one-line-per-entry style.