Re: advancing snapshot's xmin - Mailing list pgsql-hackers

From Tom Lane
Subject Re: advancing snapshot's xmin
Date
Msg-id 22651.1206547132@sss.pgh.pa.us
Whole thread Raw
In response to Re: advancing snapshot's xmin  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: advancing snapshot's xmin  (Gregory Stark <stark@enterprisedb.com>)
Re: advancing snapshot's xmin  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> Uhm, yeah, I somehow didn't write was I was thinking. I didn't mean to say we
> would be taking a new snapshot for each INSERT but that we would be resetting
> xmin for each INSERT. Whereas currently we only set xmin once when we set the
> serializable snapshot.

Right, but setting xmin within GetSnapshotData is essentially free.
What I'm envisioning is that we lose the notion of "this is a
serializable snapshot" that that function currently has, and just
give it the rule "if MyProc->xmin is currently zero, then set it".
Then the only additional mechanism needed is for the snapshot
manager to detect when all snapshots are gone and zero out
MyProc->xmin --- that would happen sometime during command shutdown,
and per current discussion it shouldn't need a lock.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: Script binaries renaming
Next
From: "Gurjeet Singh"
Date:
Subject: Re: having problem in rsync'ing cvs