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

Get LSN at which a cluster was promoted on previous timeline

From
Jeremy Finzel
Date:
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

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

From
Jerry Sievers
Date:
Jeremy Finzel <finzelj@gmail.com> 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: postgres.consulting@comcast.net


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

From
Michael Paquier
Date:
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

Attachment