Re: Retrieve the snapshot's LSN

From: Andres Freund <andres(at)anarazel(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Florent Guiliani <florent(at)guiliani(dot)fr>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Retrieve the snapshot's LSN
Date: 2015-07-16 17:13:43
Message-ID: 20150716171343.GS5520@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-07-16 13:08:48 -0400, Robert Haas wrote:
> On Thu, Jul 16, 2015 at 12:54 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> > Well, in combination with logical decoding it kinda has one: It should
> > allow you to take a dump of the database with a certain snapshot and
> > replay all transactions with a commit lsn bigger than the "snapshot's
> > lsn" and end up with a continually consistent database.
> >
> > Visibility for HS actually works precisely in commit LSN order, even if
> > that is possibly different than on the primary...
>
> That makes sense, and hopefully answers Florent's question about why
> this is only exposed through the slot mechanism.

Trying to swap-in the pub conversion, I think Florent wanted to be able to
re-sync a standby from an existing slot. Which kinda makes sense to
me. We could do something like
SELECT * FROM pg_export_snapshot_for_slot(...);

which would return the snapshot name and the LSN.

There'd need to be some finicky locking to get that, but it should b epossible.

Andres

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-07-16 17:27:53 Re: Support for N synchronous standby servers - take 2
Previous Message Robert Haas 2015-07-16 17:08:48 Re: Retrieve the snapshot's LSN