On Sun, Apr 30, 2023 at 6:35 PM Thomas Munro <thomas.mu...@gmail.com> wrote:
> On Sun, Apr 30, 2023 at 4:11 PM Noah Misch <n...@leadboat.com> wrote:
> > Speaking of the developer-only status, I find the io_direct name more 
> > enticing
> > than force_parallel_mode, which PostgreSQL renamed due to overuse from 
> > people
> > expecting non-developer benefits.  Should this have a name starting with
> > debug_?
>
> Hmm, yeah I think people coming from other databases would be tempted
> by it.  But, unlike the
> please-jam-a-gather-node-on-top-of-the-plan-so-I-can-debug-the-parallel-executor
> switch, I think of this thing more like an experimental feature that
> is just waiting for more features to make it useful.  What about a
> warning message about that at startup if it's on?

Something like this?  Better words welcome.

$ ~/install//bin/postgres -D pgdata -c io_direct=data
2023-05-01 09:44:37.460 NZST [99675] LOG:  starting PostgreSQL 16devel
on x86_64-unknown-freebsd13.2, compiled by FreeBSD clang version
14.0.5 (https://github.com/llvm/llvm-project.git
llvmorg-14.0.5-0-gc12386ae247c), 64-bit
2023-05-01 09:44:37.460 NZST [99675] LOG:  listening on IPv6 address
"::1", port 5432
2023-05-01 09:44:37.460 NZST [99675] LOG:  listening on IPv4 address
"127.0.0.1", port 5432
2023-05-01 09:44:37.461 NZST [99675] LOG:  listening on Unix socket
"/tmp/.s.PGSQL.5432"
2023-05-01 09:44:37.463 NZST [99675] WARNING:  io_direct is an
experimental setting for developer testing only
2023-05-01 09:44:37.463 NZST [99675] HINT:  File I/O may be
inefficient or not work on some file systems.
2023-05-01 09:44:37.465 NZST [99678] LOG:  database system was shut
down at 2023-05-01 09:43:51 NZST
2023-05-01 09:44:37.468 NZST [99675] LOG:  database system is ready to
accept connections
From a9005129c939a8298c6668645588b2a8ef5064b6 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.mu...@gmail.com>
Date: Mon, 1 May 2023 09:46:35 +1200
Subject: [PATCH] Log a warning about io_direct at startup time.

We've documented io_direct as an experimental developer-only feature,
but that documentation might be hard to find.  Let's also display a
warning about that in the server log.

Later proposals will provide the infrastructure to use it efficiently,
but by releasing this switch earlier we can learn about direct I/O
quirks in systems in the wild.

Discussion: https://postgr.es/m/20230430041106.GA2268796%40rfd.leadboat.com

diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 4c49393fc5..8f5c03fa46 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -1432,6 +1432,12 @@ PostmasterMain(int argc, char *argv[])
 				 errhint("Set the LC_ALL environment variable to a valid locale.")));
 #endif
 
+	/* Temporary warning about experimental status of direct I/O support. */
+	if (io_direct_flags != 0)
+		ereport(WARNING,
+				(errmsg("io_direct is an experimental setting for developer testing only"),
+				 errhint("File I/O may be inefficient or not work on some file systems.")));
+
 	/*
 	 * Remember postmaster startup time
 	 */
-- 
2.40.1

Reply via email to