FATAL: requested WAL segment has already been removed

From: Patrick B <patrickbakerbr(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: FATAL: requested WAL segment has already been removed
Date: 2017-01-05 22:07:37
Message-ID: CAJNY3iu73vHYFzpuJ0tbt72RZa7o7Zq7NG-g1mxhuyRJHbY+rQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I got this scenario:

master01
--> slave01 ---> slave02 -----> slave03 -------> slave04

As you can see, slave03 replicates from slave02 and slave04 from slave03.

I'm promoting slave03 into a master, and trying to make slave04 to be able
to connect to its new master.

AS i'm using PostgreSQL 9.1, I need to manually copy the .history files
from pg_xlog on slave03 to pg_xlog on slave04 (I don't need to copy the wal
files as my archive_command does that).

When I promote slave03:

pg_ctl promote -D datadir

... it works fine!

Then, I restart postgres on slave04 with the new history file and the
message that I get is:

FATAL: could not receive data from WAL stream: 00000000000400000001234
FATAL: requested WAL segment has already been removed

Why does that happen? I can't find 00000000000400000001234 even on the
slave03(new master)! wal_keep_segments is 500.

Thanks
Patrick

Browse pgsql-general by date

  From Date Subject
Next Message Paul Ramsey 2017-01-05 22:09:03 Re: Improve PostGIS performance with 62 million rows?
Previous Message Tom Lane 2017-01-05 22:04:09 Re: psql error (encoding related?)