postgres.git / summary / log / commit / refs
commit 75829f043992ee863111d245197f8442774501b6
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Thu Nov 19 12:42:20 2026 +0000
Fix setting skip_fsync on temp tables
The intention was to always skip fsync for temporary relations, but
the condition was inverted, so skip_fsync was set to false for
temporary relations. This has no user-visible effect at the moment,
because the skip_fsync field isn't used anywhere (only reads go
through AIO currently).
While here, fix a copy-pasto in the smgrwritev() comment, which said
"read" where it meant "written".
Author: Sergey Shinderuk <s.shinderuk@postgrespro.ru>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Yuefei Shi <shiyuefei1004@gmail.com>
Discussion: https://www.postgresql.org/message-id/A96F1990-57F8-4566-B55D-43D6087EE313@postgrespro.ru
Backpatch-through: 18
src/backend/storage/smgr/smgr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c
index 37b99fa3198..9e315019f52 100644
--- a/src/backend/storage/smgr/smgr.c
+++ b/src/backend/storage/smgr/smgr.c
@@ -784,7 +784,7 @@ smgrstartreadv(PgAioHandle *ioh,
* fsync the relation, so we needn't bother. Temporary relations also
* do not require fsync.
*
- * If more than one block is intended to be read, callers need to use
+ * If more than one block is intended to be written, callers need to use
* smgrmaxcombine() to check how many blocks can be combined into one IO.
*/
void
@@ -1053,7 +1053,7 @@ pgaio_io_set_target_smgr(PgAioHandle *ioh,
sd->smgr.nblocks = nblocks;
sd->smgr.is_temp = SmgrIsTemp(smgr);
/* Temp relations should never be fsync'd */
- sd->smgr.skip_fsync = skip_fsync && !SmgrIsTemp(smgr);
+ sd->smgr.skip_fsync = skip_fsync || SmgrIsTemp(smgr);
}
/*
[parent: a7373be91caa]