Re: Retrieve the snapshot's LSN

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Florent Guiliani <florent(at)guiliani(dot)fr>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Retrieve the snapshot's LSN
Date: 2015-07-17 12:11:49
Message-ID: CA+TgmoaxO3MGwb6+31j18kx-3-umh8dnQLA_rYc-97KnimxVxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 17, 2015 at 4:16 AM, Florent Guiliani <florent(at)guiliani(dot)fr> wrote:
>> but such an LSN need not exist. Suppose A writes a commit record at
>> LSN 0/10000, and then B writes a commit record at 0/10100, and then B
>> calls ProcArrayEndTransaction(). At this point, B is visible and A is
>> not visible, even though A's commit record precedes that of B.
>
> Maybe that's what Andres referred as "doable with some finicky locking".
>
> There is some race conditions to build a snapshot with an associated
> consistent LSN. If I understand your example, A is supposed to call
> ProcArrayEndTransaction() anytime soon.

Right.

> Could we wait/lock until it
> happens?

In theory, yes. I'm not sure what the code would would look like, though.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shulgin, Oleksandr 2015-07-17 12:20:05 Re: [PATCH] Generalized JSON output functions
Previous Message Geoff Winkless 2015-07-17 10:52:39 segfault in 9.5alpha - plpgsql function, implicit cast and IMMUTABLE cast function