| From: | Thomas Munro <tmunro(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Add file_extend_method=posix_fallocate,write_zeros. |
| Date: | 2026-02-06 05:09:42 |
| Message-ID: | E1voE6A-001P0w-1V@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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(dot)wartak(at)enterprisedb(dot)com>
Reported-by: Dimitrios Apostolou <jimis(at)gmx(dot)net>
Discussion: https://postgr.es/m/b1843124-fd22-e279-a31f-252dffb6fbf2%40gmx.net
Branch
------
REL_17_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/4dac22aa10d2882c2e6fb465d7c314cc2d8fb754
Modified Files
--------------
doc/src/sgml/config.sgml | 37 +++++++++++++++++++++++++++
src/backend/storage/file/fd.c | 3 +++
src/backend/storage/smgr/md.c | 21 +++++++++++----
src/backend/utils/misc/guc_tables.c | 19 ++++++++++++++
src/backend/utils/misc/postgresql.conf.sample | 5 ++++
src/include/storage/fd.h | 11 ++++++++
6 files changed, 91 insertions(+), 5 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Thomas Munro | 2026-02-06 05:09:54 | pgsql: Add file_extend_method=posix_fallocate,write_zeros. |
| Previous Message | Thomas Munro | 2026-02-06 05:09:17 | pgsql: Add file_extend_method=posix_fallocate,write_zeros. |