Re: CET ERROR: requested WAL segment has already been removed

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Martin Terjan <martin(at)terjan(dot)de>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: CET ERROR: requested WAL segment has already been removed
Date: 2014-02-14 09:13:41
Message-ID: CABUevEwTLgBW_=UBqpD_PBHE3fCREqSUy-s=bcwmR1SVRaSGtw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Feb 14, 2014 at 10:08 AM, Martin Terjan <martin(at)terjan(dot)de> wrote:

> Dear all,
>
> Using Postgresql 9.3. on Windows x64.
>
> I had streaming replication set up from master to slave, but the slave
> shut down and became out of sync with the master. So... I tried to set it
> back up, without success.
>
> I then checked the *master* log and, although the server seems to be
> working, the log is full with
> "CET ERROR: requested WAL segment 00000001000000090000008E has already
> been removed".
>

Note that the "CET" part of that message is actually the timezone of the
timestamp of the log message, and not part of the actual error :)

What should I do? While I have this error replication fails, because the
> slave looks for the same (missing) WAL segment. The master seems to be
> working, but of course it's possible that I've lost data somewhere.
>

If you have log archiving set up, just configure your slave so it can
access the log archive (as if restoring from a pitr backup - just add a
restore_command to recovery.conf).

If you don't have log archiving set up, you must rebuild the slave when it
has fallen so far behind that it can't catch up anymore. So a new base
backup of it.

If you don't have a log archive, you should probably also set
wal_keep_segments to a higher value to decrease the risk of it happening
again.

Is there anything sensible I can do beyond restoring from the last good
> backup?
>

For the slave, yes. The master is perfectly fine, so you don't need to do
anything about that one. The errors are listed in the master log because
they are caused by commands sent from the slave, but they do not indicate a
problem on the master.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message salah jubeh 2014-02-14 15:28:38 pg_hba.conf analysis tool
Previous Message Martin Terjan 2014-02-14 09:08:53 CET ERROR: requested WAL segment has already been removed