Get LSN at which a cluster was promoted on previous timeline

Started by Jeremy Finzelover 7 years ago3 messagesgeneral
Jump to latest
#1Jeremy Finzel
finzelj@gmail.com

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

#2Jerry Sievers
gsievers19@comcast.net
In reply to: Jeremy Finzel (#1)
Re: Get LSN at which a cluster was promoted on previous timeline

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

#3Michael Paquier
michael@paquier.xyz
In reply to: Jerry Sievers (#2)
Re: Get LSN at which a cluster was promoted on previous timeline

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