From 6150103c1e2f8ceafda43d4d7d0beec62368e72e Mon Sep 17 00:00:00 2001 From: Nazir Bilal Yavuz Date: Wed, 9 Sep 2026 14:16:40 +0300 Subject: [PATCH v2 8/8] aio: doc: Document AIO fsync Describe the fsync operation and sync and sync_filetag targets exposed by pg_aios, including the NULL offset and length for synchronization operations. Explain that crash-recovery file synchronization can overlap with io_uring but runs synchronously with the worker method because workers cannot reopen these path-only targets. Distinguish this fallback from relation and SLRU synchronization during checkpoints. Discussion: https://postgr.es/m/CAN55FZ0vLWJQNB%3DHuHXG2wabFjXJd6OWTa3%3DkRzwObdZD9poHQ%40mail.gmail.com --- doc/src/sgml/config.sgml | 10 ++++++++++ doc/src/sgml/system-views.sgml | 22 ++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 0165eb9ec02..984be7c7167 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -12292,6 +12292,16 @@ dynamic_library_path = '/usr/local/lib/postgresql:$libdir' starting a database cluster that did not shut down cleanly, including copies created with pg_basebackup. + + When this parameter is set to fsync and + is set to io_uring, + multiple file synchronization operations can run concurrently. + With worker or sync, these + operations run synchronously in the startup process. Unlike relation + and SLRU synchronization during checkpoints, data-directory + synchronization does not provide the information needed for I/O + workers to reopen the files. + On Linux, syncfs may be used instead, to ask the operating system to synchronize the file systems that contain the diff --git a/doc/src/sgml/system-views.sgml b/doc/src/sgml/system-views.sgml index 77202e2c765..9ed5e1b7d49 100644 --- a/doc/src/sgml/system-views.sgml +++ b/doc/src/sgml/system-views.sgml @@ -387,6 +387,12 @@ writev, a vectored write + + + fsync, file synchronization using + fsync() or fdatasync() + + @@ -396,7 +402,7 @@ off int8 - Offset of the I/O operation. + Offset of the I/O operation, or NULL for fsync. @@ -405,7 +411,7 @@ length int8 - Length of the I/O operation. + Length of the I/O operation, or NULL for fsync. @@ -421,6 +427,18 @@ smgr, I/O on relations + + + sync, file synchronization using a process-local + file descriptor + + + + + sync_filetag, file synchronization identified by + a file tag, currently used for SLRU segments + + -- 2.47.3