max_wal_size

Started by Pavel Luzanovalmost 6 years ago4 messagesdocs
Jump to latest
#1Pavel Luzanov
p.luzanov@postgrespro.ru

Hello,

About parameter max_wal_size the documentation
<https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-MAX-WAL-SIZE&gt;
says: "Maximum size to let the WAL grow to between automatic WAL
checkpoints."
Is it correct?

The size between automatic WAL checkpoints or the size of all WAL files
in the pg_wal directory?

-----
Pavel Luzanov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

#2Andreas Kretschmer
andreas@a-kretschmer.de
In reply to: Pavel Luzanov (#1)
Re: max_wal_size

Am 27.05.20 um 12:11 schrieb Pavel Luzanov:

Hello,

About parameter max_wal_size the documentation
<https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-MAX-WAL-SIZE&gt;
says: "Maximum size to let the WAL grow to between automatic WAL
checkpoints."
Is it correct?

The size between automatic WAL checkpoints or the size of all WAL
files in the pg_wal directory?

size between checkpoints, size of all wal's can be higher, see
wal_keep_segments.

Regards, Andreas

--
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com

#3Pavel Luzanov
p.luzanov@postgrespro.ru
In reply to: Andreas Kretschmer (#2)
Re: max_wal_size

Andreas,

size between checkpoints, size of all wal's can be higher, see
wal_keep_segments.

Hm, I also thought, but after looking at the source
<https://github.com/postgres/postgres/blob/REL_10_STABLE/src/backend/access/transam/xlog.c#L2224&gt;,
it seems like this is a restriction on all files in pg_wal.

-----
Pavel Luzanov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

#4Egor Rogov
e.rogov@postgrespro.ru
In reply to: Andreas Kretschmer (#2)
Re: max_wal_size

On 27.05.2020 13:16, Andreas Kretschmer wrote:

Am 27.05.20 um 12:11 schrieb Pavel Luzanov:

Hello,

About parameter max_wal_size the documentation
<https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-MAX-WAL-SIZE&gt;
says: "Maximum size to let the WAL grow to between automatic WAL
checkpoints."
Is it correct?

The size between automatic WAL checkpoints or the size of all WAL
files in the pg_wal directory?

size between checkpoints, size of all wal's can be higher, see
wal_keep_segments.

It is clear that total size can be higher due to wal_keep_segments,
replications slots, archive_command etc.

But does max_wal_size relate to the (a) two subsequent checkpoints (as
you may read the wording in the docs) or (b) to the past completed
checkpoint AND the current yet-uncompleted checkpoint (which together
may be up to TWO checkpoint intervals)?

If I read CalculateCheckpointSegments() in xlog.c correctly, the answer
is (b), and hence the documentation is misleading.

Regards,
Egor.