Обсуждение: Determining the WAL file needed by a standby

Поиск
Список
Период
Сортировка

Determining the WAL file needed by a standby

От
"Nicholson, Brad (Toronto, ON, CA)"
Дата:

Hi,

 

Once I’ve shut down a streaming replica standby, is there a way from the master I can tell which WAL file is going to be the earliest one needed in order for the replica to catch back up?

 

What I want to do is be able to automatically detect if that WAL file is still around so that the replica can just be started back up and catch up automatically, or if it is gone and  I need to do a resync with the master.


Thanks,

Brad.

Re: Determining the WAL file needed by a standby

От
Jaime Casanova
Дата:
On Wed, Feb 9, 2011 at 3:37 PM, Nicholson, Brad (Toronto, ON, CA)
<bnicholson@hp.com> wrote:
> Hi,
>
> Once I’ve shut down a streaming replica standby, is there a way from the
> master I can tell which WAL file is going to be the earliest one needed in
> order for the replica to catch back up?
>

that info is on the standby, you need to execute pg_controldata on the
standby and read the Latest checkpoint location, IIRC...
then, from that you can now what the segment you need is, but you have
to look for it on the master

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte y capacitación de PostgreSQL