Re: WAL & ZFS

From: Mladen Gogala <gogala(dot)mladen(at)gmail(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: WAL & ZFS
Date: 2022-03-31 23:09:24
Message-ID: 1dd2bcec-c145-b65b-21b8-0e391b05e8e4@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 3/31/22 18:47, Holger Jakobs wrote:
> The WAL is a journal itself and doesn't need another journal for
> safety. Therefore, a common recommendation is using ext2 (which has no
> journal) for the WAL partition.
>
> Is this correct?
>
> Am 31.03.22 um 23:32 schrieb Rui DeSousa:
>> I would recommend a separate pg_wal filesystem with the record size
>> to match the WAL page size; in my case 16k.  I have keep the default
>> record size at 128k for the data volume and that configuration has
>> worked well for supporting large DSS while using 16k data blocks.
>>
>>> On Mar 30, 2022, at 5:32 PM, Scott Ribe
>>> <scott_ribe(at)elevated-dev(dot)com> wrote:
>>>
>>> I've read all the info I could find re running PG on ZFS: turn off
>>> full page writes, turn on lz4, tweak recordsize so as to take
>>> advantage of compression, etc. One thing I haven't seen is whether a
>>> separate volume for WAL would benefit from a larger recordsize. Or
>>> any other tweaks???
>>>
>>> --
>>> Scott Ribe
>>> scott_ribe(at)elevated-dev(dot)com
>>> https://www.linkedin.com/in/scottribe/
>>>
>>>
>>>
>>>
>>>
>>
>>
Journallng file systems journal file operations like open, close,
create, extend, rename or delete, not file block operations. File blocks
are not protected by file system journalling, just the inodes. The file
system journal prevents you from losing files in case of sudden machine
crash, like when the machine loses power. It has nothing to do with the
block change journaling, which is the role of WAL files. WAL files
record the changes to database blocks. With ext2, it would be possible
to lose a WAL log in case of a sudden crash and that might prevent the
cluster recovery. File system journaling has nothing to do with WAL
logs. I would strongly advise against using ext2 for WAL logs.

Regards

--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Ribe 2022-03-31 23:13:29 Re: WAL & ZFS
Previous Message Scott Ribe 2022-03-31 22:58:08 Re: WAL & ZFS