Re: [PING] fallocate() causes btrfs to never compress postgresql files
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Dimitrios Apostolou <jimis@gmx.net>
Cc: Tomas Vondra <tomas@vondra.me>, pgsql-hackers@lists.postgresql.org, Andres Freund <andres@anarazel.de>,
Melanie Plageman <melanieplageman@gmail.com>, Heikki Linnakangas <hlinnaka@iki.fi>,
Kyotaro Horiguchi <horikyota.ntt@gmail.com>, David Rowley <dgrowleyml@gmail.com>
Date: 2025-07-10T22:45:04Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add file_extend_method=posix_fallocate,write_zeros.
- e37b59802846 16.12 landed
- 4dac22aa10d2 17.8 landed
- f94e9141a0bb 19 (unreleased) landed
- 33e3de6d77e8 18.2 landed
-
Add smgrzeroextend(), FileZero(), FileFallocate()
- 4d330a61bb19 16.0 cited
On Fri, Jul 11, 2025 at 5:39 AM Dimitrios Apostolou <jimis@gmx.net> wrote: > > I applied the patch on PostgreSQL v17 and am testing it now. I chose > > ftruncate method and I see ftruncate in action using strace while doing > > pg_restore of a big database. Nothing unexpected has happened so far. I also > > verified that files are being compressed, obeying Btrfs's mount option > > compress=zstd. > > > > Thanks for the patch! What are the odds of commiting it to v17? > > Ping. :-) > Patch behaves good for me. Any chance of applying it and backporting it? Yeah, this seems to make sense, as it is a pretty bad regression for people who are counting on BTRFS compression for their large database. Not so sure about the threshold bit -- I'd probably leave that out of the backport in the interest of stable branch-minimalism. Anyone have any better ideas, better naming, or objections?