wal_init_zero / wal_recycle

Started by Nicolas Seinletalmost 2 years ago4 messagesdocs
Jump to latest
#1Nicolas Seinlet
nicolas@seinlet.eu

Hello,

while searching the doc to solve an issue, I found the interdependency between those 2 parameters was not obvious.

Here:
https://www.postgresql.org/docs/14/runtime-config-wal.html#GUC-WAL-INIT-ZERO

the wal_init_zero set to ON cause new WAL files to be filled with zeroes.

It was not crystal clear to me that when wal_recycle is also ON , the recycled files are not filled with zeroes, because they are not considered as new. Could we add a sentence stating this?

Thanks for reading me,

Nicolas.

Attachments:

publickey - nicolas@seinlet.eu - 0x6AE98DAA.ascapplication/pgp-keys; filename="publickey - nicolas@seinlet.eu - 0x6AE98DAA.asc"; name="publickey - nicolas@seinlet.eu - 0x6AE98DAA.asc"Download
#2Peter Eisentraut
peter_e@gmx.net
In reply to: Nicolas Seinlet (#1)
Re: wal_init_zero / wal_recycle

On 24.04.24 10:08, Nicolas Seinlet wrote:

while searching the doc to solve an issue, I found the interdependency
between those 2 parameters was not obvious.

Here:
https://www.postgresql.org/docs/14/runtime-config-wal.html#GUC-WAL-INIT-ZERO <https://www.postgresql.org/docs/14/runtime-config-wal.html#GUC-WAL-INIT-ZERO&gt;

the wal_init_zero set to ON cause new WAL files to be filled with zeroes.

It was not crystal clear to me that when wal_recycle is also ON , the
recycled files are not filled with zeroes, because they are not
considered as new. Could we add a sentence stating this?

It currently says:

wal_init_zero: "... causes new WAL files to be filled with zeroes ..."

wal_recycle: "... avoiding the need to create new ones ..."

I'm not sure where exactly to make that more clear.

#3Nicolas Seinlet
nicolas@seinlet.eu
In reply to: Peter Eisentraut (#2)
Re: wal_init_zero / wal_recycle

On Wednesday, April 24th, 2024 at 10:57, Peter Eisentraut <peter@eisentraut.org> wrote:

It currently says:

wal_init_zero: "... causes new WAL files to be filled with zeroes ..."

wal_recycle: "... avoiding the need to create new ones ..."

I'm not sure where exactly to make that more clear.

You're completely right. It was not obvious to me that recycled files are not considered new, and consequently not filled by zeroes.

Nicolas.

Attachments:

publickey - nicolas@seinlet.eu - 0x6AE98DAA.ascapplication/pgp-keys; filename="publickey - nicolas@seinlet.eu - 0x6AE98DAA.asc"; name="publickey - nicolas@seinlet.eu - 0x6AE98DAA.asc"Download
#4Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Peter Eisentraut (#2)
Re: wal_init_zero / wal_recycle

On 2024-Apr-24, Peter Eisentraut wrote:

On 24.04.24 10:08, Nicolas Seinlet wrote:

It was not crystal clear to me that when wal_recycle is also ON , the
recycled files are not filled with zeroes, because they are not
considered as new. Could we add a sentence stating this?

It currently says:

wal_init_zero: "... causes new WAL files to be filled with zeroes ..."

wal_recycle: "... avoiding the need to create new ones ..."

I'm not sure where exactly to make that more clear.

It may be too subtle. Maybe we could add a note at the end:

wal_init_zero (boolean)

If set to on (the default), this option causes new WAL files to be filled with
zeroes. On some file systems, this ensures that space is allocated before we
need to write WAL records. However, Copy-On-Write (COW) file systems may not
benefit from this technique, so the option is given to skip the unnecessary
work. If set to off, only the final byte is written when the file is created so
that it has the expected size. >>Note that recycled WAL files are for these
purposes not considered new.<<

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Pero la cosa no es muy grave ..." (le petit Nicolas -- René Goscinny)