Re: Need help on understanding of wal_keep-segments and max_wal_size dependency.

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Swati yadav <Swati(dot)Yadav(at)Xoriant(dot)Com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Need help on understanding of wal_keep-segments and max_wal_size dependency.
Date: 2021-03-15 13:44:07
Message-ID: f8405b03fcaa9a4b14981e836567b98662625c9f.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2021-03-15 at 10:00 +0000, Swati yadav wrote:
> We are using streaming replication without feature archiving and replication slots.
>
> Could you please help us in understanding how replication will works
> when I set max_wal_size to 1GB, wal_keep_segments set to 300.
>
> In this scenario, replication is getting failed. Could you please brief
> us the causes of failure and how can we fix this issue, apart from using
> the feature archiving and replication slots.

"wal_keep_size" is irrelevant to the question.

"wal_keep_segments = 300" makes PostgreSQL keep 300 old WAL segments around
so that standby servers can catch up after a bit of downtime.

If, however, the downtime is long enough that the standby needs WAL that
is in an even earlier WAL segment that has already been archived and deleted,
the standby won't be able to catch up any more.

If you don't want to use "restore_command" or replication slots, your
only option is to increase "wal_keep_segments".

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Avinash Kumar 2021-03-15 13:56:14 Re: Postgres crashes at memcopy() after upgrade to PG 13.
Previous Message Laurenz Albe 2021-03-15 13:39:44 Re: Refcursor