Обсуждение: Wal_keep_size

Поиск
Список
Период
Сортировка

Wal_keep_size

От
Raj
Дата:
Should Wal_keep_size <= max_wal_size ?

Re: Wal_keep_size

От
Thomas Carroll
Дата:
Hope nobody minds me chipping in here.

The answer is "not necessarily."  The names make them seem closely related, but not so much.

max_wal_size is all about checkpoints.  When the WAL exceeds this, Postgres will try to run a checkpoint.  Under some circumstances it won't, but let's keep it simple for now.

wal_keep_size is all about replication.  Replicas need WAL files to stick around for long enough that they can process them.  wal_keep_size is a minimum figure.

Tom
On Monday, October 6, 2025 at 03:51:17 PM EDT, Raj <rajeshkumar.dba09@gmail.com> wrote:


Should Wal_keep_size <= max_wal_size ?

Re: Wal_keep_size

От
Raj
Дата:
If wal_keep_size is more than max_wal_size wouldn't it always trigger checkpoint ?

On Tue, 7 Oct 2025, 03:08 Thomas Carroll, <tomfecarroll@yahoo.com> wrote:
Hope nobody minds me chipping in here.

The answer is "not necessarily."  The names make them seem closely related, but not so much.

max_wal_size is all about checkpoints.  When the WAL exceeds this, Postgres will try to run a checkpoint.  Under some circumstances it won't, but let's keep it simple for now.

wal_keep_size is all about replication.  Replicas need WAL files to stick around for long enough that they can process them.  wal_keep_size is a minimum figure.

Tom
On Monday, October 6, 2025 at 03:51:17 PM EDT, Raj <rajeshkumar.dba09@gmail.com> wrote:


Should Wal_keep_size <= max_wal_size ?

Re: Wal_keep_size

От
Raj
Дата:
Note archive mode is enabled.

On Tue, 7 Oct 2025, 10:22 Raj, <rajeshkumar.dba09@gmail.com> wrote:
If wal_keep_size is more than max_wal_size wouldn't it always trigger checkpoint ?

On Tue, 7 Oct 2025, 03:08 Thomas Carroll, <tomfecarroll@yahoo.com> wrote:
Hope nobody minds me chipping in here.

The answer is "not necessarily."  The names make them seem closely related, but not so much.

max_wal_size is all about checkpoints.  When the WAL exceeds this, Postgres will try to run a checkpoint.  Under some circumstances it won't, but let's keep it simple for now.

wal_keep_size is all about replication.  Replicas need WAL files to stick around for long enough that they can process them.  wal_keep_size is a minimum figure.

Tom
On Monday, October 6, 2025 at 03:51:17 PM EDT, Raj <rajeshkumar.dba09@gmail.com> wrote:


Should Wal_keep_size <= max_wal_size ?

Re: Wal_keep_size

От
Laurenz Albe
Дата:
On Tue, 2025-10-07 at 10:22 +0530, Raj wrote:
> If wal_keep_size is more than max_wal_size wouldn't it always trigger checkpoint ?

No.  "max_wal_size" has no direct connection with the size of WAL (and I
think we should have chosen a different name for that parameter).  The
parameter is about the amount of WAL *generated since the latest checkpoint*,
not about the absolute amount of WAL present.

Yours,
Laurenz Albe