Re: Proposal: Snapshot cloning - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Proposal: Snapshot cloning
Date
Msg-id 874pqeaqdv.fsf@stark.xeocode.com
Whole thread Raw
In response to Proposal: Snapshot cloning  (Jan Wieck <JanWieck@Yahoo.com>)
Responses Re: Proposal: Snapshot cloning  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-hackers
"Jan Wieck" <JanWieck@Yahoo.com> writes:

>     backend1: select publish_snapshot(); -- will block
>
>     backend2: start transaction;
>     backend2: set transaction isolation level serializable;
>     backend2: select clone_snapshot(<pid>); -- will unblock backend1

It seems simpler to have a current_snapshot() function that returns an bytea
or a new snapshot data type which set_current_snapshot(bytea) took to change
your snapshot. Then you could use tables or out-of-band communication to pass
around your snapshots however you please. 

set_current_snapshot() would have to sanity check that the xmin of the new
snapshot isn't older than the current globaloldestxmin. 

That could be handy for debugging purposes too. 

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: Proposal: Snapshot cloning
Next
From: Theo Schlossnagle
Date:
Subject: Re: Proposal: Commit timestamp