On Tue, Nov 01, 2022 at 08:36:18PM +1300, Thomas Munro wrote: > Hi, > > Here is a patch to allow PostgreSQL to use $SUBJECT. It is from the > AIO patch-set[1]. It adds three new settings, defaulting to off: > > io_data_direct = whether to use O_DIRECT for main data files > io_wal_direct = ... for WAL > io_wal_init_direct = ... for WAL-file initialisation
You added 3 booleans, but I wonder if it's better to add a string GUC which is parsed for comma separated strings. (By "better", I mean reducing the number of new GUCs - which is less important for developer GUCs anyway.) DIO is slower, but not so much that it can't run under CI. I suggest to add an 099 commit to enable the feature during development. Note that this fails under linux with fsanitize=align: ../src/backend/storage/file/buffile.c:117:17: runtime error: member access within misaligned address 0x561a4a8e40f8 for type 'struct BufFile', which requires 4096 byte alignment -- Justin