Add file_extend_method=posix_fallocate,write_zeros.
Thomas Munro <tmunro@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/config.sgml | modified | +37 −0 |
| src/backend/storage/file/fd.c | modified | +3 −0 |
| src/backend/storage/smgr/md.c | modified | +16 −5 |
| src/backend/utils/misc/guc_parameters.dat | modified | +7 −0 |
| src/backend/utils/misc/guc_tables.c | modified | +9 −0 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +4 −0 |
| src/include/storage/fd.h | modified | +11 −0 |
Discussion
- [PING] fallocate() causes btrfs to never compress postgresql files 40 messages · 2025-05-28 → 2026-02-06