Re: O_DIRECT on macOS

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-05-30T22:31:42Z
Lists: pgsql-hackers
On Mon, May 31, 2021 at 4:19 AM Justin Pryzby <pryzby@telsasoft.com> wrote:
> Should there be an "else" to warn/error in the case that "direct" is requested
> but not supported?

The way we use O_DIRECT currently is extremely minimal, it's just "if
you've got it, we'll use it, but otherwise not complain", and I wasn't
trying to change that yet, but you're right that if we add explicit
GUCs to turn on direct I/O for WAL and data files we should definitely
not let you turn them on if we can't do it.



Commits

  1. Don't use #if inside function-like macro arguments.

  2. Support direct I/O on macOS.