Re: Direct I/O

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>, Andres Freund <andres@anarazel.de>, Andrew Dunstan <andrew@dunslane.net>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, Christoph Berg <myon@debian.org>, mikael.kjellstrom@gmail.com, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-04-17T16:06:23Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Sat, Apr 15, 2023 at 2:19 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I get the impression that we are going to need an actual runtime
>> test if we want to defend against this.  Not entirely convinced
>> it's worth the trouble.  Who, other than our deliberately rear-guard
>> buildfarm animals, is going to be building modern PG with such old
>> compilers?  (And more especially to the point, on platforms new
>> enough to have working O_DIRECT?)

> I don't think that I fully understand everything under discussion
> here, but I would just like to throw in a vote for trying to make
> failures as comprehensible as we reasonably can.

I'm not hugely concerned about this yet.  I think the reason for
slipping this into v16 as developer-only code is exactly that we need
to get a feeling for where the portability dragons live.  When (and
if) we try to make O_DIRECT mainstream, yes we'd better be sure that
any known failure cases are reported well.  But we need the data
about which those are, first.

			regards, tom lane



Commits

  1. Rename hook functions for debug_io_direct to match variable name.

  2. Rename io_direct to debug_io_direct.

  3. Skip the 004_io_direct.pl test if a pre-flight check fails.

  4. Use higher wal_level for 004_io_direct.pl.

  5. Skip \password TAP test on old IPC::Run versions

  6. Add io_direct setting (developer-only).

  7. Introduce PG_IO_ALIGN_SIZE and align all I/O buffers.

  8. Add palloc_aligned() to allow aligned memory allocations

  9. initdb: When running CREATE DATABASE, use STRATEGY = WAL_COPY.