]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Add file_extend_method=posix_fallocate,write_zeros.
authorThomas Munro <tmunro@postgresql.org>
Sat, 31 May 2025 10:50:22 +0000 (22:50 +1200)
committerThomas Munro <tmunro@postgresql.org>
Fri, 6 Feb 2026 04:38:49 +0000 (17:38 +1300)
commitf94e9141a0bbb365f8194517e142746466ee7014
treece5913eca872b38ea1ce0b7aef7f719f3d02237e
parente35add48ccc2e5aa94de360f1a43c6c150bda54a
Add file_extend_method=posix_fallocate,write_zeros.

Provide a way to disable the use of posix_fallocate() for relation
files.  It was introduced by commit 4d330a61bb1.  The new setting
file_extend_method=write_zeros can be used as a workaround for problems
reported from the field:

 * BTRFS compression is disabled by the use of posix_fallocate()
 * XFS could produce spurious ENOSPC errors in some Linux kernel
   versions, though that problem is reported to have been fixed

The default is file_extend_method=posix_fallocate if available, as
before.  The write_zeros option is similar to PostgreSQL < 16, except
that now it's multi-block.

Backpatch-through: 16
Reviewed-by: Jakub Wartak <jakub.wartak@enterprisedb.com>
Reported-by: Dimitrios Apostolou <jimis@gmx.net>
Discussion: https://postgr.es/m/b1843124-fd22-e279-a31f-252dffb6fbf2%40gmx.net
doc/src/sgml/config.sgml
src/backend/storage/file/fd.c
src/backend/storage/smgr/md.c
src/backend/utils/misc/guc_parameters.dat
src/backend/utils/misc/guc_tables.c
src/backend/utils/misc/postgresql.conf.sample
src/include/storage/fd.h