From: Phil Endecott <spam_from_pgsql_lists@chezphil.org>
To: pgsql-bugs@lists.postgresql.org
Cc: Andres Freund <andres@anarazel.de>
Subject: Re: BUG #15323: wal_keep_segments must be >= 1 for WAL archiving + streaming to work
Date: Mon, 13 Aug 2018 15:59:32 +0100
Message-ID: <1534172372164@dmwebmail.dmwebmail.chezphil.org> (raw)
In-Reply-To: <20180813144534.piruesukkjw6zl4b@alap3.anarazel.de>
References: <20180813144534.piruesukkjw6zl4b@alap3.anarazel.de>
Hi Andres,
Andres Freund wrote:
> On 2018-08-13 14:37:00 +0000, PG Bug reporting form wrote:
>> The following bug has been logged on the website:
>>
>> Bug reference: 15323
>> Logged by: Phil Endecott
>> Email address: spam_from_pgsql_lists@chezphil.org
>> PostgreSQL version: 9.6.10
>> Operating system: Debian Stretch
>> Description:
>>
>> I have set up a replication system that uses a combination of WAL segment
>> archiving and streaming.
>> If the slave goes down for a period, when it restarts it will initially
>> fetch WAL segment files from the archive using restore_command. After
>> fetching the last of these it will start streaming directly from the
>> master.
>> It seems that the WAL segment files may have a small empty space at the end
>> due presumably to the size of the records. In my case, the last archived
>> WAL segment ended at offset 0xFFF088. The slave therefore tried to start
>> streaming at that position. But the master had already archived that
>> segment and recycled it, because I had not set wal_keep_segments and it
>> defaults to 0. Streaming therefore failed to start.
>
> But it'll retry after failing back to archiving, no?
It will retry and keep failing indefinitely if the master is idle.
If the master is not idle, it will eventually archive the next segment which
the slave will restore. In my case, poking it to make that happen did cause
streaming to start successfully - but in general, I think it's still possible
that the master will remove the segment that is needed to start streaming.
Regards, Phil.
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-bugs@postgresql.org
Cc: spam_from_pgsql_lists@chezphil.org, andres@anarazel.de
Subject: Re: BUG #15323: wal_keep_segments must be >= 1 for WAL archiving + streaming to work
In-Reply-To: <1534172372164@dmwebmail.dmwebmail.chezphil.org>
References: <20180813144534.piruesukkjw6zl4b@alap3.anarazel.de> <1534172372164@dmwebmail.dmwebmail.chezphil.org>
* 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