From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Andrus <kobruleht2@hot.ee>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: How to start slave after pg_basebackup. Why min_wal_size and wal_keep_segments are duplicated
Date: Sun, 31 May 2020 14:26:28 -0700
Message-ID: <698dbad1-e3b2-f13a-8e97-8ce01efed516@aklaver.com> (raw)
In-Reply-To: <102C5FA16F1549659B393B6A824B561F@dell2>
References: <26EC9619620649D1B55C9C95811E4ADB@dell2>
<16e57e3f-5c26-fd55-d42a-f030c8550952@aklaver.com>
<102C5FA16F1549659B393B6A824B561F@dell2>
On 5/31/20 2:03 PM, Andrus wrote:
> Hi!
>
>> I'm guessing are looking for:
>> https://www.postgresql.org/docs/12/runtime-config-replication.html
>> 26.2.6. Replication Slots
>> Replication slots provide an automated way to ensure that the master
>> does not remove WAL segments until they have been received by all
>> standbys, and that the master does not remove rows which could cause a
>> recovery conflict even when the standby is disconnected.
>
> Using replication slot can cause pg_wal directoy to occupy all free disk
> space and after that server stop respondig.
>
>> This is spelled out here:
>> https://www.postgresql.org/docs/12/warm-standby.html#STREAMING-REPLICATION
>>
>> "If you use streaming replication without file-based continuous
>> archiving, the server might recycle old WAL segments before the
>> standby has received them. If this occurs, the standby will need to be
>> reinitialized from a new base backup. You can avoid this by setting
>> wal_keep_segments to a value large enough to ensure that WAL segments
>> are not recycled too early, or by configuring a replication slot for
>> the standby.
>
> Will wal_keep_segments keep segments also if named replication slot is
> lot used ?
In addition to my most recent questions:
What are you trying to achieve?
In other words why do a pg_basebackup if you have a standby receiving WALs?
>
> Andrus.
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, kobruleht2@hot.ee
Subject: Re: How to start slave after pg_basebackup. Why min_wal_size and wal_keep_segments are duplicated
In-Reply-To: <698dbad1-e3b2-f13a-8e97-8ce01efed516@aklaver.com>
References: <26EC9619620649D1B55C9C95811E4ADB@dell2> <16e57e3f-5c26-fd55-d42a-f030c8550952@aklaver.com> <102C5FA16F1549659B393B6A824B561F@dell2> <698dbad1-e3b2-f13a-8e97-8ce01efed516@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox