Get LSN at which a cluster was promoted on previous timeline

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Get LSN at which a cluster was promoted on previous timeline

Jeremy Finzel
I am having a hard time finding out how I can easily determine at which LSN a streamer was promoted after promotion.  A related question is that if I pause wal replay, I am able to see the last replayed LSN but I can't simply immediately promote.

I want to know the state of the streamer post-promotion with respect to the master by getting the LSN at which it was promoted.

Thanks,
Jeremy
Reply | Threaded
Open this post in threaded view
|

Re: Get LSN at which a cluster was promoted on previous timeline

Jerry Sievers-3
Jeremy Finzel <[hidden email]> writes:

> I am having a hard time finding out how I can easily determine at
> which LSN a streamer was promoted after promotion.  A related
> question is that if I pause wal replay, I am able to see the last
> replayed LSN but I can't simply immediately promote.

Take a look at the *.history file in pg_xlog or pg_wal.

> I want to know the state of the streamer post-promotion with respect
> to the master by getting the LSN at which it was promoted.
>
> Thanks,
> Jeremy
>
>

--
Jerry Sievers
Postgres DBA/Development Consulting
e: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Get LSN at which a cluster was promoted on previous timeline

Michael Paquier-2
On Fri, Jan 04, 2019 at 08:41:35PM -0600, Jerry Sievers wrote:
> Take a look at the *.history file in pg_xlog or pg_wal.

These files are also archived.  If you want to be able to see such
contents at SQL level, you would need some parsing logic like this one
for example which is a toy of mine (this comes mainly from
rewind_parseTimeLineHistory() if I recall correctly):
https://github.com/michaelpq/pg_plugins/tree/master/wal_utils
--
Michael

signature.asc (849 bytes) Download Attachment