0001-Rename-io_direct-to-debug_io_direct.patch
text/x-patch
Filename: 0001-Rename-io_direct-to-debug_io_direct.patch
Type: text/x-patch
Part: 0
Message:
Re: Direct I/O
Patch
Format: format-patch
Series: patch 0001
Subject: Rename io_direct to debug_io_direct.
| File | + | − |
|---|---|---|
| doc/src/sgml/config.sgml | 32 | 32 |
| src/backend/utils/misc/guc_tables.c | 1 | 1 |
| src/test/modules/test_misc/t/004_io_direct.pl | 1 | 1 |
From f95fc08c47c7d429950e8f22ce93c35271adfb37 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Mon, 1 May 2023 14:03:30 +1200
Subject: [PATCH] Rename io_direct to debug_io_direct.
Give the new GUC introduced by d4e71df6 a name that is clearly not
intended for mainstream use quite yet.
Future proposals would drop the prefix only after adding infrastructure
to make it efficient. Having the switch in the tree sooner is good
because it might lead to new discoveries about the hazards awaiting us
on a wide range of systems, but that name was too enticing and could
lead to cross-version confusion in future, per complaints from Noah and
Justin.
Suggested-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Justin Pryzby <pryzby@telsasoft.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/20230430041106.GA2268796%40rfd.leadboat.com
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index b56f073a91..4f4b5b0b74 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -11159,6 +11159,38 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
</listitem>
</varlistentry>
+ <varlistentry id="guc-debug-io-direct" xreflabel="debug_io_direct">
+ <term><varname>debug_io_direct</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>debug_io_direct</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Ask the kernel to minimize caching effects for relation data and WAL
+ files using <literal>O_DIRECT</literal> (most Unix-like systems),
+ <literal>F_NOCACHE</literal> (macOS) or
+ <literal>FILE_FLAG_NO_BUFFERING</literal> (Windows).
+ </para>
+ <para>
+ May be set to an empty string (the default) to disable use of direct
+ I/O, or a comma-separated list of operations that should use direct I/O.
+ The valid options are <literal>data</literal> for
+ main data files, <literal>wal</literal> for WAL files, and
+ <literal>wal_init</literal> for WAL files when being initially
+ allocated.
+ </para>
+ <para>
+ Some operating systems and file systems do not support direct I/O, so
+ non-default settings may be rejected at startup or cause errors.
+ </para>
+ <para>
+ Currently this feature reduces performance, and is intended for
+ developer testing only.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="guc-debug-parallel-query" xreflabel="debug_parallel_query">
<term><varname>debug_parallel_query</varname> (<type>enum</type>)
<indexterm>
@@ -11220,38 +11252,6 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
</listitem>
</varlistentry>
- <varlistentry id="guc-io-direct" xreflabel="io_direct">
- <term><varname>io_direct</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>io_direct</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Ask the kernel to minimize caching effects for relation data and WAL
- files using <literal>O_DIRECT</literal> (most Unix-like systems),
- <literal>F_NOCACHE</literal> (macOS) or
- <literal>FILE_FLAG_NO_BUFFERING</literal> (Windows).
- </para>
- <para>
- May be set to an empty string (the default) to disable use of direct
- I/O, or a comma-separated list of operations that should use direct I/O.
- The valid options are <literal>data</literal> for
- main data files, <literal>wal</literal> for WAL files, and
- <literal>wal_init</literal> for WAL files when being initially
- allocated.
- </para>
- <para>
- Some operating systems and file systems do not support direct I/O, so
- non-default settings may be rejected at startup or cause errors.
- </para>
- <para>
- Currently this feature reduces performance, and is intended for
- developer testing only.
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry id="guc-post-auth-delay" xreflabel="post_auth_delay">
<term><varname>post_auth_delay</varname> (<type>integer</type>)
<indexterm>
diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c
index 2f42cebaf6..9f9cf7ce66 100644
--- a/src/backend/utils/misc/guc_tables.c
+++ b/src/backend/utils/misc/guc_tables.c
@@ -4568,7 +4568,7 @@ struct config_string ConfigureNamesString[] =
},
{
- {"io_direct", PGC_POSTMASTER, DEVELOPER_OPTIONS,
+ {"debug_io_direct", PGC_POSTMASTER, DEVELOPER_OPTIONS,
gettext_noop("Use direct I/O for file access."),
NULL,
GUC_LIST_INPUT | GUC_NOT_IN_SAMPLE
diff --git a/src/test/modules/test_misc/t/004_io_direct.pl b/src/test/modules/test_misc/t/004_io_direct.pl
index b8814bb640..dddcfb1aa9 100644
--- a/src/test/modules/test_misc/t/004_io_direct.pl
+++ b/src/test/modules/test_misc/t/004_io_direct.pl
@@ -40,7 +40,7 @@ my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
$node->append_conf(
'postgresql.conf', qq{
-io_direct = 'data,wal,wal_init'
+debug_io_direct = 'data,wal,wal_init'
shared_buffers = '256kB' # tiny to force I/O
wal_level = replica # minimal runs out of shared_buffers when set so tiny
});
--
2.39.2