[PING] fallocate() causes btrfs to never compress postgresql files
От | Dimitrios Apostolou |
---|---|
Тема | [PING] fallocate() causes btrfs to never compress postgresql files |
Дата | |
Msg-id | b1843124-fd22-e279-a31f-252dffb6fbf2@gmx.net обсуждение исходный текст |
Ответы |
Re: [PING] fallocate() causes btrfs to never compress postgresql files
|
Список | pgsql-hackers |
Hello, sorry for mass sending this, but I didn't get any response to my first email [1] so I'm now CC'ing the commit's 4d330a6 [2] author and the reviewers. I think it's an important issue, because I need to custom-compile postgresql to have what I had before: a transparently compressed database. [1] https://www.postgresql.org/message-id/d0f4fc11-969d-7b3a-aacf-00f86450e738@gmx.net [2] https://github.com/postgres/postgres/commit/4d330a61bb1969df31f2cebfe1ba9d1d004346d8 My previous message follows: 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
В списке pgsql-hackers по дате отправления: