Hi, this is just a heads-up about files being generated by PostgreSQL 17 not being compressed by Btrfs, even when mounted with the force-compress mount option. I have this occuring aggressively when restoring a database via pg_restore. I think this is caused mdzeroextend() calling FileFallocate(), which in turn invokes posix_fallocate().
I also verified that turning off the use of fallocate causes the database to write compressed files again, like it did in older versions. Unfortunately the only way I found was to configure with a "hack" so that autoconf thinks the feature is not available: ./configure ac_cv_func_posix_fallocate=no There have been discussions on the btrfs mailing list about why it does that, the summary is that it is very difficult to guarantee that compressed writes will not fail with ENOSPACE on a CoW filesystem, thus files with fallocate()d ranges are treated as being marked NOCOW, effectively disabling compression. Should PostgreSQL provide a setting to avoid the use of fallocate()? Or is it the filesystem at fault for not returning EOPNOTSUPP, in which case postgres would use its fallback code? BTW even in the last case, PostgreSQL would not notice the lack of fallocate() support as glibc implements a userspace fallback in posix_fallocate(). That fallback has its own issues that hopefully will not affect postgres (see CAVEATS in man 3 posix_fallocate). Regards, Dimitris